[igt-dev] [PATCH i-g-t] i915/gem_exec_suspend: Exercise S0 (aka s2idle)

Chris Wilson chris at chris-wilson.co.uk
Mon Oct 7 11:06:51 UTC 2019


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.

References: https://bugs.freedesktop.org/show_bug.cgi?id=111909
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/i915/gem_exec_suspend.c         | 16 ++++++++++++----
 tests/intel-ci/fast-feedback.testlist |  1 +
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index e43a16e9e..f25f1a86b 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")
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index e78e7fd0c..2553a68c3 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -56,6 +56,7 @@ igt at gem_exec_reloc@basic-write-read-active
 igt at gem_exec_reloc@basic-softpin
 igt at gem_exec_store@basic-all
 igt at gem_exec_suspend@basic
+igt at gem_exec_suspend@basic-s0
 igt at gem_exec_suspend@basic-s3
 igt at gem_exec_suspend@basic-s4-devices
 igt at gem_flink_basic@bad-flink
-- 
2.23.0



More information about the igt-dev mailing list