[Intel-gfx] [PATCH igt] igt/gem_eio: Test we can suspend when the driver is already wedged

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 29 21:19:58 UTC 2017


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

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index ca0020f1..7a6be393 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -82,6 +82,15 @@ static void wedge_gpu(int fd)
 	igt_assert(i915_reset_control(true));
 }
 
+static void wedgeme(int drm_fd)
+{
+	int dir = igt_debugfs_dir(drm_fd);
+
+	igt_sysfs_set(dir, "i915_wedged", "-1");
+
+	close(dir);
+}
+
 static int __gem_throttle(int fd)
 {
 	int err = 0;
@@ -159,6 +168,18 @@ static void test_wait(int fd)
 	trigger_reset(fd);
 }
 
+static void test_suspend(int fd, int state)
+{
+	/* Check we can suspend when the driver is already wedged */
+	igt_require(i915_reset_control(false));
+	wedgeme(fd);
+
+	igt_system_suspend_autoresume(state, SUSPEND_TEST_DEVICES);
+
+	igt_require(i915_reset_control(true));
+	trigger_reset(fd);
+}
+
 static void test_inflight(int fd)
 {
 	struct drm_i915_gem_execbuffer2 execbuf;
@@ -445,6 +466,12 @@ igt_main
 	igt_subtest("wait")
 		test_wait(fd);
 
+	igt_subtest("suspend")
+		test_suspend(fd, SUSPEND_STATE_MEM);
+
+	igt_subtest("hibernate")
+		test_suspend(fd, SUSPEND_STATE_DISK);
+
 	igt_subtest("in-flight")
 		test_inflight(fd);
 
-- 
2.15.0



More information about the Intel-gfx mailing list