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

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



 Android.mk                                              |    2 
 NEWS                                                    |   90 +
 assembler/Makefile.am                                   |  108 +
 assembler/gram.y                                        |   74 -
 assembler/test/Makefile.am                              |   93 -
 assembler/test/run-test.sh                              |    2 
 benchmarks/.gitignore                                   |    1 
 benchmarks/Android.mk                                   |    6 
 benchmarks/Makefile.am                                  |    7 
 benchmarks/Makefile.sources                             |   17 
 benchmarks/ezbench.d/gem_busy.test                      |   45 
 benchmarks/ezbench.d/gem_exec_nop.test                  |   23 
 benchmarks/ezbench.d/vgem_mmap.test                     |   10 
 benchmarks/gem_busy.c                                   |  334 +++++
 benchmarks/gem_exec_nop.c                               |   80 +
 benchmarks/vgem_mmap.c                                  |  143 ++
 configure.ac                                            |   50 
 debugger/eudb.c                                         |   14 
 demos/Android.mk                                        |    5 
 demos/Makefile.am                                       |   10 
 demos/Makefile.sources                                  |    7 
 demos/intel_sprite_on.c                                 |   11 
 docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml |    3 
 lib/Android.mk                                          |    2 
 lib/Makefile.am                                         |   10 
 lib/Makefile.sources                                    |   15 
 lib/drmtest.c                                           |   65 -
 lib/drmtest.h                                           |    8 
 lib/i915_pciids.h                                       |  132 ++
 lib/igt_aux.c                                           |  207 +--
 lib/igt_aux.h                                           |   27 
 lib/igt_core.c                                          |  185 +++
 lib/igt_core.h                                          |   22 
 lib/igt_debugfs.c                                       |   70 -
 lib/igt_debugfs.h                                       |    8 
 lib/igt_fb.c                                            |    6 
 lib/igt_fb.h                                            |   41 
 lib/igt_gt.c                                            |   30 
 lib/igt_gvt.c                                           |  117 ++
 lib/igt_gvt.h                                           |   33 
 lib/igt_kms.c                                           |  895 +++++++++------
 lib/igt_kms.h                                           |  136 ++
 lib/igt_pm.c                                            |  129 ++
 lib/igt_pm.h                                            |   22 
 lib/igt_rand.c                                          |   19 
 lib/igt_rand.h                                          |   39 
 lib/igt_stats.c                                         |   54 
 lib/igt_stats.h                                         |   44 
 lib/igt_sysfs.c                                         |  379 ++++++
 lib/igt_sysfs.h                                         |   46 
 lib/igt_vc4.c                                           |    1 
 lib/igt_vgem.c                                          |  192 +++
 lib/igt_vgem.h                                          |   50 
 lib/igt_x86.c                                           |  169 ++
 lib/igt_x86.h                                           |   46 
 lib/intel_chipset.c                                     |   31 
 lib/intel_chipset.h                                     |  513 +-------
 lib/intel_device_info.c                                 |  311 +++++
 lib/intel_os.c                                          |   16 
 lib/intel_reg.h                                         |    2 
 lib/ioctl_wrappers.c                                    |   55 
 lib/ioctl_wrappers.h                                    |    5 
 lib/stubs/drm/README                                    |    4 
 lib/stubs/drm/intel_bufmgr.c                            |  269 ++++
 lib/stubs/drm/intel_bufmgr.h                            |  321 +++++
 lib/tests/Android.mk                                    |    2 
 lib/tests/Makefile.am                                   |    5 
 lib/tests/Makefile.sources                              |   10 
 lib/tests/igt_command_line.sh                           |   76 -
 overlay/Makefile.am                                     |    1 
 overlay/i915_pciids.h                                   |  294 -----
 overlay/igfx.c                                          |    2 
 overlay/overlay.c                                       |    2 
 tests/Makefile.am                                       |   12 
 tests/Makefile.sources                                  |   21 
 tests/core_prop_blob.c                                  |   52 
 tests/drm_getopt.sh                                     |   38 
 tests/drm_lib.sh                                        |   35 
 tests/drv_missed_irq.c                                  |  191 +++
 tests/drv_missed_irq_hang                               |   80 -
 tests/gem_busy.c                                        |  146 ++
 tests/gem_close_race.c                                  |   14 
 tests/gem_concurrent_all.c                              |  318 +++--
 tests/gem_ctx_bad_exec.c                                |   89 -
 tests/gem_ctx_create.c                                  |   46 
 tests/gem_ctx_switch.c                                  |    7 
 tests/gem_ctx_thrash.c                                  |   34 
 tests/gem_evict_everything.c                            |    4 
 tests/gem_exec_basic.c                                  |   11 
 tests/gem_exec_big.c                                    |   26 
 tests/gem_exec_create.c                                 |   12 
 tests/gem_exec_flush.c                                  |   86 +
 tests/gem_exec_gttfill.c                                |   98 +
 tests/gem_exec_nop.c                                    |   39 
 tests/gem_exec_parallel.c                               |   13 
 tests/gem_exec_store.c                                  |   15 
 tests/gem_exec_suspend.c                                |   11 
 tests/gem_exec_whisper.c                                |   93 +
 tests/gem_fd_exhaustion.c                               |   28 
 tests/gem_gtt_speed.c                                   |  122 +-
 tests/gem_largeobject.c                                 |    7 
 tests/gem_madvise.c                                     |   21 
 tests/gem_mmap_gtt.c                                    |   73 +
 tests/gem_mocs_settings.c                               |  119 --
 tests/gem_ppgtt.c                                       |   48 
 tests/gem_pread.c                                       |    3 
 tests/gem_pwrite.c                                      |    2 
 tests/gem_read_read_speed.c                             |   39 
 tests/gem_reset_stats.c                                 |    8 
 tests/gem_shrink.c                                      |   34 
 tests/gem_stolen.c                                      |   97 +
 tests/gem_sync.c                                        |  546 +++++++++
 tests/gem_workarounds.c                                 |   16 
 tests/gen3_mixed_blits.c                                |    2 
 tests/gvt_basic.c                                       |   44 
 tests/igt_command_line.sh                               |   90 +
 tests/kms_addfb_basic.c                                 |   66 +
 tests/kms_atomic_transition.c                           |  610 ++++++++++
 tests/kms_busy.c                                        |  272 ++++
 tests/kms_chv_cursor_fail.c                             |   21 
 tests/kms_crtc_background_color.c                       |    3 
 tests/kms_cursor_legacy.c                               |  935 +++++++++++++++-
 tests/kms_fbc_crc.c                                     |    2 
 tests/kms_flip.c                                        |   67 -
 tests/kms_flip_tiling.c                                 |   50 
 tests/kms_frontbuffer_tracking.c                        |   58 
 tests/kms_invalid_dotclock.c                            |  148 ++
 tests/kms_panel_fitting.c                               |   95 +
 tests/kms_pipe_color.c                                  |    2 
 tests/kms_plane.c                                       |    8 
 tests/kms_plane_scaling.c                               |    7 
 tests/kms_properties.c                                  |  313 +++++
 tests/kms_psr_sink_crc.c                                |    8 
 tests/kms_rmfb.c                                        |  171 ++
 tests/kms_sink_crc_basic.c                              |    8 
 tests/kms_vblank.c                                      |  161 ++
 tests/pm_rpm.c                                          |    4 
 tests/pm_rps.c                                          |  246 ++--
 tests/prime_busy.c                                      |  262 ++++
 tests/prime_vgem.c                                      |  844 ++++++++++++++
 tests/testdisplay.c                                     |    4 
 tests/vc4_lookup_fail.c                                 |   81 +
 tests/vgem_basic.c                                      |  345 +++++
 tests/vgem_reload_basic                                 |   27 
 tests/vgem_slow.c                                       |   90 +
 tools/Android.mk                                        |    6 
 tools/Makefile.am                                       |    7 
 tools/Makefile.sources                                  |   73 -
 tools/aubdump.c                                         |   11 
 tools/intel_audio_dump.c                                |   16 
 tools/intel_bios.h                                      |   94 +
 tools/intel_bios_reader.c                               |  212 +++
 tools/intel_error_decode.c                              |   11 
 tools/intel_l3_parity.c                                 |   15 
 tools/intel_reg.c                                       |   21 
 tools/intel_reg_checker.c                               |   19 
 tools/intel_reg_decode.c                                |  257 ++--
 tools/intel_watermark.c                                 |    8 
 158 files changed, 11904 insertions(+), 2797 deletions(-)

