<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>On Wed, 2024-10-30 at 19:54 +0530, Naladala, Ramanaidu wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<p>Hi Jouni,<br>
</p>
<div class="moz-cite-prefix">On 10/30/2024 12:28 PM, Jouni Högander wrote:<br>
</div>
<div><br>
</div>
<blockquote type="cite" cite="mid:20241030065827.2392745-1-jouni.hogander@intel.com" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre>Checking sink PSR status seems to be causing problems as it is performed</pre>
<pre>by reading dcpd status registers over AUX channel.</pre>
<pre><br></pre>
<pre>Generally having still possibility to check also sink status is a good idea</pre>
<pre>-> disable them by default and enabled if environment variable</pre>
<pre>IGT_PSR_SINK_STATUS_CHECKS is set.</pre>
<pre><br></pre>
<pre>Signed-off-by: Jouni Högander <a class="moz-txt-link-rfc2396E" href="mailto:jouni.hogander@intel.com"><jouni.hogander@intel.com></a></pre>
<pre>---</pre>
<pre> lib/igt_psr.c | 16 +++++++++++++---</pre>
<pre> 1 file changed, 13 insertions(+), 3 deletions(-)</pre>
<pre><br></pre>
<pre>diff --git a/lib/igt_psr.c b/lib/igt_psr.c</pre>
<pre>index 0eb002633..83c21e6ba 100644</pre>
<pre>--- a/lib/igt_psr.c</pre>
<pre>+++ b/lib/igt_psr.c</pre>
<pre>@@ -79,13 +79,21 @@ bool early_transport_check(int debugfs_fd)</pre>
<pre> return strstr(buf, "enabled (Early Transport)");</pre>
<pre> }</pre>
<pre> </pre>
<pre>+static bool sink_status_checks(void)</pre>
<pre>+{</pre>
<pre>+ const char *env;</pre>
<pre>+</pre>
<pre>+ env = getenv("IGT_PSR_SINK_STATUS_CHECKS");</pre>
<pre>+</pre>
<pre>+ return env && atoi(env);</pre>
<pre>+}</pre>
<pre>+</pre>
<pre> static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *output)</pre>
<pre> {</pre>
<pre> char debugfs_file[128] = {0};</pre>
<pre> char buf[PSR_STATUS_MAX_LEN];</pre>
<pre> drmModeConnector *c;</pre>
<pre> const char *state;</pre>
<pre>- const char *env;</pre>
<pre> bool active;</pre>
<pre> int ret;</pre>
<pre> </pre>
<pre>@@ -116,8 +124,7 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o</pre>
<pre> </pre>
<pre> active = strstr(buf, state);</pre>
<pre> </pre>
<pre>- env = getenv("IGT_PANEL_REPLAY_IGNORE_SINK_STATUS");</pre>
<pre>- if (active && output && (!env || !atoi(env))) {</pre>
<pre>+ if (active && output && sink_status_checks()) {</pre>
<pre> active = psr_active_sink_check(debugfs_fd, output);</pre>
<pre> igt_assert_f(active, "PSR sink/source state mismatch\n");</pre>
<pre> }</pre>
<pre>@@ -351,6 +358,9 @@ void psr_sink_error_check(int debugfs_fd, enum psr_mode mode, igt_output_t *outp</pre>
<pre> char buf[PSR_STATUS_MAX_LEN];</pre>
<pre> int ret;</pre>
<pre> </pre>
<pre>+ if (!sink_status_checks())</pre>
<pre>+ return;</pre>
<pre>+</pre>
<pre> sprintf(debugfs_file, "%s/i915_psr_sink_status", output->name);</pre>
<pre> ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file, buf,</pre>
<pre> sizeof(buf));</pre>
</blockquote>
<pre>LGTM,</pre>
<pre><span class="reviewed-by" style="box-sizing: border-box;">Reviewed-by: Naladala Ramanaidu <a class="moz-txt-link-rfc2396E" href="mailto:ramanaidu.naladala@intel.com"><ramanaidu.naladala@intel.com></a></span></pre>
</blockquote>
<div><br>
</div>
<div>Thank you Ramanaidu for checking my patch. This is now pushed to master.</div>
<div><br>
</div>
<div>BR,</div>
<div><br>
</div>
<div>Jouni Högander</div>
<div><br>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div><br>
</div>
<blockquote type="cite" cite="mid:20241030065827.2392745-1-jouni.hogander@intel.com" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
</blockquote>
<div></div>
</blockquote>
<div><br>
</div>
<div><span></span></div>
</body>
</html>