igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
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 02/10] lib/kms: Introduce igt_display_n_crtcs()
Date: Wed, 10 Dec 2025 16:21:43 +0200	[thread overview]
Message-ID: <5aade365e60cac8ccb65c84c466e85f11d4fe29b@intel.com> (raw)
In-Reply-To: <20251210093903.15934-3-ville.syrjala@linux.intel.com>

On Wed, 10 Dec 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Introduce igt_display_n_crtcs() as the new name for
> igt_display_get_n_pipes(). The old name will get eliminated
> later using cocci, but it's easier to introduce duplicate
> names first because this needs to be used in a few messy macros
> that cocci doesn't like.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  lib/igt_kms.c | 13 ++++++++++++-
>  lib/igt_kms.h |  7 ++++---
>  2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 2d7da376bc0b..5b8598305f8c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -3271,6 +3271,17 @@ out:
>  	}
>  }
>  
> +/**
> + * igt_display_n_crtcs:
> + * @display: A pointer to an #igt_display_t structure
> + *
> + * Returns: Total number of CRTCs for the given @display
> + */
> +int igt_display_n_crtcs(igt_display_t *display)
> +{
> +	return display->n_pipes;
> +}
> +
>  /**
>   * igt_display_get_n_pipes:
>   * @display: A pointer to an #igt_display_t structure
> @@ -3279,7 +3290,7 @@ out:
>   */
>  int igt_display_get_n_pipes(igt_display_t *display)
>  {
> -	return display->n_pipes;
> +	return igt_display_n_crtcs(display);
>  }
>  
>  /**
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 065cbeca09a8..4171e2baef61 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -577,6 +577,7 @@ int  igt_display_drop_events(igt_display_t *display);
>  int  igt_display_get_n_pipes(igt_display_t *display);
>  void igt_display_require_output(igt_display_t *display);
>  void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe);
> +int igt_display_n_crtcs(igt_display_t *display);
>  
>  const char *igt_output_name(igt_output_t *output);
>  drmModeModeInfo *igt_output_get_mode(igt_output_t *output);
> @@ -743,7 +744,7 @@ static inline bool igt_output_is_connected(igt_output_t *output)
>   */
>  #define for_each_pipe_with_valid_output(display, pipe, output) \
>  	for (int con__ = (pipe) = 0; \
> -	     assert(igt_can_fail()), (pipe) < igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
> +	     assert(igt_can_fail()), (pipe) < igt_display_n_crtcs(display) && con__ < (display)->n_outputs; \
>  	     con__ = (con__ + 1 < (display)->n_outputs) ? con__ + 1 : (pipe = pipe + 1, 0)) \
>  		 for_each_if((display)->pipes[pipe].valid) \
>  			for_each_if ((((output) = &(display)->outputs[con__]), \
> @@ -763,9 +764,9 @@ igt_output_t **__igt_pipe_populate_outputs(igt_display_t *display,
>   * be called at most once for each pipe.
>   */
>  #define for_each_pipe_with_single_output(display, pipe, output) \
> -	for (igt_output_t *__outputs[(display)->n_pipes], \
> +	for (igt_output_t *__outputs[igt_display_n_crtcs(display)], \
>  	     **__output = __igt_pipe_populate_outputs((display), __outputs); \
> -		 __output < &__outputs[(display)->n_pipes]; __output++) \
> +		 __output < &__outputs[igt_display_n_crtcs(display)]; __output++) \
>  		for_each_if (*__output && \
>  			     ((pipe) = (__output - __outputs), (output) = *__output, 1))

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-12-10 14:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  9:38 [PATCH i-g-t 00/10] lib/kms: Move towards using 'crtcs' instead of 'pipes' Ville Syrjala
2025-12-10  9:38 ` [PATCH i-g-t 01/10] tests/intel/kms_dp_linktrain_fallback: Reduce side effects in igt_output_set_pipe() args Ville Syrjala
2025-12-10 14:21   ` Jani Nikula
2025-12-10  9:38 ` [PATCH i-g-t 02/10] lib/kms: Introduce igt_display_n_crtcs() Ville Syrjala
2025-12-10 14:21   ` Jani Nikula [this message]
2025-12-10  9:38 ` [PATCH i-g-t 03/10] lib/kms: Use igt_display_n_crtcs() everywhere Ville Syrjala
2025-12-10 14:22   ` Jani Nikula
2025-12-10  9:38 ` [PATCH i-g-t 04/10] lib/kms: Introduce igt_crtc_for_pipe() Ville Syrjala
2025-12-10 14:23   ` Jani Nikula
2025-12-10 17:16   ` [PATCH i-g-t v2 " Ville Syrjala
2025-12-10  9:38 ` [PATCH i-g-t 05/10] lib/kms: Use igt_crtc_for_pipe() everywhere Ville Syrjala
2025-12-10 14:25   ` Jani Nikula
2025-12-12 15:32     ` Ville Syrjälä
2025-12-10  9:38 ` [PATCH i-g-t 06/10] lib/kms: Remove tall tales about 'pipe' in DRM_IOCTL_WAIT_VBLANK Ville Syrjala
2025-12-10 14:25   ` Jani Nikula
2025-12-10  9:39 ` [PATCH i-g-t 07/10] lib/kms: Pass the entire igt_pipe_t to igt_wait_for_vblank*() Ville Syrjala
2025-12-10 14:29   ` Jani Nikula
2025-12-10  9:39 ` [PATCH i-g-t 08/10] lib/kms: Introduce igt_output_set_crtc() Ville Syrjala
2025-12-10 14:34   ` Jani Nikula
2025-12-10 14:36     ` Jani Nikula
2025-12-10 14:38       ` Jani Nikula
2025-12-10 14:44         ` Jani Nikula
2025-12-10 14:48         ` Ville Syrjälä
2025-12-10  9:39 ` [PATCH i-g-t 09/10] lib/kms: Replace igt_output_set_pipe() with igt_output_set_crtc() Ville Syrjala
2025-12-10 14:42   ` Jani Nikula
2025-12-10  9:39 ` [PATCH i-g-t 10/10] lib/kms: Rename igt_pipe_t to igt_crtc_t Ville Syrjala
2025-12-10 14:43   ` Jani Nikula
2025-12-10 13:34 ` ✓ Xe.CI.BAT: success for lib/kms: Move towards using 'crtcs' instead of 'pipes' Patchwork
2025-12-10 14:12 ` ✗ i915.CI.BAT: failure " Patchwork
2025-12-10 19:49 ` ✗ Xe.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=5aade365e60cac8ccb65c84c466e85f11d4fe29b@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;
as well as URLs for NNTP newsgroup(s).