From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 01/17] lib/kms: Replace igt_pipe_has_valid_output() with igt_crtc_has_valid_output()
Date: Fri, 27 Feb 2026 12:42:12 +0200 [thread overview]
Message-ID: <851a2c31afaa11bf42aee53f50f6ef9d2805605e@intel.com> (raw)
In-Reply-To: <20260227080653.30389-2-ville.syrjala@linux.intel.com>
On Fri, 27 Feb 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Rename igt_pipe_has_valid_output() into igt_crtc_has_valid_output()
> and pass in the full igt_crtc_t*.
>
> And since we already have the crtc the igt_require_pipe() call
> no longer makes any sense. Move that into the one caller
> (igt_display_require_output_on_pipe()) where it might matter.
It's subtle and a bit bonkers, actually. igt_require_pipe() checks for
the crtc being valid. Which it is if it originates from
for_each_crtc(). If pipe is PIPE_NONE, it's a NULL dereference, so we
can assume that doesn't happen. But the crtc may also originate from
igt_crtc_for_pipe(), which does *not* have the crtc validity check.
This patch seems okay, though.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_kms.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 6087de365a82..7454d16780f9 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2821,15 +2821,12 @@ static void igt_require_pipe(igt_display_t *display, enum pipe pipe)
> kmstest_pipe_name(pipe));
> }
>
> -static bool igt_pipe_has_valid_output(igt_display_t *display, enum pipe pipe)
> +static bool igt_crtc_has_valid_output(igt_crtc_t *crtc)
> {
> + igt_display_t *display = crtc->display;
> igt_output_t *output;
>
> - igt_require_pipe(display, pipe);
> -
> - for_each_valid_output_on_crtc(display,
> - igt_crtc_for_pipe(display, pipe),
> - output)
> + for_each_valid_output_on_crtc(display, crtc, output)
> return true;
>
> return false;
> @@ -2949,7 +2946,7 @@ void igt_display_reset_outputs(igt_display_t *display)
> for_each_crtc(display, crtc) {
> igt_output_t *output;
>
> - if (!igt_pipe_has_valid_output(display, crtc->pipe))
> + if (!igt_crtc_has_valid_output(crtc))
> continue;
>
> output = igt_get_single_output_for_pipe(display, crtc->pipe);
> @@ -3266,7 +3263,9 @@ void igt_display_require_output(igt_display_t *display)
> */
> void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe)
> {
> - if (!igt_pipe_has_valid_output(display, pipe))
> + igt_require_pipe(display, pipe);
> +
> + if (!igt_crtc_has_valid_output(igt_crtc_for_pipe(display, pipe)))
> igt_skip("No valid connector found on pipe %s\n", kmstest_pipe_name(pipe));
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-02-27 10:42 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 8:06 [PATCH i-g-t 00/17] lib/kms: Finish the igt_crtc_t API refactoring Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 01/17] lib/kms: Replace igt_pipe_has_valid_output() with igt_crtc_has_valid_output() Ville Syrjala
2026-02-27 10:42 ` Jani Nikula [this message]
2026-02-27 8:06 ` [PATCH i-g-t 02/17] lib/kms: Replace igt_display_require_output_on_pipe() with igt_display_require_output_on_crtc() Ville Syrjala
2026-02-27 10:50 ` Jani Nikula
2026-02-27 8:06 ` [PATCH i-g-t 03/17] lib/kms: Replace igt_get_single_output_for_pipe() with igt_get_single_output_for_crtc() Ville Syrjala
2026-02-27 10:22 ` Jani Nikula
2026-02-27 8:06 ` [PATCH i-g-t 04/17] lib/kms: Make the igt_*_bpc_*() interfaces more abstract Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 05/17] tests/kms: Use igt_crtc_name() Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 06/17] tests/kms: Clean up crtc->pipe comparions Ville Syrjala
2026-02-27 10:51 ` Jani Nikula
2026-02-27 8:06 ` [PATCH i-g-t 07/17] tests/vmwgfx/vmw_prime: Replace igt_pipe_crc_new() with igt_crtc_crc_new() Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 08/17] lib/kms: Prefer "crtc" over "pipe" in function names Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 09/17] tests/kms_color*: " Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 10/17] tests/kms: " Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 11/17] tests/kms_tiled_display: Remove mention of PIPE_NONE Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 12/17] tests/kms: Remove hand rolled get_vblank() stuff Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 13/17] lib/kms: Fix kmstest_get_vblank() docs Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 14/17] tests/kms: Pass crtc_index to kmstest_get_vbl_flag() Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 15/17] tests/kms: Pass crtc_index to kmstest_get_vblank() Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 16/17] lib/kms: Introduce igt_crtc_get_vbl_flag() Ville Syrjala
2026-02-27 8:06 ` [PATCH i-g-t 17/17] lib/kms: Introduce igt_crtc_get_vblank() Ville Syrjala
2026-02-27 10:55 ` [PATCH i-g-t 00/17] lib/kms: Finish the igt_crtc_t API refactoring Jani Nikula
2026-02-27 14:14 ` ✗ i915.CI.BAT: failure for " Patchwork
2026-02-27 14:24 ` ✓ Xe.CI.BAT: success " Patchwork
2026-02-27 23:28 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-04 5:58 ` ✓ Xe.CI.BAT: success for lib/kms: Finish the igt_crtc_t API refactoring (rev2) Patchwork
2026-03-04 6:19 ` ✓ i915.CI.BAT: " Patchwork
2026-03-05 5:01 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-05 8:15 ` ✗ 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=851a2c31afaa11bf42aee53f50f6ef9d2805605e@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