[PATCH i-g-t v8 3/4] tests/kms_async_flips: Add test for all async format modifiers
Santhosh Reddy Guddati
santhosh.reddy.guddati at intel.com
Wed Mar 26 10:27:57 UTC 2025
Add a new subtest to iterate through all the supported async format
modifier pair and perform async flips.
V2: Add a check to avoid sync flip on all supported modifiers
subtest(Chaitanya).
Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
tests/kms_async_flips.c | 97 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 96 insertions(+), 1 deletion(-)
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 369318368..fe3e4f491 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -336,6 +336,15 @@ static void test_async_flip(data_t *data)
}
}
+ if (data->async_mod_formats) {
+ if (async_flip_needs_extra_frame(data)) {
+ ret = perform_flip(data, frame, flags);
+ igt_assert_eq(ret, 0);
+
+ wait_flip_event(data);
+ }
+ }
+
ret = perform_flip(data, frame, flags);
if (frame == 1 && data->allow_fail)
@@ -360,7 +369,7 @@ static void test_async_flip(data_t *data)
igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
}
- /* Reduce test execution for all formats and modifiers. One flip should suffice */
+ /* Reduce test execution for all formats and modifiers.*/
if (data->async_mod_formats) {
igt_assert_f(ret == 0, "Async flip failed with %s modifier and %s format",
igt_fb_modifier_name(data->modifier),
@@ -730,6 +739,87 @@ static void run_test(data_t *data, void (*test)(data_t *))
}
}
+static bool skip_async_format_mod(data_t *data,
+ uint32_t format, uint64_t modifier,
+ struct igt_vec *tested_formats)
+{
+ /* igt doesn't know how to sw generate UBWC: */
+ if (is_msm_device(data->drm_fd) &&
+ modifier == DRM_FORMAT_MOD_QCOM_COMPRESSED)
+ return true;
+
+ /* VEBOX just hangs with an actual 10bpc format */
+ if (igt_fb_is_gen12_mc_ccs_modifier(modifier) &&
+ igt_reduce_format(format) == DRM_FORMAT_XRGB2101010)
+ return true;
+
+ /* test each format "class" only once in non-extended tests */
+ struct format_mod rf = {
+ .format = igt_reduce_format(format),
+ .modifier = modifier,
+ };
+
+ if (igt_vec_index(tested_formats, &rf) >= 0)
+ return true;
+
+ igt_vec_push(tested_formats, &rf);
+
+ return false;
+}
+
+static void run_test_with_async_format_modifiers(data_t *data, void (*test)(data_t *))
+{
+ struct igt_vec tested_formats;
+
+ igt_vec_init(&tested_formats, sizeof(struct format_mod));
+
+ for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
+ test_init(data);
+
+ igt_assert_f(data->plane->async_format_mod_count > 0,
+ "No async format/modifier supported\n");
+
+ for (int i = 0; i < data->plane->async_format_mod_count; i++) {
+ struct format_mod f = {
+ .format = data->plane->async_formats[i],
+ .modifier = data->plane->async_modifiers[i],
+ };
+
+ if (skip_async_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(data->pipe),
+ data->plane->index);
+ continue;
+ }
+
+ data->modifier = f.modifier;
+ data->plane_format = f.format;
+ data->async_mod_formats = 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.
+ */
+ igt_skip_on_f(is_joiner_mode(data->drm_fd,
+ data->output),
+ "Skipping, async flip not supported "
+ "on joiner mode\n");
+ test_init_fbs(data);
+ test(data);
+ }
+ }
+ }
+
+ igt_vec_fini(&tested_formats);
+}
+
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) {
@@ -919,6 +1009,11 @@ igt_main
run_test(&data, test_async_flip);
}
+ igt_describe("Verify async flip with all supported modifier and format combinations");
+ igt_subtest_with_dynamic("async-flip-with-all-modifiers-formats") {
+ run_test_with_async_format_modifiers(&data, test_async_flip);
+ }
+
igt_fixture {
for (i = 0; i < NUM_FBS; i++)
igt_remove_fb(data.drm_fd, &data.bufs[i]);
--
2.34.1
More information about the igt-dev
mailing list