[PATCH i-g-t v4 2/2] tests/kms_async_flips: Use 'IN_FORMATS_ASYNC' property

Santhosh Reddy Guddati santhosh.reddy.guddati at intel.com
Thu Feb 27 04:15:45 UTC 2025


Utilise IN_FORMATS_ASYNC property exposed to get the list of
async supported modifier/format pair and improve the test coverage by
iterating through all the supported modifier format pairs.

V2: Improve run_test_with_modifiers to set data formats based on async
    formats.
    Update make_fb to use data formats instead of hard coded format

V3: Update commit message, remove complicated iterations (Chaitanya)

Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
 tests/kms_async_flips.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 4a72be7b5..692fbb31d 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -126,6 +126,7 @@ typedef struct {
 	bool allow_fail;
 	struct buf_ops *bops;
 	bool atomic_path;
+	unsigned int plane_format;
 } data_t;
 
 static void flip_handler(int fd_, unsigned int sequence, unsigned int tv_sec,
@@ -197,7 +198,7 @@ static void make_fb(data_t *data, struct igt_fb *fb,
 
 	rec_width = width / (NUM_FBS * 2);
 
-	igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
+	igt_create_color_fb(data->drm_fd, width, height, data->plane_format,
 			    data->modifier, 0.0, 0.0, 0.5, fb);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, fb);
@@ -719,16 +720,17 @@ static void run_test_with_modifiers(data_t *data, void (*test)(data_t *))
 	for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
 		test_init(data);
 
-		for (int i = 0; i < data->plane->format_mod_count; i++) {
-			if (data->plane->formats[i] != DRM_FORMAT_XRGB8888)
-				continue;
-
-			data->allow_fail = true;
-			data->modifier = data->plane->modifiers[i];
-
-			igt_dynamic_f("pipe-%s-%s-%s", kmstest_pipe_name(data->pipe),
-				      data->output->name,
-				      igt_fb_modifier_name(data->modifier)) {
+		for (int i = 0; i < data->plane->async_format_mod_count; i++) {
+			data->modifier = data->plane->format_mod_pair[i].modifier;
+			for (int j = 0; j < data->plane->format_mod_pair[i].list.count; j++) {
+				data->plane_format =
+					data->plane->format_mod_pair[i].list.formats[j];
+
+				data->allow_fail = true;
+				igt_dynamic_f("pipe-%s-%s-%s-%s", kmstest_pipe_name(data->pipe),
+					       data->output->name,
+					       igt_fb_modifier_name(data->modifier),
+					       igt_format_str(data->plane_format)) {
 				      /*
 				       * FIXME: joiner+async flip is busted currently in KMD.
 				       * Remove this check once the issues are fixed in KMD.
@@ -739,6 +741,7 @@ static void run_test_with_modifiers(data_t *data, void (*test)(data_t *))
 						    "on joiner mode\n");
 				      test_init_fbs(data);
 				      test(data);
+				}
 			}
 		}
 	}
@@ -761,6 +764,7 @@ igt_main
 
 		if (is_intel_device(data.drm_fd))
 			data.bops = buf_ops_create(data.drm_fd);
+		data.plane_format = DRM_FORMAT_XRGB8888;
 	}
 
 	igt_describe("Verify the async flip functionality and the fps during async flips");
-- 
2.34.1



More information about the igt-dev mailing list