[PATCH i-g-t] lib/igt_psr: Check sink status only when wanted
Naladala, Ramanaidu
Ramanaidu.naladala at intel.com
Wed Oct 30 14:24:33 UTC 2024
Hi Jouni,
On 10/30/2024 12:28 PM, Jouni Högander wrote:
> 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 at 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));
LGTM,
Reviewed-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20241030/ac8de5fa/attachment-0001.htm>
More information about the igt-dev
mailing list