From: Daniel Vetter Date: Wed, 28 Nov 2012 11:09:58 +0000 (+0100) Subject: tests/gem_cs_tlb: convert to subtests X-Git-Tag: intel-gpu-tools-1.4~877 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d65d484f65c841c878fa946e905f9297df62dac;p=platform%2Fupstream%2Fintel-gpu-tools.git tests/gem_cs_tlb: convert to subtests Again required a bit of shuffling to avoid expensive setup and some logic to properly handling 'skip' when only running a subtest. Signed-off-by: Daniel Vetter --- diff --git a/tests/Makefile.am b/tests/Makefile.am index d5dd719..66c0ce5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,6 +16,7 @@ TESTS_progs_M = \ gem_basic \ gem_cacheing \ gem_cpu_concurrent_blit \ + gem_cs_tlb \ flip_test \ $(NULL) @@ -23,7 +24,6 @@ TESTS_progs = \ getversion \ getclient \ getstats \ - gem_cs_tlb \ gem_gtt_concurrent_blit \ gem_exec_nop \ gem_exec_big \ diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c index 0921364..9f49ac9 100644 --- a/tests/gem_cs_tlb.c +++ b/tests/gem_cs_tlb.c @@ -54,6 +54,7 @@ #include "intel_gpu_tools.h" #define BATCH_SIZE (1024*1024) +bool skipped_all = true; static int exec(int fd, uint32_t handle, int split, uint64_t *gtt_ofs, unsigned ring_id) @@ -102,6 +103,7 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name) int i; sprintf(buf, "testing %s cs tlb coherency: ", ring_name); + skipped_all = false; /* Shut up gcc, too stupid. */ batch_ptr_old = NULL; @@ -148,23 +150,30 @@ int main(int argc, char **argv) int fd; uint32_t devid; + drmtest_subtest_init(argc, argv); + fd = drm_open_any(); devid = intel_get_drm_devid(fd); - /* This test is very sensitive to residual gtt_mm noise from previous - * tests. Try to quiet thing down first. */ - gem_quiescent_gpu(fd); - sleep(5); /* needs more serious ducttape */ + if (!drmtest_only_list_subtests()) { + /* This test is very sensitive to residual gtt_mm noise from previous + * tests. Try to quiet thing down first. */ + gem_quiescent_gpu(fd); + sleep(5); /* needs more serious ducttape */ + } - run_on_ring(fd, I915_EXEC_RENDER, "render"); + if (drmtest_run_subtest("render")) + run_on_ring(fd, I915_EXEC_RENDER, "render"); - if (HAS_BSD_RING(devid)) - run_on_ring(fd, I915_EXEC_BSD, "bsd"); + if (drmtest_run_subtest("bsd")) + if (HAS_BSD_RING(devid)) + run_on_ring(fd, I915_EXEC_BSD, "bsd"); - if (HAS_BLT_RING(devid)) - run_on_ring(fd, I915_EXEC_BLT, "blt"); + if (drmtest_run_subtest("blt")) + if (HAS_BLT_RING(devid)) + run_on_ring(fd, I915_EXEC_BLT, "blt"); close(fd); - return 0; + return skipped_all ? 77 : 0; }