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>
This commit is contained in:
Chris Wilson 2013-06-29 17:05:24 +01:00
parent 4c6f2d4e0c
commit 4fd34977af
2 changed files with 17 additions and 7 deletions

View File

@ -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--; )

View File

@ -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--; )