[igt-dev] [PATCH i-g-t 05/20] tests/psr: Assert sink CRC length and make use of igt_sysfs_read()

Dhinakaran Pandiyan dhinakaran.pandiyan at intel.com
Wed Apr 11 02:37:17 UTC 2018


Include minor fomatting change too.
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
---
 tests/kms_psr_sink_crc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 35c7b845..af63e689 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -230,14 +230,13 @@ static void get_sink_crc(data_t *data, char *crc)
 	if (igt_interactive_debug)
 		return;
 
-	igt_require_f(igt_sysfs_scanf(data->debugfs_fd, "i915_sink_crc_eDP1",
-				      "%s\n", crc),
+	igt_require_f(igt_sysfs_read(data->debugfs_fd, "i915_sink_crc_eDP1",
+				     crc, CRC_LEN) == CRC_LEN,
 		      "Sink CRC is unreliable on this machine. Try manual debug with --interactive-debug=no-crc\n");
-
-	igt_debug("%s\n", crc);
+	igt_debug("sink CRC: %.*s\n", CRC_LEN, crc);
 
 	/* Black screen is always invalid */
-	igt_assert(strncmp(crc, CRC_BLACK, CRC_LEN) != 0);
+	igt_assert(strncmp(crc, CRC_BLACK, CRC_LEN));
 }
 
 static bool is_green(char *crc)
-- 
2.14.1



More information about the igt-dev mailing list