[igt-dev] [PATCH i-g-t] tests/kms_psr2_su: Print errno while it fails to read debugfs

Gwan-gyeong Mun gwan-gyeong.mun at intel.com
Thu Jun 11 13:52:38 UTC 2020


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 at intel.com>
Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
---
 lib/igt_psr.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 8c2f4ce6..899784dc 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);
 }
-- 
2.25.0



More information about the igt-dev mailing list