From 4fd34977aff60f58cd955eb9c2d568d5fb824611 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 29 Jun 2013 17:05:24 +0100 Subject: [PATCH] test/gem_(cpu|gtt)_concurrent_blit: Move the set_bo() from create to the test Hiding the initial set_bo() required for the "overwrite-source" tests lead to a nice bit of hilarity as I missed repeating the initialisation for the multiple loops of the interruptible version of "overwrite-source". Signed-off-by: Chris Wilson --- tests/gem_cpu_concurrent_blit.c | 14 +++++++++----- tests/gem_gtt_concurrent_blit.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/gem_cpu_concurrent_blit.c b/tests/gem_cpu_concurrent_blit.c index 5754f61..2e46c9f 100644 --- a/tests/gem_cpu_concurrent_blit.c +++ b/tests/gem_cpu_concurrent_blit.c @@ -82,8 +82,6 @@ create_bo(drm_intel_bufmgr *bufmgr, uint32_t val, int width, int height) bo = drm_intel_bo_alloc(bufmgr, "bo", 4*width*height, 0); assert(bo); - set_bo(bo, val, width, height); - return bo; } @@ -119,8 +117,10 @@ main(int argc, char **argv) /* try to overwrite the source values */ 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 = 0; i < num_buffers; i++) { + set_bo(src[i], i, width, height); + set_bo(dst[i], i, width, height); + } for (i = num_buffers; i--; ) set_bo(src[i], 0xdeadbeef, width, height); for (i = 0; i < num_buffers; i++) @@ -153,8 +153,12 @@ main(int argc, char **argv) /* try to overwrite the source values */ if (drmtest_run_subtest("overwrite-source-interruptible")) { - for (loop = 0; loop < 10; loop++) { + for (loop = 0; loop < 1; loop++) { gem_quiescent_gpu(fd); + for (i = 0; i < num_buffers; i++) { + set_bo(src[i], i, width, height); + set_bo(dst[i], i, width, height); + } for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) diff --git a/tests/gem_gtt_concurrent_blit.c b/tests/gem_gtt_concurrent_blit.c index 521c1ac..83e5f04 100644 --- a/tests/gem_gtt_concurrent_blit.c +++ b/tests/gem_gtt_concurrent_blit.c @@ -85,8 +85,6 @@ create_bo(drm_intel_bufmgr *bufmgr, uint32_t val, int width, int height) * manually tell the kernel when we start access the gtt. */ do_or_die(drm_intel_gem_bo_map_gtt(bo)); - set_bo(bo, val, width, height); - return bo; } @@ -122,6 +120,10 @@ main(int argc, char **argv) /* try to overwrite the source values */ if (drmtest_run_subtest("overwrite-source")) { + for (i = 0; i < num_buffers; i++) { + set_bo(src[i], i, width, height); + set_bo(dst[i], i, width, height); + } for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) @@ -158,6 +160,10 @@ main(int argc, char **argv) if (drmtest_run_subtest("overwrite-source-interruptible")) { for (loop = 0; loop < 10; loop++) { gem_quiescent_gpu(fd); + for (i = 0; i < num_buffers; i++) { + set_bo(src[i], i, width, height); + set_bo(dst[i], i, width, height); + } for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) -- 2.7.4