New commits:
commit a28e9e38a9efc6daf5a08d60d29adcd3e328fe6f
Author: Marius Vlad <marius.c.vlad@intel.com>
Date:   Fri Sep 2 17:27:08 2016 +0300

    Updated NEWS, and bumped version to 1.16.
    
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>

diff --git a/NEWS b/NEWS
index fba7ac4..6bb8056 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,93 @@
+Release 1.16 (2016-09-02)
+-------------------------
+
+- Build automatically tests required when issueing a make check, Tests/subtests
+that receive a crash signal should print a backtrace when i-g-t is built with
+libunwind support (Marius Vlad)
+
+- lib/igt_kms: Force connector probing on first use (Chris Wilson)
+
+- vc4: Add a test for BO lookup failure error path (Eric Anholt)
+
+- tests/gem_mocs_settings: Remove direct register tests,
+and added RC6 tests (Peter Antoine)
+
+- Check for libdrm_intel and build if present, Add stubs for intel_bufmgr
+(Robert Foss)
+
+- igt/gem_mmap_gtt: Add a test to detect non-WC access (Chris Wilson)
+
+- Various documentation improvements (Daniel Vetter)
+
+- Added new tests: tests/kms_rmfb and tests/kms_atomic_transition, a test for
+fastboot, tests/kms_panel_fitting, and a test that only tries to set the
+current property values back, tests/kms_properties. Various improvements to
+tests/kms_cursor_legacy (Maarten Lankhorst)
+
+- lib/igt_kms: Use pipes for committing, not outputs and assign pipe properties
+in pipe init and many other improvements (Maarten Lankhorst)
+
+- tests/gem_workarounds: read test added as a basic test, fix assertion of num
+of regs (Mika Kuoppala)
+
+- Various improvements to tools/intel_bios_reader and tools/intel_reg (Ville
+Syrjälä)
+
+- lib: Add x86 cpuid based feature detection (Chris Wilson)
+
+- demos/intel_sprite_on: Instead of looping until the first disconnected port
+is found, now go through all possible connectors, drawing the sprite on any
+connected display. (Jim Bride)
+
+- Multiple improvements to lib/igt_kms (Robert Foss)
+
+- lib/igt_aux: Framework for measuring latency in raising signals (Chris
+Wilson)
+
+- Various modifications to intel_chipset: Replace lookup of GT size with
+computation, remove unused PCI_CHIP ids, converting platforms names using
+device info (Chris Wilson)
+
+- tests/kms_chv_cursor_fail: Run the tests with fewer steps
+(Maarten Lankhorst)
+
+- lib/intel_chipset: Add more Kabylake PCI IDs and removed PCI IDs that are no
+longer listed as Kabylake (Rodrigo Vivi)
+
+- Basic framework for GVT-g testing has landed (Chris Wilson)
+
+- Various improvements to tests/kms_flip (Ville Syrjälä)
+
+- igt/kms_cursor_legacy: Add a rudimentary test to detect stalled cursors,
+detect pageflip errors and check that cursor updates do not stall flips
+(Chris Wilson)
+
+- vGEM support: lib and added tests/vgem_basic, tests/vgem_slow and
+tests/vgem_reload_basic (Chris Wilson)
+
+- Various fixes to tests/kms_frontbuffer_tracking: prefer BLT drawing, recreate
+FBS at every subtest and properly handle mixing GTT and WC mmaps (Paulo Zanoni)
+
+- Replace drv_missed_irq_hang script with a C-equivalent: tests/drv_missed_irq
+(Chris Wilson)
+
+- Added a test case for polling dma-buf fences: tests/prime_busy (Chris Wilson)
+
+- lib/igt_gt: Omit illegal instruction on gen8+ and time
+constrains on hang detection (igt/gem_reset_stats) (Mika Kuoppala)
+
+- Added tests/kms_invalid_dotclock, a test that makes sure every modeset gets
+rejected by the kernel if the requested dotclock is beyond the hardware
+capabilities (Ville Syrjälä)
+
+- tests/gem_stolen: Verify contents of stolen-backed objects across
+hibernation, fix for no_mmap subtest and check for available stolen memory size
+(Ankitprasad Sharma)
+
+- tests/core_prop_blob: Add invalid tests to set fb props (Daniel Vetter)
+
+- Many more fixes and improvements.
+
 Release 1.15 (2016-05-31)
 -------------------------
 
