[igt-dev] [PATCH i-g-t] tests/kms_plane_alpha_blend: stop crc generation before asserting

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Jan 10 17:01:32 UTC 2023


Stop crc generation on basic alpha test before asserting to avoid messages
about crc buffer overflow.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 tests/kms_plane_alpha_blend.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index ccf1d6579..38272ccb3 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -263,19 +263,23 @@ static void basic_alpha(data_t *data, enum pipe pipe, igt_plane_t *plane)
 		igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, i | (i << 8));
 		igt_display_commit2(display, COMMIT_ATOMIC);
 
 		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc);
-		igt_assert_crc_equal(&ref_crc, &crc);
+		if (!igt_check_crc_equal(&ref_crc, &crc) && !igt_skip_crc_compare) {
+			igt_pipe_crc_stop(data->pipe_crc);
+
+			igt_assert_f(false, "crc mismatch with plane alpha value %d\n",
+				     i | (i << 8));
+		}
 	}
 
 	/* And test alpha = 0, should give same CRC, but doesn't on some i915 platforms. */
 	igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0);
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc);
-	igt_assert_crc_equal(&ref_crc, &crc);
-
 	igt_pipe_crc_stop(data->pipe_crc);
+	igt_assert_crc_equal(&ref_crc, &crc);
 }
 
 static void argb_opaque(data_t *data, enum pipe pipe, igt_plane_t *plane)
 {
-- 
2.39.0



More information about the igt-dev mailing list