summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-12-17 09:16:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-12-17 15:25:43 +0000
commit8bf09f3d12f5a8d984f084f116b195925dca571b (patch)
tree7842a7804b3df40a23556c4eb0409a65d0f13283
parent04bd964527bf1962d3fd94f863161f5828eba767 (diff)
tests/gem_concurrent_all: Add a couple more sanitycheck patterns
As always, the goal is to quickly stress a variety of workloads that often lead to kernel bugs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_concurrent_all.c71
1 files changed, 66 insertions, 5 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index af6296e9..b2338da2 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -582,9 +582,26 @@ static void check_gpu(void)
igt_assert_eq(missed_irq, 0);
}
-static void do_basic(struct buffers *buffers,
- do_copy do_copy_func,
- do_hang do_hang_func)
+static void do_basic0(struct buffers *buffers,
+ do_copy do_copy_func,
+ do_hang do_hang_func)
+{
+ gem_quiescent_gpu(fd);
+
+ buffers->mode->set_bo(buffers->src[0], 0xdeadbeef, width, height);
+ for (int i = 0; i < buffers->count; i++) {
+ struct igt_hang_ring hang = do_hang_func();
+
+ do_copy_func(buffers->dst[i], buffers->src[0]);
+ buffers->mode->cmp_bo(buffers->dst[i], 0xdeadbeef, width, height, buffers->dummy);
+
+ igt_post_hang_ring(fd, hang);
+ }
+}
+
+static void do_basic1(struct buffers *buffers,
+ do_copy do_copy_func,
+ do_hang do_hang_func)
{
gem_quiescent_gpu(fd);
@@ -593,13 +610,41 @@ static void do_basic(struct buffers *buffers,
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]);
+ usleep(0); /* let someone else claim the mutex */
buffers->mode->cmp_bo(buffers->dst[i], i, width, height, buffers->dummy);
igt_post_hang_ring(fd, hang);
}
}
+static void do_basicN(struct buffers *buffers,
+ do_copy do_copy_func,
+ do_hang do_hang_func)
+{
+ struct igt_hang_ring hang;
+
+ gem_quiescent_gpu(fd);
+
+ for (int i = 0; i < buffers->count; i++) {
+ buffers->mode->set_bo(buffers->src[i], i, width, height);
+ buffers->mode->set_bo(buffers->dst[i], ~i, width, height);
+ }
+
+ hang = do_hang_func();
+
+ for (int i = 0; i < buffers->count; i++) {
+ do_copy_func(buffers->dst[i], buffers->src[i]);
+ usleep(0); /* let someone else claim the mutex */
+ }
+
+ for (int i = 0; i < buffers->count; 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)
@@ -1048,11 +1093,27 @@ run_basic_modes(const char *prefix,
batch = buffers_init(&buffers, mode, fd);
}
- igt_subtest_f("%s-%s-%s-sanitycheck%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) {
+ igt_subtest_f("%s-%s-%s-sanitycheck0%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) {
+ h->require();
+ p->require();
+ buffers_create(&buffers, num_buffers);
+ run_wrap_func(&buffers, do_basic0,
+ p->copy, h->hang);
+ }
+
+ igt_subtest_f("%s-%s-%s-sanitycheck1%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) {
+ h->require();
+ p->require();
+ buffers_create(&buffers, num_buffers);
+ run_wrap_func(&buffers, do_basic1,
+ p->copy, h->hang);
+ }
+
+ igt_subtest_f("%s-%s-%s-sanitycheckN%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) {
h->require();
p->require();
buffers_create(&buffers, num_buffers);
- run_wrap_func(&buffers, do_basic,
+ run_wrap_func(&buffers, do_basicN,
p->copy, h->hang);
}