diff --git a/configure.ac b/configure.ac
index bfe2e33..1f3d0de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([intel-gpu-tools],
-	[1.15],
+	[1.16],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT],
 	[intel-gpu-tools])
 

commit 8da2b548bd7b18a2e11ed6d722f01c4c8887dfe9
Author: Marius Vlad <marius.c.vlad@intel.com>
Date:   Fri Sep 2 14:34:46 2016 +0300

    lib/igt_core: Wrap print_backtrace_sig_safe() with HAVE_LIBUNWIND.
    
    Reported-by: Petri Latvala <petri.latvala@intel.com>
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 7e5bf76..dd27a22 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1746,7 +1746,9 @@ static void fatal_sig_handler(int sig)
 				igt_exitcode = 128 + sig;
 
 			failed_one = true;
+#ifdef HAVE_LIBUNWIND
 			print_backtrace_sig_safe();
+#endif
 			exit_subtest("CRASH");
 		}
 		break;

commit c1d427b0d764c919a34fe0b2249d941649e31216
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 1 21:26:29 2016 +0100

    igt/pm_rps: Remove reliance on guessing the busy workload
    
    Create an unbounded batch in order to ensure that the workload doesn't
    disappear before the wait and so we should be given the RPS waitboost.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=97564
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index ea08586..5a54d9d 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -560,14 +560,67 @@ static void reset_gpu(void)
 	close(fd);
 }
 
