diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 16:45:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-29 16:49:05 +0100 |
commit | 4c6f2d4e0c10fe3aa6ee8fffee1541f03cd9fa48 (patch) | |
tree | a8895afd59c390fee2c37585f9470d3388bc41d4 | |
parent | 95426dc206eee75a7092bc6f00a53572892ba0e5 (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_cpu_concurrent_blit.c | 43 | ||||
-rw-r--r-- | tests/gem_gtt_concurrent_blit.c | 43 |
2 files changed, 80 insertions, 6 deletions
diff --git a/tests/gem_cpu_concurrent_blit.c b/tests/gem_cpu_concurrent_blit.c index 996808426..5754f61c9 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 e0962f860..521c1acf9 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; |