Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_psr: Check sink status only when wanted
@ 2024-10-30  6:58 Jouni Högander
  2024-10-30  7:45 ` ✓ CI.xeBAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jouni Högander @ 2024-10-30  6:58 UTC (permalink / raw)
  To: igt-dev; +Cc: Jouni Högander

Checking sink PSR status seems to be causing problems as it is performed
by reading dcpd status registers over AUX channel.

Generally having still possibility to check also sink status is a good idea
-> disable them by default and enabled if environment variable
IGT_PSR_SINK_STATUS_CHECKS is set.

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

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 0eb002633..83c21e6ba 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -79,13 +79,21 @@ bool early_transport_check(int debugfs_fd)
 	return strstr(buf, "enabled (Early Transport)");
 }
 
+static bool sink_status_checks(void)
+{
+	const char *env;
+
+	env = getenv("IGT_PSR_SINK_STATUS_CHECKS");
+
+	return env && atoi(env);
+}
+
 static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
 {
 	char debugfs_file[128] = {0};
 	char buf[PSR_STATUS_MAX_LEN];
 	drmModeConnector *c;
 	const char *state;
-	const char *env;
 	bool active;
 	int ret;
 
@@ -116,8 +124,7 @@ 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 && sink_status_checks()) {
 		active = psr_active_sink_check(debugfs_fd, output);
 		igt_assert_f(active, "PSR sink/source state mismatch\n");
 	}
@@ -351,6 +358,9 @@ void psr_sink_error_check(int debugfs_fd, enum psr_mode mode, igt_output_t *outp
 	char buf[PSR_STATUS_MAX_LEN];
 	int ret;
 
+	if (!sink_status_checks())
+		return;
+
 	sprintf(debugfs_file, "%s/i915_psr_sink_status", output->name);
 	ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file, buf,
 				      sizeof(buf));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-31  9:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30  6:58 [PATCH i-g-t] lib/igt_psr: Check sink status only when wanted Jouni Högander
2024-10-30  7:45 ` ✓ CI.xeBAT: success for " Patchwork
2024-10-30  7:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-10-30  9:25 ` ✗ CI.xeFULL: " Patchwork
2024-10-31  8:36   ` Hogander, Jouni
2024-10-30 12:16 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-30 14:24 ` [PATCH i-g-t] " Naladala, Ramanaidu
2024-10-31  9:23   ` Hogander, Jouni
2024-10-31  0:23 ` ✓ Fi.CI.IGT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox