From 1b680def39a50fd5877326a877a21ce1a398453f Mon Sep 17 00:00:00 2001 From: Dhinakaran Pandiyan Date: Wed, 9 May 2018 10:37:37 -0700 Subject: tests/psr: Assert sink CRC length and make use of igt_sysfs_read() Include minor fomatting change too. Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Katarzyna Dec --- tests/kms_psr_sink_crc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests') 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) -- cgit v1.2.3