[PATCH i-g-t v4] lib/igt_psr: Fix PSR active check for DisplayPort connectors

Naladala Ramanaidu ramanaidu.naladala at intel.com
Wed Mar 26 13:26:41 UTC 2025


Update PSR active check logic to correctly identify active
state for Panel Replay on DisplayPort connectors.

v2: Rejected.
v3: Fix null pointer crashes by adding a change to prevent
    potential null pointer dereferences.
v4: drmModeConnector pointer `c` is now initialized to NULL.

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
Reviewed-by: Jouni Högander <jouni.hogander at intel.com>
---
 lib/igt_psr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 83c21e6ba..3d8f1949b 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -92,7 +92,7 @@ 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];
-	drmModeConnector *c;
+	drmModeConnector *c = NULL;
 	const char *state;
 	bool active;
 	int ret;
@@ -122,7 +122,9 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o
 
 	igt_skip_on(strstr(buf, "PSR sink not reliable: yes"));
 
-	active = strstr(buf, state);
+	active = strstr(buf, state) ||
+		 (c && (c->connector_type == DRM_MODE_CONNECTOR_DisplayPort) &&
+		  strstr(buf, "SU_STANDBY"));
 
 	if (active && output && sink_status_checks()) {
 		active = psr_active_sink_check(debugfs_fd, output);
-- 
2.43.0



More information about the igt-dev mailing list