summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-09-11 16:41:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-09-19 13:08:40 +0100
commit4b0e0bf4df7c95c34dc08b17445bb80f23060ccc (patch)
tree684977c0cab02c261dfd471dfe72374c1c8eb2c7 /tests
parent639d640a1e7340690a55515ac4e47a9328137dea (diff)
igt/gem_eio: Check wedged with inflight on the same engine
Some overlap with gem_exec_fence, but confirm that light for waiting on a fence (both native and external), that a request queued is also flagged as EIO upon wedging. v2: check all ABI engines Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_eio.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 648ca29c..0fa98032 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -159,6 +159,54 @@ static void test_wait(int fd)
trigger_reset(fd);
}
+static void test_inflight(int fd)
+{
+ struct drm_i915_gem_execbuffer2 execbuf;
+ struct drm_i915_gem_exec_object2 obj[2];
+ uint32_t bbe = MI_BATCH_BUFFER_END;
+ unsigned int engine;
+ int fence[64]; /* conservative estimate of ring size */
+
+ igt_require(gem_has_exec_fence(fd));
+
+ memset(obj, 0, sizeof(obj));
+ obj[0].flags = EXEC_OBJECT_WRITE;
+ obj[1].handle = gem_create(fd, 4096);
+ gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
+
+ for_each_engine(fd, engine) {
+ igt_hang_t hang;
+
+ igt_debug("Starting %s on engine '%s'\n", __func__, e__->name);
+ igt_require(i915_reset_control(false));
+
+ hang = igt_hang_ring(fd, engine);
+ obj[0].handle = hang.handle;
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffers_ptr = to_user_pointer(obj);
+ execbuf.buffer_count = 2;
+ execbuf.flags = engine | I915_EXEC_FENCE_OUT;
+
+ for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
+ gem_execbuf_wr(fd, &execbuf);
+ fence[n] = execbuf.rsvd2 >> 32;
+ igt_assert(fence[n] != -1);
+ }
+
+ igt_post_hang_ring(fd, hang);
+
+ igt_assert_eq(__gem_wait(fd, obj[1].handle, -1), 0);
+ for (unsigned int n = 0; n < ARRAY_SIZE(fence); n++) {
+ igt_assert_eq(sync_fence_status(fence[n]), -EIO);
+ close(fence[n]);
+ }
+
+ igt_assert(i915_reset_control(true));
+ trigger_reset(fd);
+ }
+}
+
static void test_inflight_external(int fd)
{
struct drm_i915_gem_execbuffer2 execbuf;
@@ -324,6 +372,9 @@ igt_main
igt_subtest("wait")
test_wait(fd);
+ igt_subtest("in-flight")
+ test_inflight(fd);
+
igt_subtest("in-flight-external")
test_inflight_external(fd);