From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>
Subject: Re: [PATCH i-g-t 2/3] lib/kms: Use for_each_plane_format() for the msm scaler counting
Date: Thu, 16 Apr 2026 18:47:48 +0300 [thread overview]
Message-ID: <bc5ceb33e75b01bb6a560ad097e665d5a68ec2ba@intel.com> (raw)
In-Reply-To: <20260416141334.20086-2-ville.syrjala@linux.intel.com>
On Thu, 16 Apr 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Currently the scaler counting loop iterates over the entire
> format_mod blob format list. That list may contain a lot of duplicate
> formats (one for each modifier supported with that format), so this
> is a bit inefficient. Iterate the plane's format list instead which
> has no duplicates.
>
> Cc: Rob Clark <robdclark@chromium.org>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
I think this is probably fine, but would be nice to get rb from Rob.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> lib/igt_kms.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 2d758b63c043..4cc7c06812c8 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7504,10 +7504,11 @@ int igt_crtc_num_scalers(igt_crtc_t *crtc)
> * as a rough approximation of the # of scalars.. it may
> * undercount on some hw, but it will not overcount
> */
> - for_each_plane_on_crtc(crtc,
> - plane) {
> - for (unsigned i = 0; i < plane->format_mod_count; i++) {
> - if (igt_format_is_yuv(plane->formats[i])) {
> + for_each_plane_on_crtc(crtc, plane) {
> + uint32_t format;
> +
> + for_each_plane_format(plane, format) {
> + if (igt_format_is_yuv(format)) {
> num_scalers++;
> break;
> }
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-04-16 15:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 14:13 [PATCH i-g-t 1/3] lib/kms: Introduce for_each_plane_format() Ville Syrjala
2026-04-16 14:13 ` [PATCH i-g-t 2/3] lib/kms: Use for_each_plane_format() for the msm scaler counting Ville Syrjala
2026-04-16 15:47 ` Jani Nikula [this message]
2026-04-16 14:13 ` [PATCH i-g-t 3/3] tests/kms: Use for_each_plane_format() Ville Syrjala
2026-04-16 15:44 ` Jani Nikula
2026-04-16 15:44 ` [PATCH i-g-t 1/3] lib/kms: Introduce for_each_plane_format() Jani Nikula
2026-04-16 16:07 ` Ville Syrjälä
2026-04-16 22:39 ` ✓ i915.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2026-04-16 22:58 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-17 1:22 ` ✗ Xe.CI.FULL: failure " 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=bc5ceb33e75b01bb6a560ad097e665d5a68ec2ba@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=robdclark@chromium.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