summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGwan-gyeong Mun <gwan-gyeong.mun@intel.com>2020-06-11 16:52:38 +0300
committerPetri Latvala <petri.latvala@intel.com>2020-06-12 10:46:22 +0300
commit08fdc87d48dba48fb82f9978e142d57b013ff29f (patch)
tree7dd5ff715cea3fab05ad83ec2b0ac8845f91d701 /lib
parent4e51438ba55854e8584e2aaaa5ba6c6024206a08 (diff)
tests/kms_psr2_su: Print errno while it fails to read debugfs
This tests is being sporadically skipped in CI as it is not due "PSR sink not reliable: yes". This commit adds printing of debugfs ("tests/kms_psr2_su: Print debugfs when skipping test"), but it is not enough to track error cases. It adds printing of errorno while it fails to read debugfs. Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_psr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 8c2f4ce6c..899784dc5 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -40,9 +40,15 @@ static bool psr_active_check(int debugfs_fd, enum psr_mode mode)
{
char buf[PSR_STATUS_MAX_LEN];
const char *state = mode == PSR_MODE_1 ? "SRDENT" : "DEEP_SLEEP";
+ int ret;
- igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
- sizeof(buf));
+ ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status",
+ buf, sizeof(buf));
+ if (ret < 0) {
+ igt_debug("Could not read i915_edp_psr_status: %s\n",
+ strerror(-ret));
+ return false;
+ }
igt_skip_on(strstr(buf, "PSR sink not reliable: yes"));
@@ -237,8 +243,11 @@ void psr_print_debugfs(int debugfs_fd)
ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
sizeof(buf));
- if (ret < 0)
+ if (ret < 0) {
+ igt_debug("Could not read i915_edp_psr_status: %s\n",
+ strerror(-ret));
return;
+ }
igt_debug("%s", buf);
}