[Intel-gfx] [PATCH IGT 08/11] lib: Add igt_psr_print_status() and change tests to use it.

Jim Bride jim.bride at linux.intel.com
Tue Jul 11 22:48:33 UTC 2017


Signed-off-by: Jim Bride <jim.bride at linux.intel.com>
---
 lib/igt_psr.c                    | 13 +++++++++++++
 lib/igt_psr.h                    |  1 +
 tests/kms_frontbuffer_tracking.c |  5 +----
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index d27c32a..8dda659 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -114,3 +114,16 @@ bool igt_psr_await_status(int fd, bool active)
 {
 	return igt_wait(igt_psr_active(fd) == active, 5000, 1);
 }
+
+/**
+ * igt_psr_print_status:
+ *
+ * Dumps the contents of i915_edp_psr_status from debugfs.
+ */
+void igt_psr_print_status(int fd)
+{
+        char buf[BUFSIZE];
+
+        igt_debugfs_read(fd, "i915_edp_psr_status", buf);
+        igt_info("PSR status:\n%s\n", buf);
+}
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index 3c355e0..d6db297 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -32,5 +32,6 @@ bool igt_psr_sink_support(int fd);
 bool igt_psr_possible(int fd);
 bool igt_psr_active(int fd);
 bool igt_psr_await_status(int fd, bool active);
+void igt_psr_print_status(int fd);
 
 #endif /* IGT_PSR_H */
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 4d20899..ee611b9 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -800,10 +800,7 @@ static void fbc_print_status(void)
 
 static void psr_print_status(void)
 {
-	char buf[256];
-
-	debugfs_read("i915_edp_psr_status", buf);
-	igt_info("PSR status:\n%s\n", buf);
+	igt_psr_print_status(drm.fd);
 }
 
 static struct timespec fbc_get_last_action(void)
-- 
2.7.4



More information about the Intel-gfx mailing list