[PATCH i-g-t 02/21] tests/kms_concurrent: Actually run the test over all connected crtcs

Ville Syrjala
2026-02-20T14:02:08Z

Currently kms_concurrent uses for_each_valid_output_on_pipe() with an
uninitialized pipe (meaning it probably contains stack garbage). The
actual intention seems to have been to use
for_each_pipe_with_valid_output(). It's even mentioned in the offending
commit message, but the actual code was never changed to match.

We no longer have for_each_pipe_with_valid_output() so we have to switch
over to for_each_crtc_with_valid_output(), which also means we end up
doing the pipe->crtc conversion in one go.

#include "scripts/iterators.cocci"

@@
iterator name for_each_valid_output_on_pipe;
iterator name for_each_crtc_with_valid_output;
expression DISPLAY, OUTPUT;
identifier PIPE;
type T;
@@
- T PIPE;
+ igt_crtc_t *crtc;
<+... when != PIPE = ...
- for_each_valid_output_on_pipe(DISPLAY, PIPE, OUTPUT)
+ for_each_crtc_with_valid_output(DISPLAY, crtc, OUTPUT)
{
<...
(
- igt_crtc_for_pipe(..., PIPE)
+ crtc
|
- kmstest_pipe_name(PIPE)
+ igt_crtc_name(crtc)
|
- PIPE
+ crtc->pipe
)
...>
}
...+>

@@
identifier DISPLAY;
@@
- igt_display_t *DISPLAY = ...;
... when != DISPLAY

Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Fixes: 6958319123d9 ("tests/kms_concurrent: remove pipe dependency in subtest name")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/kms_concurrent.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index bbc988aa2000..f31992a514a0 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -344,24 +344,24 @@ run_test(data_t *data, enum pipe pipe, igt_output_t *output)
static void
run_tests_for_pipe(data_t *data)
{
- igt_display_t *display = &data->display;
igt_output_t *output;
- enum pipe pipe;
+ igt_crtc_t *crtc;

igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
"resolution.");
igt_subtest_with_dynamic("multi-plane-atomic-lowres") {
- for_each_valid_output_on_pipe(&data->display, pipe, output) {
+ for_each_crtc_with_valid_output(&data->display, crtc, output) {
igt_display_reset(&data->display);

igt_output_set_crtc(output,
- igt_crtc_for_pipe(display, pipe));
+ crtc);
if (!intel_pipe_output_combo_valid(&data->display))
continue;

- igt_require(igt_crtc_for_pipe(display, pipe)->n_planes > 0);
- igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
- run_test(data, pipe, output);
+ igt_require(crtc->n_planes > 0);
+ igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc),
+ igt_output_name(output))
+ run_test(data, crtc->pipe, output);
}
}
}
--
2.52.0