[PATCH i-g-t 2/2] lib/igt_psr: Assert on sink/source state mismatch

Jouni Högander jouni.hogander at intel.com
Thu Sep 26 07:05:17 UTC 2024


Assert if sink state is not PSR active while source state is PSR
active. This makes it easier to identify failure due to sink/source
mismatch.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 lib/igt_psr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 963385967..0eb002633 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -117,8 +117,10 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o
 	active = strstr(buf, state);
 
 	env = getenv("IGT_PANEL_REPLAY_IGNORE_SINK_STATUS");
-	if (active && output && (!env || !atoi(env)))
+	if (active && output && (!env || !atoi(env))) {
 		active = psr_active_sink_check(debugfs_fd, output);
+		igt_assert_f(active, "PSR sink/source state mismatch\n");
+	}
 
 	return active;
 }
-- 
2.34.1



More information about the igt-dev mailing list