test/gem_(cpu|gtt)_concurrent_blit: Move the set_bo() from create to the test
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 29 Jun 2013 16:05:24 +0000 (17:05 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 29 Jun 2013 16:07:51 +0000 (17:07 +0100)
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>
tests/gem_cpu_concurrent_blit.c
tests/gem_gtt_concurrent_blit.c

index 5754f61..2e46c9f 100644 (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--; )
index 521c1ac..83e5f04 100644 (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--; )