diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 17:05:24 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 17:07:51 +0100 |
commit | 4fd34977aff60f58cd955eb9c2d568d5fb824611 (patch) | |
tree | 272808de1587a23cf4ff7d32a5eaf246c15068c1 | |
parent | 4c6f2d4e0c10fe3aa6ee8fffee1541f03cd9fa48 (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_cpu_concurrent_blit.c | 14 | ||||
-rw-r--r-- | 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 5754f61c..2e46c9fb 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 521c1acf..83e5f049 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--; ) |