-static void waitboost(bool reset)
+static uint32_t *make_busy(int fd, uint32_t handle)
 {
-	const uint32_t bbe = MI_BATCH_BUFFER_END;
-	struct drm_i915_gem_exec_object2 object;
+	const int gen = intel_gen(intel_get_drm_devid(fd));
+	struct drm_i915_gem_exec_object2 obj;
+	struct drm_i915_gem_relocation_entry reloc;
 	struct drm_i915_gem_execbuffer2 execbuf;
+	uint32_t *batch;
+	int i;
+
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = (uintptr_t)&obj;
+	execbuf.buffer_count = 1;
+
+	memset(&obj, 0, sizeof(obj));
+	obj.handle = handle;
+
+	obj.relocs_ptr = (uintptr_t)&reloc;
+	obj.relocation_count = 1;
+	memset(&reloc, 0, sizeof(reloc));
+
+	batch = gem_mmap__wc(fd, obj.handle, 0, 4096, PROT_WRITE);
+	gem_set_domain(fd, obj.handle,
+			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+
+	reloc.target_handle = obj.handle; /* recurse */
+	reloc.presumed_offset = 0;
+	reloc.offset = sizeof(uint32_t);
+	reloc.delta = 0;
+	reloc.read_domains = I915_GEM_DOMAIN_COMMAND;
+	reloc.write_domain = 0;
+
+	i = 0;
+	batch[i] = MI_BATCH_BUFFER_START;
+	if (gen >= 8) {
+		batch[i] |= 1 << 8 | 1;
+		batch[++i] = 0;
+		batch[++i] = 0;
+	} else if (gen >= 6) {
+		batch[i] |= 1 << 8;
+		batch[++i] = 0;
+	} else {
+		batch[i] |= 2 << 6;
+		batch[++i] = 0;
+		if (gen < 4) {
+			batch[i] |= 1;
+			reloc.delta = 1;
+		}
+	}
+	i++;
+
+	gem_execbuf(fd, &execbuf);
+	return batch;
+}
+
+static void waitboost(bool reset)
+{
 	int pre_freqs[NUMFREQ];
 	int boost_freqs[NUMFREQ];
 	int post_freqs[NUMFREQ];
+	uint32_t *batch, handle;
+	int64_t timeout = 1;
 
 	int fd = drm_open_driver(DRIVER_INTEL);
 
@@ -588,20 +641,14 @@ static void waitboost(bool reset)
 	}
 
 	igt_debug("Wait for gpu...\n");
-	memset(&object, 0, sizeof(object));
-	object.handle = gem_create(fd, 4096);
-	gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
-	memset(&execbuf, 0, sizeof(execbuf));
-	execbuf.buffers_ptr = (uintptr_t)&object;
-	execbuf.buffer_count = 1;
-	do {
-		for (int i = 0; i < 64; i++)
-			gem_execbuf(fd, &execbuf);
-	} while (!gem_bo_busy(fd, object.handle));
-	gem_sync(fd, object.handle);
+	handle = gem_create(fd, 4096);
+	batch = make_busy(fd, handle);
+	gem_wait(fd, handle, &timeout);
 	read_freqs(boost_freqs);
 	dump(boost_freqs);
-	gem_close(fd, object.handle);
+	*batch = MI_BATCH_BUFFER_END;
+	munmap(batch, 4096);
+	gem_close(fd, handle);
 
 	igt_debug("Apply low load again...\n");
 	sleep(1);

commit 768f6cc854f5d04a067c8c64297563655b8e54f9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 1 20:41:11 2016 +0100

    igt/gem_ctx_bad_exec: Begone invalid negative test
    
    Stop looking for an error for a valid combination.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97562
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c
index 5b3577f..a86c54f 100644
--- a/tests/gem_ctx_bad_exec.c
+++ b/tests/gem_ctx_bad_exec.c
@@ -20,96 +20,41 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  *
- * Authors:
- *    Ben Widawsky <ben@bwidawsk.net>
- *
- */
-
-/*
- * Negative test cases:
- *  test we can't submit contexts to unsupported rings
  */
 
 #include "igt.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include "drm.h"
 
-IGT_TEST_DESCRIPTION("Test that context cannot be submitted to unsupported"
-		     " rings.");
+IGT_TEST_DESCRIPTION("Test that context cannot be submitted to any ring");
 
-/* Copied from gem_exec_nop.c */
-static int exec(int fd, uint32_t handle, int ring, int ctx_id)
+static int exec(int fd, unsigned ring)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
-	struct drm_i915_gem_exec_object2 gem_exec;
-	int ret = 0;
+	struct drm_i915_gem_exec_object2 obj;
 
-	gem_exec.handle = handle;
-	gem_exec.relocation_count = 0;
-	gem_exec.relocs_ptr = 0;
-	gem_exec.alignment = 0;
-	gem_exec.offset = 0;
-	gem_exec.flags = 0;
-	gem_exec.rsvd1 = 0;
-	gem_exec.rsvd2 = 0;
+	memset(&obj, 0, sizeof(obj));
+	memset(&execbuf, 0, sizeof(execbuf));
 
-	execbuf.buffers_ptr = (uintptr_t)&gem_exec;
+	execbuf.buffers_ptr = (uintptr_t)&obj;
 	execbuf.buffer_count = 1;
-	execbuf.batch_start_offset = 0;
-	execbuf.batch_len = 8;
-	execbuf.cliprects_ptr = 0;
-	execbuf.num_cliprects = 0;
-	execbuf.DR1 = 0;
-	execbuf.DR4 = 0;
-	execbuf.flags = ring;
-	i915_execbuffer2_set_context_id(execbuf, ctx_id);
-	execbuf.rsvd2 = 0;
-
-	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2,
-			&execbuf);
-	gem_sync(fd, handle);
+	i915_execbuffer2_set_context_id(execbuf, 1);
 
