Commit 32c89884 authored by Chris Wilson's avatar Chris Wilson 😣

igt/gem_eio: Waiting on a hung batch should report -EIO

If we are waiting on a handle, and its request is cancelled due to a
hang, we should report that explicitly through the ABI.
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 7f952bd9
......@@ -147,9 +147,34 @@ static void test_execbuf(int fd)
trigger_reset(fd);
}
static int __gem_wait(int fd, uint32_t handle, int64_t timeout)
{
struct drm_i915_gem_wait wait;
int err = 0;
memset(&wait, 0, sizeof(wait));
wait.bo_handle = handle;
wait.timeout_ns = timeout;
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_WAIT, &wait))
err = -errno;
return err;
}
static void test_wait(int fd)
{
igt_hang_ring_t hang;
hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
igt_assert_eq(__gem_wait(fd, hang.handle, -1), -EIO);
igt_post_hang_ring(fd, hang);
trigger_reset(fd);
}
igt_main
{
int fd;
int fd = -1;
igt_skip_on_simulation();
......@@ -164,6 +189,9 @@ igt_main
igt_subtest("execbuf")
test_execbuf(fd);
igt_subtest("wait")
test_wait(fd);
igt_fixture
close(fd);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment