Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> --- 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx