[PATCH i-g-t v4 14/17] tests/intel/kms_ccs: split outer test loop into two
From: Michał Grzelak <hidden>
Date: 2026-09-10 19:10:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
for_each_crtc_with_valid_output() iterates over every crtc with connected output. Split it into two loops. This is needed to handle per output and per crtc cases. Signed-off-by: Michał Grzelak <redacted> --- tests/intel/kms_ccs.c | 74 +++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 35 deletions(-)
diff --git a/tests/intel/kms_ccs.c b/tests/intel/kms_ccs.c
index 4d0bda6a78..9ac0ac8e2b 100644
--- a/tests/intel/kms_ccs.c
+++ b/tests/intel/kms_ccs.c@@ -1152,47 +1152,51 @@ static void test_output(data_t *data, const int testnum) "Older than Xe2 platform needed.\n"); } - for_each_crtc_with_valid_output(&data->display, crtc, - data->output) { - data->crtc = crtc; - igt_display_reset(&data->display); - - igt_output_set_crtc(data->output, - crtc); - if (!intel_pipe_output_combo_valid(&data->display)) - continue; - - igt_dynamic_f("pipe-%s-%s", - igt_crtc_name(crtc), - data->output->name) { - int valid_tests = 0; - - if (data->flags == TEST_RANDOM) - igt_info("Testing with seed %d\n", data->seed); - - if (data->flags & TEST_ALL_PLANES) { - igt_display_require_output_on_crtc(crtc); - - for_each_plane_on_crtc(crtc, - data->plane) { - if (skip_plane(data, data->plane)) - continue; - + for_each_connected_output(&data->display, data->output) { + for_each_crtc(&data->display, crtc) { + if (!igt_crtc_connector_valid(crtc, data->output)) + continue; + + data->crtc = crtc; + igt_display_reset(&data->display); + + igt_output_set_crtc(data->output, + crtc); + if (!intel_pipe_output_combo_valid(&data->display)) + continue; + + igt_dynamic_f("pipe-%s-%s", + igt_crtc_name(crtc), + data->output->name) { + int valid_tests = 0; + + if (data->flags == TEST_RANDOM) + igt_info("Testing with seed %d\n", data->seed); + + if (data->flags & TEST_ALL_PLANES) { + igt_display_require_output_on_crtc(crtc); + + for_each_plane_on_crtc(crtc, + data->plane) { + if (skip_plane(data, data->plane)) + continue; + + for (int j = 0; j < ARRAY_SIZE(formats); j++) { + data->format = formats[j]; + valid_tests += test_ccs(data); + } + } + } else { for (int j = 0; j < ARRAY_SIZE(formats); j++) { data->format = formats[j]; valid_tests += test_ccs(data); } } - } else { - for (int j = 0; j < ARRAY_SIZE(formats); j++) { - data->format = formats[j]; - valid_tests += test_ccs(data); - } + igt_require_f(valid_tests > 0, + "no valid tests for %s on pipe %s\n", + ccs_modifiers[i].str, + igt_crtc_name(crtc)); } - igt_require_f(valid_tests > 0, - "no valid tests for %s on pipe %s\n", - ccs_modifiers[i].str, - igt_crtc_name(crtc)); } } }
--
2.45.2