-	return ret;
+	return __gem_execbuf(fd, &execbuf);
 }
 
-uint32_t handle;
-uint32_t batch[2] = {MI_BATCH_BUFFER_END};
-uint32_t ctx_id;
-int fd;
-
 igt_main
 {
+	const struct intel_execution_engine *e;
+	int fd = -1;
+
 	igt_skip_on_simulation();
 
-	igt_fixture {
+	igt_fixture
 		fd = drm_open_driver_render(DRIVER_INTEL);
 
-		ctx_id = gem_context_create(fd);
-
-		handle = gem_create(fd, 4096);
-		gem_write(fd, handle, 0, batch, sizeof(batch));
+	for (e = intel_execution_engines; e->name; e++) {
+		igt_subtest_f("%s", e->name) {
+			gem_require_ring(fd, e->exec_id | e->flags);
+			igt_assert_eq(exec(fd, e->exec_id | e->flags), -ENOENT);
+		}
 	}
-
-	igt_subtest("render")
-		igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0);
-	igt_subtest("bsd")
-		igt_assert(exec(fd, handle, I915_EXEC_BSD, ctx_id) != 0);
-	igt_subtest("blt")
-		igt_assert(exec(fd, handle, I915_EXEC_BLT, ctx_id) != 0);
-#ifdef I915_EXEC_VEBOX
-	igt_fixture
-		igt_require(gem_has_vebox(fd));
-	igt_subtest("vebox")
-		igt_assert(exec(fd, handle, I915_EXEC_VEBOX, ctx_id) != 0);
-#endif
 }

commit 652ad3e549810f32b39f24b13023a050667e738a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 1 13:57:31 2016 +0100

    igt/prime_vgem: Simplify inter-process flip checks
    
    Avoid having both the child and parent do the same "did the flip"
    happen check with each looking for the same event on the same fd. The
    problem being that the child may fall asleep and by the time it wakes up
    to do its check, the parent has already eaten the event. So leave the
    checking that the flip does occur to the parent.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 8985e01..e78e074 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -628,6 +628,7 @@ static void flip_to_vgem(int i915, int vgem,
 			 unsigned hang,
 			 const char *name)
 {
+	const struct timespec tv = { 1, 0 };
 	struct pollfd pfd;
 	struct drm_event_vblank vbl;
 	uint32_t fence;
@@ -648,16 +649,14 @@ static void flip_to_vgem(int i915, int vgem,
 				      name);
 			get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS);
 		}
-		igt_assert_eq(poll(&pfd, 1, 20000), 1);
 	}
 
+	igt_assert_f(nanosleep(&tv, NULL) == -1,
+		     "flip to busy %s blocked\n", name);
+
 	/* And then the flip is completed as soon as it is ready */
 	if (!hang) {
 		union drm_wait_vblank wait;
-		struct timespec tv = { 1, 0 };
-
-		igt_assert_f(nanosleep(&tv, NULL) == -1,
-			     "flip to busy %s blocked\n", name);
 
 		memset(&wait, 0, sizeof(wait));
 		wait.request.type = DRM_VBLANK_RELATIVE | pipe_select(0);

commit 225a88bb6bc1fa826b880ddc8ab257e3a76a82e9
Author: marius vlad <marius.c.vlad@intel.com>
Date:   Wed Aug 24 11:42:17 2016 +0300

    tests/Makefile.am: Add -Wno-unused-result to tests
    
    Removes useless warnings if a caller of a function
    does not use its returned value(s). Mostly aesthetic.
    
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
    CC: Chris Wilson <chris@chris-wilson.co.uk>
    CC: Daniel Vetter <daniel@ffwll.ch>

diff --git a/tests/Makefile.am b/tests/Makefile.am
index d0e758f..a408126 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -54,7 +54,7 @@ EXTRA_DIST = $(common_files) $(check_SCRIPTS)
 
 CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore
 
-AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
+AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) -Wno-unused-result $(DEBUG_CFLAGS)\
 	-I$(srcdir)/.. \
 	-I$(srcdir)/../lib \
 	-include "$(srcdir)/../lib/check-ndebug.h" \

commit 1ae41a505ff8dc62e03a7638daad2f5cca5dd104
Author: marius vlad <marius.c.vlad@intel.com>
Date:   Wed Aug 24 11:44:07 2016 +0300

    lib/igt_core: Print stacktrace when receiving one of the crash signals.
    
    While at it add SIGFPE as a crash signal.
    
    v3: Remove calls to igt_assert_eq() as these are not async-safe. As one
    user of this method remove the function pointer and recursive call.
    (Chris Wilson)
    v2: Added some helpers to avoid printf() inside a signal handler.
    (Chris Wilson)
    
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 801f02f..7e5bf76 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1098,6 +1098,179 @@ static void print_backtrace(void)
 		       (unsigned int) off);
 	}
 }
