From: Jani Nikula <jani.nikula@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, igt-dev@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com
Subject: [PATCH i-g-t v2] lib/igt_kms: use for_each_crtc() for iterating CRTCs
Date: Wed, 11 Feb 2026 11:16:35 +0200 [thread overview]
Message-ID: <20260211091635.1075060-1-jani.nikula@intel.com> (raw)
In-Reply-To: <ffbff2701a6e818380ac04b61d455d3a277f9a9f.1770736961.git.jani.nikula@intel.com>
The loop still figures out the pipe mask, keep using pipe here. The main
thing is not using the loop index as pipe, as that is subject to change
in the future.
v2: 1 << pipe (Ville)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
lib/igt_kms.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c4be889dc696..68d61472d9e8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3622,16 +3622,14 @@ igt_output_t **__igt_pipe_populate_outputs(igt_display_t *display, igt_output_t
{
unsigned full_pipe_mask = 0, assigned_pipes = 0;
igt_output_t *output;
+ igt_crtc_t *crtc;
int i, j;
memset(chosen_outputs, 0,
sizeof(*chosen_outputs) * igt_display_n_crtcs(display));
- for (i = 0; i < igt_display_n_crtcs(display); i++) {
- igt_crtc_t *crtc = igt_crtc_for_pipe(display, i);
- if (crtc->valid)
- full_pipe_mask |= (1 << i);
- }
+ for_each_crtc(display, crtc)
+ full_pipe_mask |= 1 << crtc->pipe;
/*
* Try to assign all outputs to the first available CRTC for
--
2.47.3
next prev parent reply other threads:[~2026-02-11 9:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 15:23 [PATCH i-g-t 00/11] igt pipe vs crtc_index cleanups Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 01/11] lib/igt_kms: rename igt_crtc_t crtc_offset member to crtc_index Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 02/11] lib/igt_kms: rename the rest of crtc_offset " Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 03/11] lib/kms: rename struct kmstest_connector_config pipe member " Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 04/11] lib/igt_kms: rename _kmstest_connector_config_find_encoder() pipe parameter " Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 05/11] tests/kms_flip: switch to CRTC index terminology Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 06/11] tests/testdisplay: " Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 07/11] lib/igt_kms: use for_each_crtc() for iterating CRTCs Jani Nikula
2026-02-10 17:39 ` Ville Syrjälä
2026-02-11 9:10 ` Jani Nikula
2026-02-11 9:16 ` Jani Nikula [this message]
2026-02-11 13:32 ` [PATCH i-g-t v2] " Ville Syrjälä
2026-02-10 15:23 ` [PATCH i-g-t 08/11] lib/igt_kms: rename kmstest_get_vblank() param to crtc_index Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 09/11] lib/igt_kms: remove __get_crtc_mask_for_pipe() Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 10/11] lib/igt_kms: pass crtc to igt_crtc_init() Jani Nikula
2026-02-10 15:23 ` [PATCH i-g-t 11/11] lib/igt_kms: use for_each_crtc() for cleaning up CRTCs Jani Nikula
2026-02-10 17:46 ` [PATCH i-g-t 00/11] igt pipe vs crtc_index cleanups Ville Syrjälä
2026-02-12 11:27 ` Jani Nikula
2026-02-10 18:51 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-02-10 18:59 ` ✗ i915.CI.BAT: failure " Patchwork
2026-02-11 0:52 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-11 10:03 ` ✓ Xe.CI.BAT: success for igt pipe vs crtc_index cleanups (rev2) Patchwork
2026-02-11 10:29 ` ✓ i915.CI.BAT: " Patchwork
2026-02-11 11:36 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-11 17:42 ` ✗ i915.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260211091635.1075060-1-jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox