[igt-dev] [PATCH i-g-t v2 03/12] chamelium: Debug-print CRCs when comparing them and dumping frames

Paul Kocialkowski
2018-12-13T15:55:54Z

Add debug prints for the reference and captured CRCs when comparing them
and dumping them, which can be useful to get an idea of what is going on
(e.g. specific noise on display cables often only changes one of the
values that compose the CRC).

It's also useful to associate a test debug output with the dumped
pictures (that have the CRC in their name).

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
lib/igt_chamelium.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index d136fb04c342..32b859eac4a7 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -1033,6 +1033,9 @@ void chamelium_assert_crc_eq_or_dump(struct chamelium *chamelium,
char *capture_suffix;
bool eq;

+ igt_debug("Reference CRC: %s\n", igt_crc_to_string(reference_crc));
+ igt_debug("Captured CRC: %s\n", igt_crc_to_string(capture_crc));
+
eq = igt_check_crc_equal(reference_crc, capture_crc);
if (!eq && igt_frame_dump_is_enabled()) {
/* Grab the reference frame from framebuffer */
@@ -1101,6 +1104,10 @@ void chamelium_assert_analog_frame_match_or_dump(struct chamelium *chamelium,
capture_crc = chamelium_get_crc_for_area(chamelium, port, 0, 0,
0, 0);

+ igt_debug("Reference CRC: %s\n",
+ igt_crc_to_string(reference_crc));
+ igt_debug("Captured CRC: %s\n", igt_crc_to_string(capture_crc));
+
reference_suffix = igt_crc_to_string_extended(reference_crc,
'-', 2);
capture_suffix = igt_crc_to_string_extended(capture_crc, '-',