+
+static const char hex[] = "0123456789abcdef";
+
+static void
+xputch(int c)
+{
+	write(STDERR_FILENO, (const void *) &c, 1);
+}
+
+static int
+xpow(int base, int pow)
+{
+	int i, r = 1;
+
+	for (i = 0; i < pow; i++)
+		r *= base;
+
+	return r;
+}
+
+static void
+printnum(unsigned long long num, unsigned base)
+{
+	int i = 0;
+	unsigned long long __num;
+
+	/* determine from where we should start dividing */
+	do {
+		__num /= base;
+		i++;
+	} while (__num);
+
+	while (i--)
+		xputch(hex[num / xpow(base, i) % base]);
+}
+
+static size_t
+xstrlcpy(char *dst, const char *src, size_t size)
+{
+	char *dst_in;
+
+	dst_in = dst;
+	if (size > 0) {
+		while (--size > 0 && *src != '\0')
+			*dst++ = *src++;
+		*dst = '\0';
+	}
+
+	return dst - dst_in;
+}
+
+static void
+xprintfmt(const char *fmt, va_list ap)
+{
+	const char *p;
+	int ch, base;
+	unsigned long long num;
+
+	while (1) {
+		while ((ch = *(unsigned char *) fmt++) != '%') {
+			if (ch == '\0') {
+				return;
+			}
+			xputch(ch);
+		}
+
+		ch = *(unsigned char *) fmt++;
+		switch (ch) {
+		/* character */
+		case 'c':
+			xputch(va_arg(ap, int));
+			break;
+		/* string */
+		case 's':
+			if ((p = va_arg(ap, char *)) == NULL) {
+				p = "(null)";
+			}
+
+			for (; (ch = *p++) != '\0';) {
+				if (ch < ' ' || ch > '~') {
+					xputch('?');
+				} else {
+					xputch(ch);
+				}
+			}
+			break;
+		/* (signed) decimal */
+		case 'd':
+			num = va_arg(ap, int);
+			if ((long long) num < 0) {
+				xputch('-');
+				num = -(long long) num;
+			}
+			base = 10;
+			goto number;
+		/* unsigned decimal */
+		case 'u':
+			num = va_arg(ap, unsigned int);
+			base = 10;
+			goto number;
+		/* (unsigned) hexadecimal */
+		case 'x':
+			num = va_arg(ap, unsigned int);
+			base = 16;
+number:
+			printnum(num, base);
+			break;
+
+		/* The following are not implemented */
+
+		/* width field */
+		case '1': case '2':
+		case '3': case '4':
+		case '5': case '6':
+		case '7': case '8':
+		case '9':
+		case '.': case '#':
+		/* long */
+		case 'l':
+		/* octal */
+		case 'o':
+		/* pointer */
+		case 'p':
+		/* float */
+		case 'f':
+			abort();
+		/* escaped '%' character */
+		case '%':
+			xputch(ch);
+			break;
+		/* unrecognized escape sequence - just print it literally */
+		default:
+			xputch('%');
+			for (fmt--; fmt[-1] != '%'; fmt--)
+				; /* do nothing */
+			break;
+		}
+	}
+}
+
+/* async-safe printf */
+static void
+xprintf(const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+	xprintfmt(fmt, ap);
+	va_end(ap);
+}
+
+static void print_backtrace_sig_safe(void)
+{
+	unw_cursor_t cursor;
+	unw_context_t uc;
+	int stack_num = 0;
+
+	write(STDERR_FILENO, "Stack trace: \n", 15);
+
+	unw_getcontext(&uc);
+	unw_init_local(&cursor, &uc);
+	while (unw_step(&cursor) > 0) {
+		char name[255];
+		unw_word_t off;
+
+		if (unw_get_proc_name(&cursor, name, 255, &off) < 0)
+			xstrlcpy(name, "<unknown>", 9);
+
+		xprintf(" #%d [%s+0x%x]\n", stack_num++, name,
+				(unsigned int) off);
+
+	}
+}
 #endif
 
 void __igt_fail_assert(const char *domain, const char *file, const int line,
@@ -1482,7 +1655,8 @@ static bool exit_handler_disabled;
 #define SILENT(x) { x, NULL, 0 }
 static const struct { int number; const char *name; size_t name_len; } handled_signals[] =
 	{ SILENT(SIGINT), SILENT(SIGHUP), SILENT(SIGTERM), SILENT(SIGQUIT),
-	  SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS) };
+	  SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS),
+	  SIGDEF(SIGFPE) };
 #undef SILENT
 #undef SIGDEF
 
@@ -1542,6 +1716,7 @@ static bool crash_signal(int sig)
 	switch (sig) {
 	case SIGILL:
 	case SIGBUS:
+	case SIGFPE:
 	case SIGSEGV:
 		return true;
 	default:
@@ -1571,7 +1746,7 @@ static void fatal_sig_handler(int sig)
 				igt_exitcode = 128 + sig;
 
 			failed_one = true;
-
+			print_backtrace_sig_safe();
 			exit_subtest("CRASH");
 		}
 		break;

commit c538c2c637b763c63d694f095f01c07ff67aa18c
Author: marius vlad <marius.c.vlad@intel.com>
Date:   Sat Aug 20 18:32:01 2016 +0300

    lib/intel_chipset: Fix compilation when enabling the debugger.
    
    Add IS_SANDYBRIDGE() macro used by debugger/eudb.
    
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
    CC: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index 1003266..3c1260b 100644
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -147,6 +147,7 @@ void intel_check_pch(void);
 
 #define IS_IRONLAKE(devid)	(intel_get_device_info(devid)->is_ironlake)
 #define IS_ARRANDALE(devid)	(intel_get_device_info(devid)->is_arrandale)
