From: Chris Wilson Date: Sat, 29 Jun 2013 15:45:46 +0000 (+0100) Subject: tests/gem_(cpu|gtt)_concurrent_blit: Restore the old tests and add the new interrupti... X-Git-Tag: intel-gpu-tools-1.4~353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c6f2d4e0c10fe3aa6ee8fffee1541f03cd9fa48;p=profile%2Fextras%2Fintel-gpu-tools.git tests/gem_(cpu|gtt)_concurrent_blit: Restore the old tests and add the new interruptible as new tests Daniel preferred to keep the old tests intact lest we accidentally break them, and to add the new interruptible tests as new subtests. In the process also make sure the GPU is idle before starting each loop. Signed-off-by: Chris Wilson --- diff --git a/tests/gem_cpu_concurrent_blit.c b/tests/gem_cpu_concurrent_blit.c index 9968084..5754f61 100644 --- a/tests/gem_cpu_concurrent_blit.c +++ b/tests/gem_cpu_concurrent_blit.c @@ -118,9 +118,43 @@ main(int argc, char **argv) } /* try to overwrite the source values */ - drmtest_fork_signal_helper(); 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 */ + 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 */ + 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); + } + + drmtest_fork_signal_helper(); + + /* try to overwrite the source values */ + if (drmtest_run_subtest("overwrite-source-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) @@ -131,8 +165,9 @@ main(int argc, char **argv) } /* try to read the results before the copy completes */ - if (drmtest_run_subtest("early-read")) { + if (drmtest_run_subtest("early-read-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = num_buffers; i--; ) set_bo(src[i], 0xdeadbeef, width, height); for (i = 0; i < num_buffers; i++) @@ -143,8 +178,9 @@ main(int argc, char **argv) } /* and finally try to trick the kernel into loosing the pending write */ - if (drmtest_run_subtest("gpu-read-after-write")) { + if (drmtest_run_subtest("gpu-read-after-write-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = num_buffers; i--; ) set_bo(src[i], 0xabcdabcd, width, height); for (i = 0; i < num_buffers; i++) @@ -155,6 +191,7 @@ main(int argc, char **argv) cmp_bo(dst[i], 0xabcdabcd, width, height); } } + drmtest_fork_signal_helper(); return 0; diff --git a/tests/gem_gtt_concurrent_blit.c b/tests/gem_gtt_concurrent_blit.c index e0962f8..521c1ac 100644 --- a/tests/gem_gtt_concurrent_blit.c +++ b/tests/gem_gtt_concurrent_blit.c @@ -121,9 +121,43 @@ main(int argc, char **argv) } /* try to overwrite the source values */ - drmtest_fork_signal_helper(); 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 */ + 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 */ + 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); + } + + drmtest_fork_signal_helper(); + + /* try to read the results before the copy completes */ + if (drmtest_run_subtest("overwrite-source-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = 0; i < num_buffers; i++) intel_copy_bo(batch, dst[i], src[i], width, height); for (i = num_buffers; i--; ) @@ -134,8 +168,9 @@ main(int argc, char **argv) } /* try to read the results before the copy completes */ - if (drmtest_run_subtest("early-read")) { + if (drmtest_run_subtest("early-read-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = num_buffers; i--; ) set_bo(src[i], 0xdeadbeef, width, height); for (i = 0; i < num_buffers; i++) @@ -146,8 +181,9 @@ main(int argc, char **argv) } /* and finally try to trick the kernel into loosing the pending write */ - if (drmtest_run_subtest("gpu-read-after-write")) { + if (drmtest_run_subtest("gpu-read-after-write-interruptible")) { for (loop = 0; loop < 10; loop++) { + gem_quiescent_gpu(fd); for (i = num_buffers; i--; ) set_bo(src[i], 0xabcdabcd, width, height); for (i = 0; i < num_buffers; i++) @@ -158,6 +194,7 @@ main(int argc, char **argv) cmp_bo(dst[i], 0xabcdabcd, width, height); } } + drmtest_stop_signal_helper(); return 0;