[PATCH i-g-t] tests/kms_plane: Fix crash on fail and print out tested formats

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon May 5 10:45:37 UTC 2025


Pixel format tests would crash out on failure, let's fix that.

Earlier tested pixel formats were moved from igt_info to igt_debug, let's put
igt_info back in place so it's easier for debug time to see what's going on.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 tests/kms_plane.c | 52 ++++++++++++++++++++++-------------------------
 1 file changed, 24 insertions(+), 28 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index d08ec81e4..f7b672c7a 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -887,9 +887,9 @@ static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
 				  igt_crc_t ref_crc[],
 				  struct igt_fb *fb)
 {
-	igt_debug("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT " on %s.%u\n",
-		  IGT_FORMAT_ARGS(format), IGT_MODIFIER_ARGS(modifier),
-		  kmstest_pipe_name(pipe), plane->index);
+	igt_info("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT " on %s.%u\n",
+		 IGT_FORMAT_ARGS(format), IGT_MODIFIER_ARGS(modifier),
+		 kmstest_pipe_name(pipe), plane->index);
 
 	return test_format_plane_colors(data, pipe, plane,
 					format, modifier,
@@ -925,13 +925,13 @@ static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
 						     igt_color_range_to_str(r)))
 				continue;
 
-			igt_debug("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT
-				" (%s, %s) on %s.%u\n", IGT_FORMAT_ARGS(format),
-				IGT_MODIFIER_ARGS(modifier),
-				igt_color_encoding_to_str(e),
-				igt_color_range_to_str(r),
-				kmstest_pipe_name(pipe),
-				plane->index);
+			igt_info("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT
+				 " (%s, %s) on %s.%u\n", IGT_FORMAT_ARGS(format),
+				 IGT_MODIFIER_ARGS(modifier),
+				 igt_color_encoding_to_str(e),
+				 igt_color_range_to_str(r),
+				 kmstest_pipe_name(pipe),
+				 plane->index);
 
 			result &= test_format_plane_colors(data, pipe, plane,
 							   format, modifier,
@@ -1029,7 +1029,7 @@ static bool skip_format_mod(data_t *data,
 	return false;
 }
 
-static bool test_format_plane(data_t *data, enum pipe pipe,
+static void test_format_plane(data_t *data, enum pipe pipe,
 			      igt_output_t *output, igt_plane_t *plane, igt_fb_t *primary_fb)
 {
 	struct igt_fb fb = {};
@@ -1046,7 +1046,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 	 * No clamping test for cursor plane
 	 */
 	if (data->crop != 0 && plane->type == DRM_PLANE_TYPE_CURSOR)
-		return true;
+		return;
 
 	igt_vec_init(&tested_formats, sizeof(struct format_mod));
 
@@ -1059,7 +1059,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 	} else {
 		if (!plane->drm_plane) {
 			igt_debug("Only legacy cursor ioctl supported, skipping cursor plane\n");
-			return true;
+			return;
 		}
 		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_WIDTH, &width));
 		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height));
@@ -1073,9 +1073,9 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 
 	igt_pipe_crc_start(data->pipe_crc);
 
-	igt_debug("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT " on %s.%u\n",
-		  IGT_FORMAT_ARGS(ref.format), IGT_MODIFIER_ARGS(ref.modifier),
-		  kmstest_pipe_name(pipe), plane->index);
+	igt_info("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT " on %s.%u\n",
+		 IGT_FORMAT_ARGS(ref.format), IGT_MODIFIER_ARGS(ref.modifier),
+		 kmstest_pipe_name(pipe), plane->index);
 
 	check_allowed_plane_size_64x64(data, plane, &width, &height, ref.format);
 
@@ -1107,12 +1107,12 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 			continue;
 
 		if (skip_format_mod(data, f.format, f.modifier, &tested_formats)) {
-			igt_debug("Skipping format " IGT_FORMAT_FMT " / modifier "
-				  IGT_MODIFIER_FMT " on %s.%u\n",
-				  IGT_FORMAT_ARGS(f.format),
-				  IGT_MODIFIER_ARGS(f.modifier),
-				  kmstest_pipe_name(pipe),
-				  plane->index);
+			igt_info("Skipping format " IGT_FORMAT_FMT " / modifier "
+				 IGT_MODIFIER_FMT " on %s.%u\n",
+				 IGT_FORMAT_ARGS(f.format),
+				 IGT_MODIFIER_ARGS(f.modifier),
+				 kmstest_pipe_name(pipe),
+				 plane->index);
 			continue;
 		}
 
@@ -1149,7 +1149,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 
 	igt_vec_fini(&tested_formats);
 
-	return result;
+	igt_assert_f(result, "At least one CRC mismatch happened\n");
 }
 
 static bool skip_plane(data_t *data, igt_plane_t *plane)
@@ -1195,7 +1195,6 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 	struct igt_fb primary_fb;
 	igt_plane_t *primary;
 	drmModeModeInfo *mode;
-	bool result;
 	igt_output_t *output = data->output;
 	igt_plane_t *plane;
 
@@ -1225,12 +1224,11 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 
 	set_legacy_lut(data, pipe, LUT_MASK);
 
-	result = true;
 	for_each_plane_on_pipe(&data->display, pipe, plane) {
 		if (skip_plane(data, plane))
 			continue;
 		igt_dynamic_f("pipe-%s-plane-%u", kmstest_pipe_name(pipe), plane->index)
-			result &= test_format_plane(data, pipe, output, plane, &primary_fb);
+			test_format_plane(data, pipe, output, plane, &primary_fb);
 	}
 
 	test_fini(data);
@@ -1242,8 +1240,6 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
 	igt_remove_fb(data->drm_fd, &primary_fb);
-
-	igt_assert_f(result, "At least one CRC mismatch happened\n");
 }
 
 static void test_planar_settings(data_t *data)
-- 
2.45.2



More information about the igt-dev mailing list