summaryrefslogtreecommitdiff
path: root/tests/gem_concurrent_all.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-12-09 20:54:10 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-12-09 20:57:52 +0000
commit197db8607d910c7d5252c1d928b715ff4c4c28ce (patch)
tree084af3303b067ef2a1dba2618eb913e48804a34e /tests/gem_concurrent_all.c
parent4cc40ad4fe80f4d107e8e4279b0b07243b91f77c (diff)
igt/gem_concurrent_blit: Explicitly check for "missed interrupts"
As the concurrency tests are a good source of stress for i915_wait_request() (the tests are primarily designed to ensure that GPU activity of one form or another is completed before access by third parties), one of the common form of errors we can detect are the "missing interrupts" (i.e. where the waits do not terminate because of a race between the interrupt and the seqno write). Add an explicit check for this error and flag it as a definite fail - which also helps narrow it down to certain subtests when run as a batch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_concurrent_all.c')
-rw-r--r--tests/gem_concurrent_all.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 559964ec..ec124286 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -555,6 +555,44 @@ static void hang_require(void)
igt_require_hang_ring(fd, -1);
}
+static void check_gpu(void)
+{
+ unsigned missed_irq = 0;
+ FILE *file;
+
+ gem_quiescent_gpu(fd);
+
+ file = igt_debugfs_fopen("i915_ring_missed_irq", "r");
+ if (file) {
+ fscanf(file, "%x", &missed_irq);
+ fclose(file);
+ }
+ file = igt_debugfs_fopen("i915_ring_missed_irq", "w");
+ if (file) {
+ fwrite("0\n", 1, 2, file);
+ fclose(file);
+ }
+ igt_assert_eq(missed_irq, 0);
+}
+
+static void do_basic(struct buffers *buffers,
+ do_copy do_copy_func,
+ do_hang do_hang_func)
+{
+ gem_quiescent_gpu(fd);
+
+ for (int i = 0; i < buffers->count; i++) {
+ struct igt_hang_ring hang = do_hang_func();
+
+ buffers->mode->set_bo(buffers->src[i], i, width, height);
+ buffers->mode->set_bo(buffers->dst[i], ~i, width, height);
+ do_copy_func(buffers->dst[i], buffers->src[i]);
+ buffers->mode->cmp_bo(buffers->dst[i], i, width, height, buffers->dummy);
+
+ igt_post_hang_ring(fd, hang);
+ }
+}
+
static void do_overwrite_source(struct buffers *buffers,
do_copy do_copy_func,
do_hang do_hang_func)
@@ -852,6 +890,7 @@ static void run_single(struct buffers *buffers,
do_hang do_hang_func)
{
do_test_func(buffers, do_copy_func, do_hang_func);
+ check_gpu();
}
static void run_interruptible(struct buffers *buffers,
@@ -863,6 +902,7 @@ static void run_interruptible(struct buffers *buffers,
for (loop = 0; loop < 10; loop++)
do_test_func(buffers, do_copy_func, do_hang_func);
+ check_gpu();
}
static void run_forked(struct buffers *buffers,
@@ -890,6 +930,7 @@ static void run_forked(struct buffers *buffers,
}
igt_waitchildren();
+ check_gpu();
num_buffers = old_num_buffers;
}
@@ -979,6 +1020,14 @@ run_basic_modes(const struct access_mode *mode,
batch = buffers_init(&buffers, mode, fd);
}
+ igt_subtest_f("%s-%s-basic%s%s", mode->name, p->prefix, suffix, h->suffix) {
+ h->require();
+ p->require();
+ buffers_create(&buffers, num_buffers);
+ run_wrap_func(&buffers, do_basic,
+ p->copy, h->hang);
+ }
+
/* try to overwrite the source values */
igt_subtest_f("%s-%s-overwrite-source-one%s%s", mode->name, p->prefix, suffix, h->suffix) {
h->require();