From c2d6773b253b7ab15fe8818730aef2f9f7e4a23d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 14 Aug 2013 12:07:44 +0200 Subject: [PATCH] tests/gem_write_read_ring_switch: use igt_exit and friends And consolidate the gem_require_ring check a bit. Signed-off-by: Daniel Vetter --- tests/gem_write_read_ring_switch.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c index 9da393d2..21eef64a 100644 --- a/tests/gem_write_read_ring_switch.c +++ b/tests/gem_write_read_ring_switch.c @@ -42,7 +42,6 @@ #include "i830_reg.h" #define LOCAL_I915_EXEC_VEBOX (4<<0) -bool skipped_all = true; static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; @@ -62,7 +61,10 @@ static void run_test(int ring, const char *testname) uint32_t *ptr; int i; - skipped_all = false; + gem_require_ring(fd, ring); + /* Testing render only makes sense with separate blt. */ + if (ring == I915_EXEC_RENDER) + gem_require_ring(fd, I915_EXEC_BLT); printf("running subtest %s\n", testname); @@ -191,26 +193,16 @@ int main(int argc, char **argv) } for (i = 0; i < ARRAY_SIZE(tests); i++) { - igt_subtest(tests[i].name) { - gem_require_ring(fd, tests[i].ring); - /* Testing render only makes sense with separate blt. */ - if (tests[i].ring == I915_EXEC_RENDER) - gem_require_ring(fd, I915_EXEC_BLT); + igt_subtest(tests[i].name) run_test(tests[i].ring, tests[i].name); - } } igt_fork_signal_helper(); for (i = 0; i < ARRAY_SIZE(tests); i++) { char name[180]; snprintf(name, sizeof(name), "%s-interruptible", tests[i].name); - igt_subtest(name) { - gem_require_ring(fd, tests[i].ring); - /* Testing render only makes sense with separate blt. */ - if (tests[i].ring == I915_EXEC_RENDER) - gem_require_ring(fd, I915_EXEC_BLT); + igt_subtest(name) run_test(tests[i].ring, name); - } } igt_stop_signal_helper(); @@ -218,5 +210,5 @@ int main(int argc, char **argv) close(fd); - return skipped_all ? 77 : 0; + igt_exit(); }