diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-29 20:03:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-30 12:35:50 +0000 |
commit | ac6739bcc7ee9682b40e7b7ac9625674fe3dc95e (patch) | |
tree | 55cbff023b6259369c1ffdd5dada6ae8513e5171 /tests/gem_eio.c | |
parent | b5c0ca69ded3bf82e2d70fbab01dc9c9fff36664 (diff) |
igt/gem_eio: Test we can suspend when the driver is already wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests/gem_eio.c')
-rw-r--r-- | tests/gem_eio.c | 27 |
1 files changed, 27 insertions, 0 deletions
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); |