[PATCH i-g-t 15/16] tests/kms_getfb: use for_each_output()

Jani Nikula
2026-04-14T07:17:39Z

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

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

diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 7ceca73f3997..972a38d7d6e7 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -131,8 +131,9 @@ static bool has_getfb_iface(int fd)
*/
static uint32_t get_any_prop_id(igt_display_t *display)
{
- for (int i = 0; i < display->n_outputs; i++) {
- igt_output_t *output = &display->outputs[i];
+ igt_output_t *output;
+
+ for_each_output(display, output) {
if (output->props[IGT_CONNECTOR_DPMS] != 0)
return output->props[IGT_CONNECTOR_DPMS];
}
--
2.47.3