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

Katarzyna Dec katarzyna.dec at intel.com
Fri Apr 13 10:59:00 UTC 2018


On Tue, Apr 10, 2018 at 07:37:17PM -0700, Dhinakaran Pandiyan wrote:
> Include minor fomatting change too.
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
Reviewed-by: Katarzyna Dec <katarzyna.dec 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
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list