summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-20 11:38:26 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-21 12:05:48 +0000
commitfcb4cfa520ab987c46b588564b2a057b40e6b02f (patch)
treeb16f26e654a525596a531a306ccf268bb1d8111d /tests
parent3b22b89dd89245b9d174365b43ff53cfb995f210 (diff)
igt/gem_concurrent_all: Inject a hang onto all rings
Also test a hang across all rings, rather than just one engine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_concurrent_all.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index f371f425..e7e4f3a0 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -873,6 +873,35 @@ static struct igt_hang_ring rcs_hang(void)
return igt_hang_ring(fd, I915_EXEC_RENDER);
}
+static struct igt_hang_ring all_hang(void)
+{
+ uint32_t bbe = MI_BATCH_BUFFER_END;
+ struct drm_i915_gem_execbuffer2 execbuf;
+ struct drm_i915_gem_exec_object2 obj;
+ struct igt_hang_ring hang;
+ unsigned engine;
+
+ memset(&obj, 0, sizeof(obj));
+ obj.handle = gem_create(fd, 4096);
+ gem_write(fd, obj.handle, 0, &bbe, sizeof(&bbe));
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffers_ptr = (uintptr_t)&obj;
+ execbuf.buffer_count = 1;
+
+ for_each_engine(fd, engine) {
+ hang = igt_hang_ring(fd, engine);
+
+ execbuf.flags = engine;
+ __gem_execbuf(fd, &execbuf);
+
+ gem_close(fd, hang.handle);
+ }
+
+ hang.handle = obj.handle;
+ return hang;
+}
+
static void do_basic0(struct buffers *buffers,
do_copy do_copy_func,
do_hang do_hang_func)
@@ -1365,6 +1394,7 @@ run_mode(const char *prefix,
{ "", no_hang },
{ "-hang-blt", bcs_hang },
{ "-hang-render", rcs_hang },
+ { "-hang-all", all_hang },
{ NULL, NULL },
}, *h;
struct buffers buffers;