[PATCH i-g-t 13/16] tests/kms_colorop: use for_each_output()

Jani Nikula
2026-04-14T07:16:15Z

Use for_each_output() instead of manually iterating display->outputs[i].

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
tests/kms_colorop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/kms_colorop.c b/tests/kms_colorop.c
index 125afbb0573a..16db0b8ad37f 100644
--- a/tests/kms_colorop.c
+++ b/tests/kms_colorop.c
@@ -129,7 +129,7 @@ static data_t data;

static igt_output_t *kms_writeback_get_output(igt_display_t *display, __u32 fourcc_in, __u32 fourcc_out)
{
- int i;
+ igt_output_t *output;
igt_crtc_t *crtc;

drmModeModeInfo override_mode = {
@@ -149,9 +149,7 @@ static igt_output_t *kms_writeback_get_output(igt_display_t *display, __u32 four
.name = {"640x480-60"},
};

- for (i = 0; i < display->n_outputs; i++) {
- igt_output_t *output = &display->outputs[i];
-
+ for_each_output(display, output) {
if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
continue;

--
2.47.3