From: "Jouni Högander" <jouni.hogander@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH] lib/igt_psr: Dump out PSR status if waiting PSR entry or update fails
Date: Tue, 19 Nov 2024 14:33:24 +0200 [thread overview]
Message-ID: <20241119123324.4070696-1-jouni.hogander@intel.com> (raw)
Currently we are receiving reports from CI testing indication PSR entry of
update are failing. It would ease making conclusions on the reports if PSR
status when failure happened would be available. Solve this by printing out
PSR status if waiting PSR entry or update fails.
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
lib/igt_psr.c | 39 +++++++++++++++++++++++++++++++--------
1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 83c21e6ba..61feea9aa 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -88,10 +88,9 @@ static bool sink_status_checks(void)
return env && atoi(env);
}
-static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
+static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *output, char *buf, int buf_len)
{
char debugfs_file[128] = {0};
- char buf[PSR_STATUS_MAX_LEN];
drmModeConnector *c;
const char *state;
bool active;
@@ -113,7 +112,7 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o
SET_DEBUGFS_PATH(output, debugfs_file);
ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file,
- buf, sizeof(buf));
+ buf, buf_len);
if (ret < 0) {
igt_info("Could not read i915_edp_psr_status: %s\n",
strerror(-ret));
@@ -137,11 +136,22 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode, igt_output_t *o
*/
bool psr_wait_entry(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
{
- return igt_wait(psr_active_check(debugfs_fd, mode, output), 500, 20);
+ char buf[PSR_STATUS_MAX_LEN];
+ int ret;
+
+ ret = igt_wait(psr_active_check(debugfs_fd, mode, output, buf, sizeof(buf)), 500, 20);
+
+ if (!ret)
+ igt_info("PSR not active within timeout. PSR status at the end of the wait:\n%s", buf);
+
+ return ret;
}
bool psr_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
{
+ char buf[PSR_STATUS_MAX_LEN];
+ int ret;
+
/*
* TODO: After enabling Panel Replay on DP2.1, observe that the SRD status
* remains in the SRDENT_ON state. Remove the polling mechanism for the SRD
@@ -149,13 +159,21 @@ bool psr_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
*/
if (output != NULL &&
output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort)
- return igt_wait(psr_active_check(debugfs_fd, mode, output), 40, 1);
+ ret = igt_wait(psr_active_check(debugfs_fd, mode, output, buf, sizeof(buf)), 40, 1);
else
- return igt_wait(!psr_active_check(debugfs_fd, mode, output), 40, 1);
+ ret = igt_wait(!psr_active_check(debugfs_fd, mode, output, buf, sizeof(buf)), 40, 1);
+
+ if (!ret)
+ igt_info("PSR not inactive for update within timeout. PSR status at the end of the wait:\n %s", buf);
+
+ return ret;
}
bool psr_long_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *output)
{
+ char buf[PSR_STATUS_MAX_LEN];
+ int ret;
+
/*
* TODO: After enabling Panel Replay on DP2.1, observe that the SRD status
* remains in the SRDENT_ON state. Remove the polling mechanism for the SRD
@@ -163,9 +181,14 @@ bool psr_long_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *outp
*/
if (output != NULL &&
output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort)
- return igt_wait(psr_active_check(debugfs_fd, mode, output), 500, 1);
+ ret = igt_wait(psr_active_check(debugfs_fd, mode, output, buf, sizeof(buf)), 500, 1);
else
- return igt_wait(!psr_active_check(debugfs_fd, mode, output), 500, 1);
+ ret = igt_wait(!psr_active_check(debugfs_fd, mode, output, buf, sizeof(buf)), 500, 1);
+
+ if (!ret)
+ igt_info("PSR not inactive for update within timeout. PSR status at the end of the wait:\n %s", buf);
+
+ return ret;
}
static ssize_t psr_write(int debugfs_fd, const char *buf, igt_output_t *output)
--
2.34.1
next reply other threads:[~2024-11-19 12:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 12:33 Jouni Högander [this message]
2024-11-19 23:57 ` ✓ CI.xeBAT: success for lib/igt_psr: Dump out PSR status if waiting PSR entry or update fails Patchwork
2024-11-20 0:10 ` ✓ Fi.CI.BAT: " Patchwork
2024-11-22 17:01 ` ✗ i915.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241119123324.4070696-1-jouni.hogander@intel.com \
--to=jouni.hogander@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox