[PATCH i-g-t 07/16] tests/amdgpu/amd_abm: use for_each_output()

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

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

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

diff --git a/tests/amdgpu/amd_abm.c b/tests/amdgpu/amd_abm.c
index 1752a7e5c48d..d36044aabfaf 100644
--- a/tests/amdgpu/amd_abm.c
+++ b/tests/amdgpu/amd_abm.c
@@ -112,13 +112,13 @@ static void fbmem_draw_smpte_pattern(uint32_t *fbmem, int width, int height)
static void test_init(data_t *data)
{
igt_display_t *display = &data->display;
- drmModeConnectorPtr conn;
+ igt_output_t *output;
bool has_edp = false;
- int i, fb_id;
+ int fb_id;

/* Skip test if no eDP connected. */
- for (i = 0; i < display->n_outputs; i++) {
- conn = display->outputs[i].config.connector;
+ for_each_output(display, output) {
+ drmModeConnectorPtr conn = output->config.connector;

if (conn->connector_type == DRM_MODE_CONNECTOR_eDP &&
conn->connection == DRM_MODE_CONNECTED) {
--
2.47.3