diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-28 12:00:33 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-28 12:00:33 +0100 |
commit | 4f6ab180a11128627385db722d06db60fa6023ff (patch) | |
tree | 1768806addf216b020530f6b51d45aaba819109d /tests | |
parent | 792a05a0a1c7b901093c3542ec96b5d7a9a9f253 (diff) |
tests/gem_cpu_concurrent_blt: convert to subtest infrastructure
Small changes to avoid expensive setup just to print out the subtest
list, and setting up the source buffers such that "early-read" works
without having run "overwrite-soure" right beforehand.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/gem_cpu_concurrent_blit.c | 58 |
2 files changed, 36 insertions, 24 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 78953bde..d5dd7194 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,6 +15,7 @@ endif TESTS_progs_M = \ gem_basic \ gem_cacheing \ + gem_cpu_concurrent_blit \ flip_test \ $(NULL) @@ -22,7 +23,6 @@ TESTS_progs = \ getversion \ getclient \ getstats \ - gem_cpu_concurrent_blit \ gem_cs_tlb \ gem_gtt_concurrent_blit \ gem_exec_nop \ diff --git a/tests/gem_cpu_concurrent_blit.c b/tests/gem_cpu_concurrent_blit.c index fd517d00..21cbdb07 100644 --- a/tests/gem_cpu_concurrent_blit.c +++ b/tests/gem_cpu_concurrent_blit.c @@ -93,11 +93,13 @@ main(int argc, char **argv) drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; int num_buffers = 128, max; - drm_intel_bo *src[128], *dst[128], *dummy; + drm_intel_bo *src[128], *dst[128], *dummy = NULL; int width = 512, height = 512; int fd; int i; + drmtest_subtest_init(argc, argv); + fd = drm_open_any(); max = gem_aperture_size (fd) / (1024 * 1024) / 2; @@ -108,35 +110,45 @@ main(int argc, char **argv) drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); - for (i = 0; i < num_buffers; i++) { - src[i] = create_bo(bufmgr, i, width, height); - dst[i] = create_bo(bufmgr, ~i, width, height); + if (!drmtest_only_list_subtests()) { + for (i = 0; i < num_buffers; i++) { + src[i] = create_bo(bufmgr, i, width, height); + dst[i] = create_bo(bufmgr, ~i, width, height); + } + dummy = create_bo(bufmgr, 0, width, height); } - dummy = create_bo(bufmgr, 0, width, height); /* try to overwrite the source values */ - for (i = 0; i < num_buffers; i++) - intel_copy_bo(batch, dst[i], src[i], width, height); - for (i = num_buffers; i--; ) - set_bo(src[i], 0xdeadbeef, width, height); - for (i = 0; i < num_buffers; i++) - cmp_bo(dst[i], i, width, height); + if (drmtest_run_subtest("overwrite-source")) { + for (i = 0; i < num_buffers; i++) + intel_copy_bo(batch, dst[i], src[i], width, height); + for (i = num_buffers; i--; ) + set_bo(src[i], 0xdeadbeef, width, height); + for (i = 0; i < num_buffers; i++) + cmp_bo(dst[i], i, width, height); + } /* try to read the results before the copy completes */ - for (i = 0; i < num_buffers; i++) - intel_copy_bo(batch, dst[i], src[i], width, height); - for (i = num_buffers; i--; ) - cmp_bo(dst[i], 0xdeadbeef, width, height); + if (drmtest_run_subtest("early-read")) { + for (i = num_buffers; i--; ) + set_bo(src[i], 0xdeadbeef, width, height); + for (i = 0; i < num_buffers; i++) + intel_copy_bo(batch, dst[i], src[i], width, height); + for (i = num_buffers; i--; ) + cmp_bo(dst[i], 0xdeadbeef, width, height); + } /* and finally try to trick the kernel into loosing the pending write */ - for (i = num_buffers; i--; ) - set_bo(src[i], 0xabcdabcd, width, height); - for (i = 0; i < num_buffers; i++) - intel_copy_bo(batch, dst[i], src[i], width, height); - for (i = num_buffers; i--; ) - intel_copy_bo(batch, dummy, dst[i], width, height); - for (i = num_buffers; i--; ) - cmp_bo(dst[i], 0xabcdabcd, width, height); + if (drmtest_run_subtest("gpu-read-after-write")) { + for (i = num_buffers; i--; ) + set_bo(src[i], 0xabcdabcd, width, height); + for (i = 0; i < num_buffers; i++) + intel_copy_bo(batch, dst[i], src[i], width, height); + for (i = num_buffers; i--; ) + intel_copy_bo(batch, dummy, dst[i], width, height); + for (i = num_buffers; i--; ) + cmp_bo(dst[i], 0xabcdabcd, width, height); + } return 0; } |