+#define IS_SANDYBRIDGE(devid)	(intel_get_device_info(devid)->is_sandybridge)
 #define IS_IVYBRIDGE(devid)	(intel_get_device_info(devid)->is_ivybridge)
 #define IS_VALLEYVIEW(devid)	(intel_get_device_info(devid)->is_valleyview)
 #define IS_HASWELL(devid)	(intel_get_device_info(devid)->is_haswell)

commit 75e7a3a8d255a4b925e24939e771af3e7cdf15dc
Author: Marius Vlad <marius.c.vlad@intel.com>
Date:   Wed Aug 31 19:59:02 2016 +0300

    autotools/: Allow check target to be invoked w/o the need to issue a build.
    
    We need to have the test list generated before running the check target.
    Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to
    building the tests and execute the script.
    
    This would allow cleaning followed by a make check.
    
    Also assembler/ directory needs also to be adjusted in order for this
    to work.
    
    Kept the possibility to invoke tests/igt_command_line.sh to determine
    which test is failing.
    
    Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
    Url: https://patchwork.freedesktop.org/series/6539/
    Reviewed-By: Chris Wilson <chris@chris-wilson.co.uk>

diff --git a/assembler/Makefile.am b/assembler/Makefile.am
index fb309ac..bed6c07 100644
--- a/assembler/Makefile.am
+++ b/assembler/Makefile.am
@@ -47,8 +47,112 @@ intel_gen4disasm_LDADD = libbrw.la
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = intel-gen4asm.pc
 
-CLEANFILES = $(BUILT_SOURCES)
+check_SCRIPTS = test/run-test.sh
+
+TESTS = \
+	test/mov \
+	test/frc \
+	test/rndd \
+	test/rndu \
+	test/rnde \
+	test/rnde-intsrc \
+	test/rndz \
+	test/lzd \
+	test/not \
+	test/immediate \
+	$(NULL)
+
+# Tests that are expected to fail because they contain some inccorect code.
+XFAIL_TESTS =
+
+# Those tests were already failing when the assembler was imported from
+# the intel-gen4asm git repository:
+#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
+# We disable them "for now" as a workaround to be able to release i-g-t
+disabled_tests = \
+	test/declare \
+	test/jmpi \
+	test/if \
+	test/iff \
+	test/while \
+	test/else \
+	test/break \
+	test/cont \
+	test/halt \
+	test/wait \
+	test/endif \
+	$(NULL)
+
+disabled_xfail_tests = \
+	test/rnde-intsrc \
+	$(NULL)
+
+TESTDATA = \
+	test/mov.expected \
+	test/mov.g4a \
+	test/frc.expected \
+	test/frc.g4a \
+	test/rndd.expected \
+	test/rndd.g4a \
+	test/rndu.expected \
+	test/rndu.g4a \
+	test/rnde.expected \
+	test/rnde.g4a \
+	test/rnde-intsrc.expected \
+	test/rnde-intsrc.g4a \
+	test/rndz.expected \
+	test/rndz.g4a \
+	test/lzd.expected \
+	test/lzd.g4a \
+	test/not.expected \
+	test/not.g4a \
+	test/jmpi.expected \
+	test/jmpi.g4a \
+	test/if.expected \
+	test/if.g4a \
+	test/iff.expected \
+	test/iff.g4a \
+	test/while.expected \
+	test/while.g4a \
+	test/else.expected \
+	test/else.g4a \
+	test/break.expected \
+	test/break.g4a \
+	test/cont.expected \
+	test/cont.g4a \
+	test/halt.expected \
+	test/halt.g4a \
+	test/wait.expected \
+	test/wait.g4a \
+	test/endif.expected \
+	test/endif.g4a \
+	test/declare.expected \
+	test/declare.g4a \
+	test/immediate.g4a \
+	test/immediate.expected \
+	$(NULL)
+
+test_EXTRA_DIST = \
+	${TESTDATA} \
+	test/run-test.sh \
+	$(NULL)
+
+$(TESTS): test/run-test.sh
+	sed "s|TEST|$@|g" ${srcdir}/test/run-test.sh > $@


Reply to: