[igt-dev] [PATCH i-g-t 1/8] i915/gem_eio: Check that context create fails when wedged

Chris Wilson chris at chris-wilson.co.uk
Sun Feb 17 14:35:49 UTC 2019


Lock down the new uABI that DRM_IOCTL_I915_GEM_CONTEXT_CREATE returns
-EIO when wedged.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala at intel.com>
---
 tests/i915/gem_eio.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index ac85a2eff..3c54820c9 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -118,6 +118,17 @@ static void test_throttle(int fd)
 	trigger_reset(fd);
 }
 
+static void test_context_create(int fd)
+{
+	uint32_t ctx;
+
+	wedge_gpu(fd);
+
+	igt_assert_eq(__gem_context_create(fd, &ctx), -EIO);
+
+	trigger_reset(fd);
+}
+
 static void test_execbuf(int fd)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -807,6 +818,9 @@ igt_main
 	igt_subtest("throttle")
 		test_throttle(fd);
 
+	igt_subtest("context-create")
+		test_context_create(fd);
+
 	igt_subtest("execbuf")
 		test_execbuf(fd);
 
-- 
2.20.1



More information about the igt-dev mailing list