summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_suspend.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-07 12:02:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-25 23:00:07 +0100
commit15c11e2df77f769b5fa9ca5b40a94f266370a479 (patch)
tree86ab523aee5a162f7daedc4dd67dfa4e89a931d8 /tests/i915/gem_exec_suspend.c
parent17b87c378fa155390b13a43f141371fd899d567b (diff)
i915/gem_exec_suspend: Exercise S0 (aka s2idle)
Exercise the first level of suspend, S0. This is basically the same as our runtime-suspend, we need to put the device to sleep but otherwise it is left powered up. Ideally, we would measure the energy consumption in this state. Maybe /sys/class/power_supply/BAT0/* can be of some value. References: https://bugs.freedesktop.org/show_bug.cgi?id=111909 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_exec_suspend.c')
-rw-r--r--tests/i915/gem_exec_suspend.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index e43a16e9..f25f1a86 100644
--- a/tests/i915/gem_exec_suspend.c
+++ b/tests/i915/gem_exec_suspend.c
@@ -32,10 +32,11 @@
#include "igt_dummyload.h"
#define NOSLEEP 0
-#define SUSPEND_DEVICES 1
-#define SUSPEND 2
-#define HIBERNATE_DEVICES 3
-#define HIBERNATE 4
+#define IDLE 1
+#define SUSPEND_DEVICES 2
+#define SUSPEND 3
+#define HIBERNATE_DEVICES 4
+#define HIBERNATE 5
#define mode(x) ((x) & 0xff)
#define LOCAL_I915_EXEC_BSD_SHIFT (13)
@@ -195,6 +196,11 @@ static void run_test(int fd, unsigned engine, unsigned flags)
case NOSLEEP:
break;
+ case IDLE:
+ igt_system_suspend_autoresume(SUSPEND_STATE_FREEZE,
+ SUSPEND_TEST_NONE);
+ break;
+
case SUSPEND_DEVICES:
igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_DEVICES);
@@ -255,6 +261,8 @@ igt_main
igt_subtest("basic")
run_test(fd, ALL_ENGINES, NOSLEEP);
+ igt_subtest("basic-S0")
+ run_test(fd, ALL_ENGINES, IDLE);
igt_subtest("basic-S3-devices")
run_test(fd, ALL_ENGINES, SUSPEND_DEVICES);
igt_subtest("basic-S3")