[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

intel-gpu-tools: Changes to 'upstream-unstable'



 Android.mk                             |  531 +++++++++++++
 Makefile.am                            |    2 
 benchmarks/Makefile.am                 |    4 
 configure.ac                           |   19 
 debugger/Makefile.am                   |    2 
 demos/.gitignore                       |    2 
 demos/Makefile.am                      |    6 
 demos/intel_sprite_on.c                | 1068 ++++++++++++++++++++++++++
 demos/sprite_on.c                      | 1222 ------------------------------
 lib/Makefile.am                        |    5 
 lib/drmtest.c                          |  495 ++++++++++--
 lib/drmtest.h                          |   48 +
 lib/gen7_render.h                      |  222 +++++
 lib/instdone.c                         |   30 
 lib/intel_batchbuffer.c                |   50 -
 lib/intel_batchbuffer.h                |   11 
 lib/intel_chipset.h                    |  102 ++
 lib/intel_dpio.c                       |   94 ++
 lib/intel_drm.c                        |    5 
 lib/intel_gpu_tools.h                  |    8 
 lib/intel_mmio.c                       |   21 
 lib/intel_pci.c                        |    2 
 lib/intel_reg.h                        |  276 ++++++
 lib/rendercopy.h                       |    9 
 lib/rendercopy_gen7.c                  |  801 +++++++++++++++++++
 lib/rendercopy_i830.c                  |  411 +++-------
 man/Makefile.am                        |    2 
 man/intel_infoframes.man               |   26 
 man/intel_panel_fitter.man             |   50 +
 man/intel_reg_dumper.man               |   23 
 scripts/convert_itp.py                 |   17 
 scripts/display_debug.sh               |  172 ++++
 shaders/ps/README                      |    1 
 shaders/ps/blit.g7a                    |   66 +
 shaders/ps/neg1_test.g7a               |    9 
 tests/.gitignore                       |   23 
 tests/Makefile.am                      |   43 +
 tests/ZZ_hangman                       |   34 
 tests/check_drm_clients                |   30 
 tests/debugfs_emon_crash               |   26 
 tests/debugfs_reader                   |   24 
 tests/debugfs_wedged                   |   10 
 tests/drm_lib.sh                       |   32 
 tests/flip_test.c                      |  317 +++++++
 tests/gem_bad_length.c                 |    2 
 tests/gem_basic.c                      |   19 
 tests/gem_cpu_concurrent_blit.c        |  142 +++
 tests/gem_cs_prefetch.c                |    2 
 tests/gem_ctx_bad_destroy.c            |  109 ++
 tests/gem_ctx_bad_exec.c               |  125 +++
 tests/gem_ctx_basic.c                  |  166 ++++
 tests/gem_ctx_create.c                 |   64 +
 tests/gem_ctx_exec.c                   |  139 +++
 tests/gem_exec_blt.c                   |    2 
 tests/gem_exec_faulting_reloc.c        |   16 
 tests/gem_exec_nop.c                   |    2 
 tests/gem_fence_thrash.c               |   33 
 tests/gem_gtt_concurrent_blit.c        |  145 +++
 tests/gem_gtt_cpu_tlb.c                |  108 ++
 tests/gem_gtt_speed.c                  |   83 +-
 tests/gem_linear_blits.c               |    6 
 tests/gem_mmap.c                       |   34 
 tests/gem_mmap_offset_exhaustion.c     |   96 ++
 tests/gem_readwrite.c                  |    7 
 tests/gem_reg_read.c                   |   98 ++
 tests/gem_ringfill.c                   |  171 +++-
 tests/gem_set_tiling_vs_blt.c          |  269 ++++++
 tests/gem_set_tiling_vs_gtt.c          |  137 +++
 tests/gem_set_tiling_vs_pwrite.c       |   99 ++
 tests/gem_storedw_batches_loop.c       |    7 
 tests/gem_storedw_loop_blt.c           |   18 
 tests/gem_storedw_loop_bsd.c           |   24 
 tests/gem_storedw_loop_render.c        |   11 
 tests/gem_stress.c                     |    5 
 tests/gem_tiled_blits.c                |    3 
 tests/gem_tiled_fence_blits.c          |    3 
 tests/gem_tiled_partial_pwrite_pread.c |  294 +++++++
 tests/gem_tiled_pread_pwrite.c         |    2 
 tests/gem_unfence_active_buffers.c     |  171 ++++
 tests/gem_wait_render_timeout.c        |  230 +++++
 tests/gen3_mixed_blits.c               |    6 
 tests/gen3_render_linear_blits.c       |    3 
 tests/gen3_render_mixed_blits.c        |    3 
 tests/gen3_render_tiledx_blits.c       |    3 
 tests/gen3_render_tiledy_blits.c       |    3 
 tests/module_reload                    |   41 +
 tests/pass.png                         |binary
 tests/prime_nv_api.c                   |  408 ++++++++++
 tests/prime_nv_pcopy.c                 | 1329 +++++++++++++++++++++++++++++++++
 tests/prime_nv_test.c                  |  582 ++++++++++++++
 tests/prime_self_import.c              |  123 +++
 tests/sysfs_l3_parity                  |   27 
 tests/sysfs_rc6_residency.c            |  119 ++
 tests/testdisplay.c                    |  591 ++------------
 tools/.gitignore                       |    4 
 tools/Makefile.am                      |   13 
 tools/forcewaked.c                     |  106 --
 tools/intel_audio_dump.c               |  590 ++++++++++++++
 tools/intel_dpio_read.c                |   68 +
 tools/intel_dpio_write.c               |   67 +
 tools/intel_error_decode.c             |    4 
 tools/intel_forcewaked.c               |  106 ++
 tools/intel_gpu_top.c                  |    4 
 tools/intel_gtt.c                      |   46 -
 tools/intel_infoframes.c               | 1142 ++++++++++++++++++++++++++++
 tools/intel_l3_parity.c                |  159 +++
 tools/intel_panel_fitter.c             |  344 ++++++++
 tools/intel_reg_dumper.c               |  423 ++++++++--
 tools/intel_reg_read.c                 |   80 +
 109 files changed, 12992 insertions(+), 2595 deletions(-)

New commits:
commit dd5f40f50c02e8ef68ac9bbee3e94302e7baeed3
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Aug 27 09:37:01 2012 +0200

    bump to 1.3 release

diff --git a/configure.ac b/configure.ac
index c493058..0ba7ce7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([intel-gpu-tools],
-        [1.2],
+        [1.3],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [intel-gpu-tools])
 

commit 7a02aa4cbfe4c63bb9435cf9cab487bd1df10185
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Aug 26 21:22:15 2012 +0100

    mmio: Limit the uc- mapping to only map the registers
    
    In the future, we may like to enable wc mapping of at least the GATT,
    and so causing a conflict if we attempt to map the entire bar as uc-
    here. Obviously we need a better fallback plan, but for the moment only
    attempt to map the portion of the pci space that we use for register
    access.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c
index b266847..ecb049b 100644
--- a/lib/intel_mmio.c
+++ b/lib/intel_mmio.c
@@ -80,8 +80,8 @@ intel_map_file(char *file)
 void
 intel_get_mmio(struct pci_device *pci_dev)
 {
-	uint32_t devid;
-	int mmio_bar;
+	uint32_t devid, gen;
+	int mmio_bar, mmio_size;
 	int error;
 
 	devid = pci_dev->device_id;
@@ -90,11 +90,19 @@ intel_get_mmio(struct pci_device *pci_dev)
 	else
 		mmio_bar = 0;
 
+	gen = intel_gen(devid);
+	if (gen < 3)
+		mmio_size = 64*1024;
+	else if (gen < 5)
+		mmio_size = 512*1024;
+	else
+		mmio_size = 2*1024*1024;
+
 	error = pci_device_map_range (pci_dev,
-				    pci_dev->regions[mmio_bar].base_addr,
-				    pci_dev->regions[mmio_bar].size,
-				    PCI_DEV_MAP_FLAG_WRITABLE,
-				    &mmio);
+				      pci_dev->regions[mmio_bar].base_addr,
+				      mmio_size,
+				      PCI_DEV_MAP_FLAG_WRITABLE,
+				      &mmio);
 
 	if (error != 0) {
 		fprintf(stderr, "Couldn't map MMIO region: %s\n",

commit a4783f9485f78c80e7cc1eb041634b4b8a3aa4b9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Aug 26 21:22:14 2012 +0100

    intel_gtt: Harden against changes to kernel mappings of the GTT
    
    Rather than use the common mmio segment which will be in future
    restricted to just the registers and so exclude the GTT portion on all
    architectures, explicitly mmap the GTT ourselves. Repeat this mmapping
    with a couple of flags until we matching the existing kernel mapping.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/tools/intel_gtt.c b/tools/intel_gtt.c
index c246fda..05d36d7 100644
--- a/tools/intel_gtt.c
+++ b/tools/intel_gtt.c
@@ -45,33 +45,47 @@ int main(int argc, char **argv)
 	int start, aper_size;
 	unsigned char *gtt;
 	uint32_t devid;
+	int flag[] = {
+		PCI_DEV_MAP_FLAG_WRITE_COMBINE,
+		PCI_DEV_MAP_FLAG_WRITABLE,
+		0
+	}, f;
 
 	pci_dev = intel_get_pci_device();
 	devid = pci_dev->device_id;
-	intel_get_mmio(pci_dev);
 
 	if (IS_GEN2(devid)) {
 		printf("Unsupported chipset for gtt dumper\n");
 		exit(1);
 	}
 
-	if (IS_G4X(devid) || IS_GEN5(devid))
-		gtt = ((unsigned char *)mmio + MB(2));
-	else if (IS_965(devid))
-		gtt = ((unsigned char *)mmio + KB(512));
-	else {
-		/* 915/945 chips has GTT range in bar 3 */
-		int err;
-		err = pci_device_map_range(pci_dev,
-					   pci_dev->regions[3].base_addr,
-					   pci_dev->regions[3].size,
-					   PCI_DEV_MAP_FLAG_WRITABLE,
-					   (void **)&gtt);
-		if (err != 0) {
-			fprintf(stderr, "mapping GTT bar failed\n");
-			exit(1);
+	for (f = 0; flag[f] != 0; f++) {
+		if (IS_GEN3(devid)) {
+			/* 915/945 chips has GTT range in bar 3 */
+			if (pci_device_map_range(pci_dev,
+						 pci_dev->regions[3].base_addr,
+						 pci_dev->regions[3].size,
+						 flag[f],
+						 (void **)&gtt) == 0)
+				break;
+		} else {
+			int offset;
+			if (IS_G4X(devid) || IS_GEN5(devid))
+				offset = MB(2);
+			else
+				offset = KB(512);
+			if (pci_device_map_range(pci_dev,
+						 pci_dev->regions[0].base_addr + offset,
+						 offset,
+						 flag[f],
+						 (void **)&gtt) == 0)
+				break;
 		}
 	}
+	if (flag[f] == 0) {
+		printf("Failed to map gtt\n");
+		exit(1);
+	}
 
 	aper_size = pci_dev->regions[2].size;
 

commit 3d148e164d498d81cc3990c85b65afee8bcca3b8
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Aug 25 00:01:27 2012 +0200

    s/NO_PID/NOP_ID
    
    Alan typo'ed it, I've failed to notice :(

diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index c09343a..ae220b8 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -428,7 +428,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 # define I830_PRIMARY_RING_1_DONE	(1 << 1)
 # define I830_PRIMARY_RING_0_DONE	(1 << 0)
 
-#define NO_PID                   0x2094
+#define NOP_ID                   0x2094
 
 #define SCPD0                    0x209c	/* debug */
 #define INST_PS                  0x20c4
diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c
index 6505033..b49d967 100644
--- a/tools/intel_reg_dumper.c
+++ b/tools/intel_reg_dumper.c
@@ -1897,7 +1897,7 @@ static struct reg_debug i945gm_mi_regs[] = {
 	DEFINEREG(IPEIR),
 	DEFINEREG(IPEHR),
 	DEFINEREG(INST_DONE),
-	DEFINEREG(NO_PID),
+	DEFINEREG(NOP_ID),
 	DEFINEREG(HWSTAM),
 	DEFINEREG(SCPD0),
 	DEFINEREG(IER),

commit 1b5fd314fd474827373f6f48fa11fcb60687f5a2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Aug 24 14:02:04 2012 -0700

    Add --disable-nouveau option for platforms without nouveau support
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/configure.ac b/configure.ac
index 74aa101..c493058 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,16 @@ PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 
 # for dma-buf tests
-PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
+AC_ARG_ENABLE(nouveau,
+              AS_HELP_STRING([--disable-nouveau],
+              [Enable use of nouveau API for prime tests (default: enabled)]),
+              [NOUVEAU=$enableval], [NOUVEAU=yes])
+if test "x$NOUVEAU" = xyes; then
+   PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
+   AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
+fi
+AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
+
 
 # for testdisplay
 PKG_CHECK_MODULES(CAIRO, cairo)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9f8c798..e29a383 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,6 +4,13 @@ noinst_PROGRAMS = \
 	$(HANG) \
 	$(NULL)
 
+if HAVE_NOUVEAU
+NOUVEAU_TESTS = \
+	prime_nv_api  \
+	prime_nv_pcopy \
+	prime_nv_test
+endif
+
 TESTS_progs = \
 	getversion \
 	getclient \
@@ -71,9 +78,7 @@ TESTS_progs = \
 	gem_ctx_bad_exec \
 	gem_ctx_basic \
 	gem_reg_read \
-	prime_nv_api  \
-	prime_nv_pcopy \
-	prime_nv_test \
+	$(NOUVEAU_TESTS) \
 	prime_self_import \
 	$(NULL)
 

commit 4cdfa8e9b7177a12d7d693207be52a6c999236ef
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Aug 24 14:02:03 2012 -0700

    flip_test: add cast to pacify Solaris Studio compiler
    
    Fixes build error:
    "flip_test.c", line 180: improper pointer/integer combination: op "="
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/tests/flip_test.c b/tests/flip_test.c
index a6eb0c0..6710590 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -177,7 +177,7 @@ static void connector_find_preferred_mode(struct test_output *o, int crtc_id)
 static void
 paint_flip_mode(cairo_t *cr, int width, int height, void *priv)
 {
-	bool odd_frame = priv;
+	bool odd_frame = (bool) priv;
 
 	if (odd_frame)
 		cairo_rectangle(cr, width/4, height/2, width/4, height/8);

commit 6b3e6f28d2ba738fd2677b6c3e4f7ec03d9a463a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Aug 24 14:02:02 2012 -0700

    Rename NOPID to NO_PID to avoid conflict with Solaris NOPID
    
    Solaris <sys/types.h> already has #define NOPID (pid_t)(-1)
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index ffded64..c09343a 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -428,7 +428,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 # define I830_PRIMARY_RING_1_DONE	(1 << 1)
 # define I830_PRIMARY_RING_0_DONE	(1 << 0)
 
-#define NOPID                    0x2094
+#define NO_PID                   0x2094
 
 #define SCPD0                    0x209c	/* debug */
 #define INST_PS                  0x20c4
diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c
index a994f00..6505033 100644
--- a/tools/intel_reg_dumper.c
+++ b/tools/intel_reg_dumper.c
@@ -1897,7 +1897,7 @@ static struct reg_debug i945gm_mi_regs[] = {
 	DEFINEREG(IPEIR),
 	DEFINEREG(IPEHR),
 	DEFINEREG(INST_DONE),
-	DEFINEREG(NOPID),
+	DEFINEREG(NO_PID),
 	DEFINEREG(HWSTAM),
 	DEFINEREG(SCPD0),
 	DEFINEREG(IER),

commit 99fdba921ed88381ab721b15299e637366042465
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Aug 24 14:02:01 2012 -0700

    Fall back to CLOCK_MONOTONIC on systems without CLOCK_MONOTONIC_RAW
    
    Solaris has not yet adopted this Linux extension
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c
index bbe98c0..c321d36 100644
--- a/tests/gem_wait_render_timeout.c
+++ b/tests/gem_wait_render_timeout.c
@@ -144,6 +144,10 @@ int main(int argc, char **argv)
 		struct timespec start, end;
 		long diff;
 
+#ifndef CLOCK_MONOTONIC_RAW
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif
+
 		assert(clock_gettime(CLOCK_MONOTONIC_RAW, &start) == 0);
 		for (i = 0; i < iter; i++)
 			blt_color_fill(batch, dst, BUF_PAGES);

commit e40146878e4cf74a96fd0c42342065f7cd85fa97
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Aug 24 23:18:48 2012 +0200

    Revert "tests: disable nouveau if unavailable"
    
    This reverts commit dd8325323bfcca1f742e864ca7d87101a0d59936.
    
    I like the patch from Alan Coopersmith with an explicit disable
    option better.

diff --git a/configure.ac b/configure.ac
index ddc59fd..74aa101 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,9 +60,7 @@ PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 
 # for dma-buf tests
-PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33], nouveau=yes, nouveau=no)
-
-AM_CONDITIONAL(BUILD_NOUVEAU, [test "x$nouveau" != xno])
+PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
 
 # for testdisplay
 PKG_CHECK_MODULES(CAIRO, cairo)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 282d55c..9f8c798 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -71,17 +71,11 @@ TESTS_progs = \
 	gem_ctx_bad_exec \
 	gem_ctx_basic \
 	gem_reg_read \
-	prime_self_import \
-	$(NULL)
-
-if BUILD_NOUVEAU
-TESTS_progs += \
 	prime_nv_api  \
 	prime_nv_pcopy \
 	prime_nv_test \
+	prime_self_import \
 	$(NULL)
-endif
-
 
 # IMPORTANT: The ZZ_ tests need to be run last!
 # ... and make can't deal with inlined comments ...

commit dd8325323bfcca1f742e864ca7d87101a0d59936
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Aug 24 22:55:20 2012 +0200

    tests: disable nouveau if unavailable

diff --git a/configure.ac b/configure.ac
index 74aa101..ddc59fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,9 @@ PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 
 # for dma-buf tests
-PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
+PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33], nouveau=yes, nouveau=no)
+
+AM_CONDITIONAL(BUILD_NOUVEAU, [test "x$nouveau" != xno])
 
 # for testdisplay
 PKG_CHECK_MODULES(CAIRO, cairo)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9f8c798..282d55c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -71,11 +71,17 @@ TESTS_progs = \
 	gem_ctx_bad_exec \
 	gem_ctx_basic \
 	gem_reg_read \
+	prime_self_import \
+	$(NULL)
+
+if BUILD_NOUVEAU
+TESTS_progs += \
 	prime_nv_api  \
 	prime_nv_pcopy \
 	prime_nv_test \
-	prime_self_import \
 	$(NULL)
+endif
+
 
 # IMPORTANT: The ZZ_ tests need to be run last!
 # ... and make can't deal with inlined comments ...

commit 425940be1d894459cead9aaf211a74338480aaa3
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Aug 24 22:50:21 2012 +0200

    tests/prime_nv_test: add missing call for test8

diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index bda96ad..2269f84 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -566,6 +566,10 @@ int main(int argc, char **argv)
 	if (ret)
 		fprintf(stderr,"prime_test: failed test 7\n");
 
+	ret = test8();
+	if (ret)
+		fprintf(stderr,"prime_test: failed test 8\n");
+
 	intel_batchbuffer_free(intel_batch);
 
 	nouveau_device_del(&ndev);

commit c5b7ebc1cc4ecb4db8e691ba0d935826c6da2ebf
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Aug 24 22:49:40 2012 +0200

    tests/prime_nv_pcopy: kill debug code that's not upstream

diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index ada0e44..21dccf3 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -535,24 +535,10 @@ static int perform_copy(struct nouveau_bo *nvbo, const rect *dst,
 	uint32_t src_off = 0, dst_off = 0;
 	struct nouveau_pushbuf *push = npush;
 
-	if (nvbi->config.nv50.tile_mode == tile_intel_y) {
+	if (nvbi->config.nv50.tile_mode == tile_intel_y)
 		dbg("src is y-tiled\n");
-		exec |= 0 << 16; // unk11
-		exec |= 0 << 20; // unk14
-		exec |= 0 << 24; // unk1
-		exec |= 0 << 29; // unk10
-		exec |= 0 << 30; // unk19
-		exec |= 0 << 31; // unk20 (nvc0 and later)
-	}
-	if (nvbo->config.nv50.tile_mode == tile_intel_y) {
+	if (nvbo->config.nv50.tile_mode == tile_intel_y)
 		dbg("dst is y-tiled\n");
-		exec |= 0 << 16; // unk11
-		exec |= 0 << 20; // unk14
-		exec |= 0 << 24; // unk1
-		exec |= 0 << 29; // unk10
-		exec |= 0 << 30; // unk19
-		exec |= 0 << 31; // unk20 (nvc0 and later)
-	}
 
 	if (nouveau_pushbuf_space(push, 64, 0, 0) ||
 	    nouveau_pushbuf_refn(push, refs, 3))

commit 94ec3f926c2a8e0706a93b20892aa1a25a504e99
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Aug 24 15:45:09 2012 +0200

    tests/prime_nv: don't enable buffer reuse
    
    We share these suckers, hence the fd-local libdrn instance does not
    have full control over the lifecycle of the object. Prevents the tests
    from blowing up with
    
    [drm:i915_gem_mmap_gtt] *ERROR* Attempting to mmap a purgeable buffer
    
    and similar things.
    
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index 5cd0813..962e903 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -326,7 +326,8 @@ int main(int argc, char **argv)
 	bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
 	if (!bufmgr)
 		return -1;
-	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+	/* Do not enable reuse, we share (almost) all buffers. */
+	//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
 
 	bufmgr2 = drm_intel_bufmgr_gem_init(intel_fd2, 4096);
 	if (!bufmgr2)
diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index 0b3b92a..ada0e44 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -1292,7 +1292,8 @@ int main(int argc, char **argv)
 	bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
 	if (!bufmgr)
 		return -1;
-	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+	/* Do not enable reuse, we share (almost) all buffers. */
+	//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
 
 	/* set up nouveau bufmgr */
 	ret = init_nouveau();
diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index 4a3d043..bda96ad 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -517,7 +517,8 @@ int main(int argc, char **argv)
 	bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
 	if (!bufmgr)
 		return -1;
-	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+	/* Do not enable reuse, we share (almost) all buffers. */
+	//drm_intel_bufmgr_gem_enable_reuse(bufmgr);
 
 	/* set up nouveau bufmgr */
 	ret = nouveau_device_wrap(nouveau_fd, 0, &ndev);

commit d4005511443e385b54b11754681f7bf44b6d9796
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Aug 23 11:37:09 2012 -0700

    Converted a display debug script for use by designers
    
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

diff --git a/scripts/convert_itp.py b/scripts/convert_itp.py
new file mode 100755
index 0000000..4474f34
--- /dev/null
+++ b/scripts/convert_itp.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+#this script helps to convert internal debugger scripts given to us into our tools
+
+import sys
+import fileinput
+
+def replace_with_dict(text, dicto):
+	for key, val in dicto.items():
+		text = text.replace(key, val)
+	return text
+
+for lines in fileinput.input([sys.argv[1]], inplace=True):
+	lines = lines.strip()
+	if lines == '': continue # strip empty lines
+	replace_dict = {'dword(' : '../tools/intel_reg_read ', 'MMADDR + ' : '', '//' : '#', ')p;' : '', ')p ' : ' -c '}
+	print(replace_with_dict(lines, replace_dict))
diff --git a/scripts/display_debug.sh b/scripts/display_debug.sh
new file mode 100755
index 0000000..f854f90
--- /dev/null
+++ b/scripts/display_debug.sh
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+# FBC_CFB_BASE 0x43200
+../tools/intel_reg_read 0x43200
+# FBC_CTL 0x43208
+../tools/intel_reg_read 0x43208
+# ERR_INT 0x44040
+../tools/intel_reg_read 0x44040
+# DE_RRMR 0x44050
+../tools/intel_reg_read 0x44050
+# ARB_CTL 0x45000
+../tools/intel_reg_read 0x45000
+# ARB_CTL2 0x45004
+../tools/intel_reg_read 0x45004
+# MSG_CTL 0x45010
+../tools/intel_reg_read 0x45010
+# Watermarks
+../tools/intel_reg_read 0x45100
+../tools/intel_reg_read 0x45104
+../tools/intel_reg_read 0x45200
+../tools/intel_reg_read 0x45108
+../tools/intel_reg_read 0x4510C
+../tools/intel_reg_read 0x45110
+../tools/intel_reg_read 0x45120
+../tools/intel_reg_read 0x45124
+../tools/intel_reg_read 0x45128
+# Pipe A timing 0x60000-0x6004C
+../tools/intel_reg_read 0x60000 -c 0x13;
+# Pipe B timing 0x61000-0x6104C
+../tools/intel_reg_read 0x61000 -c 0x13;
+# Pipe C timing 0x62000-0x6204C
+../tools/intel_reg_read 0x62000 -c 0x13;
+# FDI A 0x60100
+# FDI B 0x61100
+# FDI C 0x62100
+# EDP 0x64000
+../tools/intel_reg_read 0x60100
+../tools/intel_reg_read 0x61100
+../tools/intel_reg_read 0x62100
+../tools/intel_reg_read 0x64000
+# Panel fitter A window size 0x68074
+# Panel fitter A control 0x68080
+../tools/intel_reg_read 0x68074
+../tools/intel_reg_read 0x68080
+# Panel fitter B window size 0x68874
+# Panel fitter B control 0x68880
+../tools/intel_reg_read 0x68874
+../tools/intel_reg_read 0x68880
+# Panel fitter C window size 0x69074
+# Panel fitter C control 0x69080
+../tools/intel_reg_read 0x69074
+../tools/intel_reg_read 0x69080
+# Pipe A config 0x70008
+# Pipe B config 0x71008
+# Pipe C config 0x72008
+../tools/intel_reg_read 0x70008
+../tools/intel_reg_read 0x71008
+../tools/intel_reg_read 0x72008
+# Cursor A control 0x70080
+# Cursor B control 0x71080
+# Cursor C control 0x72080
+../tools/intel_reg_read 0x70080
+../tools/intel_reg_read 0x71080
+../tools/intel_reg_read 0x72080
+# Primary A control 0x70180
+# Primary B control 0x71180
+# Primary C control 0x72180
+../tools/intel_reg_read 0x70180
+../tools/intel_reg_read 0x71180
+../tools/intel_reg_read 0x72180
+# Sprite A control 0x70280
+# Sprite B control 0x71280
+# Sprite C control 0x72280
+../tools/intel_reg_read 0x70280
+../tools/intel_reg_read 0x71280
+../tools/intel_reg_read 0x72280
+# Sprite A size 0x70290
+# Sprite B size 0x71290
+# Sprite C size 0x72290
+../tools/intel_reg_read 0x70290
+../tools/intel_reg_read 0x71290
+../tools/intel_reg_read 0x72290
+# Sprite A scaling 0x70304
+# Sprite B scaling 0x71304
+# Sprite C scaling 0x72304
+../tools/intel_reg_read 0x70304
+../tools/intel_reg_read 0x71304
+../tools/intel_reg_read 0x72304
+# PCH DE Interrupt enable 0xC400C
+../tools/intel_reg_read 0xC400C
+# PCH DE Interrupt IIR 0xC4008
+../tools/intel_reg_read 0xC4008
+# PCH DE hotplug 0xC4030
+../tools/intel_reg_read 0xC4030
+# SERR_INT 0xC4040
+../tools/intel_reg_read 0xC4040
+# PCH DPLL A CTL 0xC6014
+# PCH DPLL A Divisor 0 0xC6040
+# PCH DPLL A Divisor 1 0xC6044
+../tools/intel_reg_read 0xC6014
+../tools/intel_reg_read 0xC6040
+../tools/intel_reg_read 0xC6044
+# PCH DPLL B CTL 0xC6018
+# PCH DPLL B Divisor 0 0xC6048
+# PCH DPLL B Divisor 1 0xC604C
+../tools/intel_reg_read 0xC6018
+../tools/intel_reg_read 0xC6048
+../tools/intel_reg_read 0xC604C
+# PCH DPLL DREF CTL 0xC6200
+../tools/intel_reg_read 0xC6200
+# PCH DPLL SEL 0xC7000
+../tools/intel_reg_read 0xC7000
+# PCH Panel Status 0xC7200
+../tools/intel_reg_read 0xC7200
+# PCH Panel Control 0xC7204
+../tools/intel_reg_read 0xC7204
+# Transcoder A timing 0xE0000-0xE004F
+# Transcoder B timing 0xE1000-0xE104F
+# Transcoder C timing 0xE2000-0xE204F
+../tools/intel_reg_read 0xE0000 -c 0x14;
+../tools/intel_reg_read 0xE1000 -c 0x14;
+../tools/intel_reg_read 0xE2000 -c 0x14;
+# Transcoder A DP CTL 0xE0300
+# Transcoder B DP CTL 0xE1300
+# Transcoder C DP CTL 0xE2300
+../tools/intel_reg_read 0xE0300
+../tools/intel_reg_read 0xE1300
+../tools/intel_reg_read 0xE2300
+# CRT DAC CTL 0xE1100
+../tools/intel_reg_read 0xE1100
+# HDMI/DVI B CTL 0xE1140
+# HDMI/DVI C CTL 0xE1150
+# HDMI/DVI D CTL 0xE1160
+../tools/intel_reg_read 0xE1140
+../tools/intel_reg_read 0xE1150
+../tools/intel_reg_read 0xE1160
+# LVDS 0xE1180
+../tools/intel_reg_read 0xE1180
+# DP B CTL 0xE4100
+# DP C CTL 0xE4200
+# DP D CTL 0xE4300
+../tools/intel_reg_read 0xE4100
+../tools/intel_reg_read 0xE4200
+../tools/intel_reg_read 0xE4300
+# Transcoder A config 0xF0008
+# FDI RX A CTL 0xF000C
+# FDI RX A MISC 0xF0010
+# FDI RX A IIR 0xF0014
+# FDI RX A IMR 0xF0018
+../tools/intel_reg_read 0xF0008 -c 5;
+# Transcoder B config 0xF1008
+# FDI RX B CTL 0xF100C
+# FDI RX B MISC 0xF1010
+# FDI RX B IIR 0xF1014
+# FDI RX B IMR 0xF1018
+../tools/intel_reg_read 0xF1008 -c 5;
+# Transcoder C config 0xF2008
+# FDI RX C CTL 0xF200C
+# FDI RX C MISC 0xF2010
+# FDI RX C IIR 0xF2014
+# FDI RX C IMR 0xF2018
+../tools/intel_reg_read 0xF2008 -c 5;
+#Check if frame and line counters are running
+../tools/intel_reg_read 0x44070
+../tools/intel_reg_read 0x70050
+../tools/intel_reg_read 0x71050
+../tools/intel_reg_read 0x72050
+sleep 2;
+../tools/intel_reg_read 0x44070
+../tools/intel_reg_read 0x70050
+../tools/intel_reg_read 0x71050
+../tools/intel_reg_read 0x72050

commit ea944a9faf137e95b146ce8a1fb15d7e4cb8ae41
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Aug 23 11:32:57 2012 -0700

    intel_reg_read: use strtol instead of atoi
    
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

diff --git a/tools/intel_reg_read.c b/tools/intel_reg_read.c
index ee6f126..ae631be 100644
--- a/tools/intel_reg_read.c
+++ b/tools/intel_reg_read.c
@@ -87,7 +87,7 @@ int main(int argc, char** argv)
 			ret = 1;
 			goto out;
 		case 'c':
-			dwords = atoi(optarg);
+			dwords = strtol(optarg, NULL, 0);
 			break;
 		}
 	}

commit baf026d692c25969c3a30fcd50394c83f3f20815
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Aug 23 11:29:43 2012 -0700

    intel_reg_read: support -c option to read multiple dwords
    
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

diff --git a/tools/intel_reg_read.c b/tools/intel_reg_read.c
index 6187a4b..ee6f126 100644
--- a/tools/intel_reg_read.c
+++ b/tools/intel_reg_read.c
@@ -60,6 +60,7 @@ static void usage(char *cmdname)
 	printf("\t -f : read back full range of registers.\n");
 	printf("\t      WARNING! This option may result in a machine hang!\n");
 	printf("\t -d : decode register bits.\n");
+	printf("\t -c : number of dwords to dump (can't be used with -f/-d).\n");
 	printf("\t addr : in 0xXXXX format\n");
 }
 
@@ -71,8 +72,9 @@ int main(int argc, char** argv)
 	char *cmdname = strdup(argv[0]);
 	int full_dump = 0;
 	int decode_bits = 0;
+	int dwords = 1;
 
-	while ((ch = getopt(argc, argv, "dfh")) != -1) {
+	while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
 		switch(ch) {
 		case 'd':
 			decode_bits = 1;
@@ -84,6 +86,9 @@ int main(int argc, char** argv)
 			usage(cmdname);
 			ret = 1;
 			goto out;
+		case 'c':
+			dwords = atoi(optarg);
+			break;
 		}
 	}
 	argc -= optind;
@@ -95,6 +100,12 @@ int main(int argc, char** argv)
 		goto out;
 	}
 
+	if ((dwords > 1) && (argc != 1 || full_dump || decode_bits)) {
+		usage(cmdname);
+		ret = 1;
+		goto out;
+	}
+
 	intel_register_access_init(intel_get_pci_device(), 0);
 
 	if (full_dump) {
@@ -115,7 +126,7 @@ int main(int argc, char** argv)
 	} else {
 		for (i=0; i < argc; i++) {
 			sscanf(argv[i], "0x%x", &reg);
-			dump_range(reg, reg + 4);
+			dump_range(reg, reg + (dwords * 4));
 
 			if (decode_bits)
 				bit_decode(*(volatile uint32_t *)((volatile char*)mmio + reg));

commit 4fc76adf313f2792b7438f9372321ce3ea66c6c2
Author: Vijay Purushothaman <vijay.a.purushothaman@intel.com>
Date:   Fri Aug 17 18:06:52 2012 +0530

    tools: Added intel_dpio_read and intel_dpio_write
    
    In Valleyview the DPLL and lane control registers are accessible only
    through side band fabric called DPIO. Added two tools to read and write
    registers residing in this space.
    
    v2: Moved the core read/write functions to lib/intel_dpio.c based on
    Ben's feedback
    
    Signed-off-by: Vijay Purushothaman <vijay.a.purushothaman@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 88290cb..d8f081f 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -29,6 +29,7 @@ libintel_tools_la_SOURCES = 	\
 	rendercopy_gen7.c	\
 	rendercopy.h		\
 	intel_reg_map.c		\
+	intel_dpio.c		\
 	$(NULL)
 
 LDADD = $(CAIRO_LIBS)
diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index a229ea1..9dd4c94 100755
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -196,6 +196,8 @@


Reply to: