[PATCH i-g-t v2 3/6] lib/igt_psr: Handle PR_MODE2_SEL_FETCH and eDP PR_* in psr active check

Jouni Högander jouni.hogander at intel.com
Thu Jun 13 09:25:11 UTC 2024


Panel Replay expected state is always SRDENT for DP2.0 Panel Replay.
For eDP1.5 Panel Replay it is SLEEP. Due to this output is now mandatory
parameter to psr_active_check if PSR mode is Panel Replay.

Bspec: 68920, 68934

v2: fix mode checks

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
Reviewed-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 lib/igt_psr.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index d1286276c..012521fc5 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -57,9 +57,25 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o
 {
 	char debugfs_file[128] = {0};
 	char buf[PSR_STATUS_MAX_LEN];
-	const char *state = (mode == PSR_MODE_1 || mode == PR_MODE) ? "SRDENT" : "DEEP_SLEEP";
+	drmModeConnector *c;
+	const char *state;
 	int ret;
 
+	if (mode == PR_MODE || mode == PR_MODE_SEL_FETCH) {
+		igt_assert_f(output, "Output not given\n");
+		c = output->config.connector;
+	}
+
+	if ((mode == PR_MODE || mode == PR_MODE_SEL_FETCH) &&
+	    c && c->connector_type == DRM_MODE_CONNECTOR_eDP)
+		state = "SLEEP";
+	else if (mode == PSR_MODE_1 || mode == PR_MODE || mode == PR_MODE_SEL_FETCH)
+		state = "SRDENT";
+	else if (mode == PSR_MODE_2 || mode == PSR_MODE_2_SEL_FETCH)
+		state = "DEEP_SLEEP";
+	else
+		igt_assert_f(false, "Invalid psr mode\n");
+
 	SET_DEBUGFS_PATH(output, debugfs_file);
 	ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file,
 				     buf, sizeof(buf));
-- 
2.34.1



More information about the igt-dev mailing list