Commit ac6739bc authored by Chris Wilson's avatar Chris Wilson 😣

igt/gem_eio: Test we can suspend when the driver is already wedged

Signed-off-by: Chris Wilson's avatarChris 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's avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent b5c0ca69
......@@ -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);
......
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