All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 1/5] i915/i915_pm_rpm: Enable PC8+ residency test
Date: Wed, 26 May 2021 12:50:36 +0530	[thread overview]
Message-ID: <20210526072040.2286-2-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20210526072040.2286-1-anshuman.gupta@intel.com>

Enabled pc8-residency test for each platform that supports pc8.
SKL onwards Platforms can enter the PC8 even with display on,
therefore it requires to bifurcate pc8-residency igt test into
display-on and display-off igt test case.

Negative testing of PC8 residency on HASWELL/BROADWELL while
display being "on" is removed as it saves CI time and there is
no ROI of such testing.

v2: chooses the optimum timeout value for PC8 test timeout.

v3: cosmetics changes. [Uma]

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_rpm.c | 46 ++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index d9ec0388..9f5656bb 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -52,6 +52,7 @@
 #include "igt_debugfs.h"
 #include "igt_device.h"
 #include "igt_edid.h"
+#include "igt_psr.h"
 
 #define MSR_PC8_RES	0x630
 #define MSR_PC9_RES	0x631
@@ -85,6 +86,14 @@ enum plane_type {
 #define WAIT_EXTRA	4
 #define USE_DPMS	8
 
+/*
+ * PC state timeout
+ * idle time of msecs is enough for cpu to be in C10 but for package C states
+ * it requires other soc devices to be idle, to be ready for entry to PC8/PC10.
+ * Let's keep 3 seconds timeout for PC8 and 5 seconds for PC10.
+ */
+#define PC8_TIMEOUT 3
+
 int drm_fd, msr_fd, pc8_status_fd;
 int debugfs;
 bool has_runtime_pm, has_pc8;
@@ -728,10 +737,6 @@ static void setup_pc8(void)
 {
 	has_pc8 = false;
 
-	/* Only Haswell supports the PC8 feature. */
-	if (!IS_HASWELL(ms_data.devid) && !IS_BROADWELL(ms_data.devid))
-		return;
-
 	/* Make sure our Kernel supports MSR and the module is loaded. */
 	igt_require(modprobe("msr") == 0);
 
@@ -827,20 +832,27 @@ static void basic_subtest(void)
 	/* XXX Also we can test wake up via exec nop */
 }
 
-static void pc8_residency_subtest(void)
+static void pc8_residency_subtest(bool display_on)
 {
 	igt_require(has_pc8);
 
-	/* Make sure PC8+ residencies move! */
-	disable_all_screens(&ms_data);
-	igt_assert_f(pc8_plus_residency_changed(30),
-		     "Machine is not reaching PC8+ states, please check its "
-		     "configuration.\n");
+	if (IS_HASWELL(ms_data.devid) || IS_BROADWELL(ms_data.devid))
+		igt_require_f(!display_on, "pc8 with display on not supported\n");
 
-	/* Make sure PC8+ residencies stop! */
-	enable_one_screen(&ms_data);
-	igt_assert_f(!pc8_plus_residency_changed(10),
-		     "PC8+ residency didn't stop with screen enabled.\n");
+	if (!display_on) {
+		/* Make sure PC8+ residencies move! */
+		disable_all_screens(&ms_data);
+		igt_assert_f(pc8_plus_residency_changed(PC8_TIMEOUT),
+			     "Machine is not reaching PC8+ states with all screens disabled.\n");
+	} else {
+		/* check pc8 with psr disabled on any output */
+		psr_disable(drm_fd, debugfs);
+		enable_one_screen(&ms_data);
+		igt_assert_f(pc8_plus_residency_changed(PC8_TIMEOUT),
+			     "Machine is not reaching PC8+ states with a screen enabled.\n");
+		/* Restore PSR with PSR_MODE_1 for rest of IGT */
+		psr_enable(drm_fd, debugfs, PSR_MODE_1);
+	}
 }
 
 static void modeset_subtest(enum screen_type type, int rounds, int wait_flags)
@@ -2075,8 +2087,10 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
 		reg_read_ioctl_subtest();
 	igt_subtest("i2c")
 		i2c_subtest();
-	igt_subtest("pc8-residency")
-		pc8_residency_subtest();
+	igt_subtest("pc8-residency-display-on")
+		pc8_residency_subtest(true);
+	igt_subtest("pc8-residency-display-off")
+		pc8_residency_subtest(false);
 	igt_subtest("debugfs-read")
 		debugfs_read_subtest();
 	igt_subtest("debugfs-forcewake-user")
-- 
2.26.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-05-26  7:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  7:20 [igt-dev] [PATCH i-g-t v4 0/5] PC state igt test Anshuman Gupta
2021-05-26  7:20 ` Anshuman Gupta [this message]
2021-05-26  7:20 ` [igt-dev] [PATCH i-g-t v4 2/5] i915/i915_pm_rpm: optimize modeset-pc8-residency-stress test Anshuman Gupta
2021-05-26  7:20 ` [igt-dev] [PATCH i-g-t v4 3/5] i915/i915_pm_rpm: gem-execbuf-stress PC8 timeout Anshuman Gupta
2021-05-26  7:20 ` [igt-dev] [PATCH i-g-t v4 4/5] i915/i915_pm_rpm: Add PC10 display off test Anshuman Gupta
2021-05-26  7:20 ` [igt-dev] [PATCH i-g-t v4 5/5] i915/i915_pm_rpm: Add PC10 idle display on test Anshuman Gupta
2021-05-26  9:12 ` [igt-dev] ✗ GitLab.Pipeline: warning for PC state igt test (rev4) Patchwork
2021-05-26  9:13 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-05-26 11:56 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526072040.2286-2-anshuman.gupta@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.