From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 01/14] drm/i915: Drop the cached per-pipe min_cdclk[] from bw state
Date: Thu, 27 Mar 2025 09:56:41 +0200 [thread overview]
Message-ID: <87a5967vpi.fsf@intel.com> (raw)
In-Reply-To: <20250326162544.3642-2-ville.syrjala@linux.intel.com>
On Wed, 26 Mar 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> intel_bw_crtc_min_cdclk() only depends on the pipe data rate,
> which we already have stashed in bw_state->data_rate[]. So
> stashing the resulting min_cdclk[] as well is redundant. Get
> rid of it.
Yay, always a fan of removing intermediate state.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_bw.c | 17 ++++++++---------
> drivers/gpu/drm/i915/display/intel_bw.h | 1 -
> 2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
> index bb81efec08a0..15c2377193f7 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -825,14 +825,13 @@ static unsigned int intel_bw_crtc_data_rate(const struct intel_crtc_state *crtc_
> }
>
> /* "Maximum Pipe Read Bandwidth" */
> -static int intel_bw_crtc_min_cdclk(const struct intel_crtc_state *crtc_state)
> +static int intel_bw_crtc_min_cdclk(struct intel_display *display,
> + unsigned int data_rate)
> {
> - struct intel_display *display = to_intel_display(crtc_state);
> -
> if (DISPLAY_VER(display) < 12)
> return 0;
>
> - return DIV_ROUND_UP_ULL(mul_u32_u32(intel_bw_crtc_data_rate(crtc_state), 10), 512);
> + return DIV_ROUND_UP_ULL(mul_u32_u32(data_rate, 10), 512);
> }
>
> static unsigned int intel_bw_num_active_planes(struct intel_display *display,
> @@ -1170,7 +1169,8 @@ static bool intel_bw_state_changed(struct intel_display *display,
> return true;
> }
>
> - if (old_bw_state->min_cdclk[pipe] != new_bw_state->min_cdclk[pipe])
> + if (intel_bw_crtc_min_cdclk(display, old_bw_state->data_rate[pipe]) !=
> + intel_bw_crtc_min_cdclk(display, new_bw_state->data_rate[pipe]))
> return true;
> }
>
> @@ -1271,7 +1271,9 @@ int intel_bw_min_cdclk(struct intel_display *display,
> min_cdclk = intel_bw_dbuf_min_cdclk(display, bw_state);
>
> for_each_pipe(display, pipe)
> - min_cdclk = max(min_cdclk, bw_state->min_cdclk[pipe]);
> + min_cdclk = max(min_cdclk,
> + intel_bw_crtc_min_cdclk(display,
> + bw_state->data_rate[pipe]));
>
> return min_cdclk;
> }
> @@ -1299,9 +1301,6 @@ int intel_bw_calc_min_cdclk(struct intel_atomic_state *state,
> old_bw_state = intel_atomic_get_old_bw_state(state);
>
> skl_crtc_calc_dbuf_bw(new_bw_state, crtc_state);
> -
> - new_bw_state->min_cdclk[crtc->pipe] =
> - intel_bw_crtc_min_cdclk(crtc_state);
> }
>
> if (!old_bw_state)
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.h b/drivers/gpu/drm/i915/display/intel_bw.h
> index c18126c83d2e..3e4397c85774 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.h
> +++ b/drivers/gpu/drm/i915/display/intel_bw.h
> @@ -54,7 +54,6 @@ struct intel_bw_state {
> */
> bool force_check_qgv;
>
> - int min_cdclk[I915_MAX_PIPES];
> unsigned int data_rate[I915_MAX_PIPES];
> u8 num_active_planes[I915_MAX_PIPES];
> };
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-03-27 7:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 16:25 [PATCH v2 00/14] drm/i915: sagv/bw cleanup Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 01/14] drm/i915: Drop the cached per-pipe min_cdclk[] from bw state Ville Syrjala
2025-03-27 7:56 ` Jani Nikula [this message]
2025-03-26 16:25 ` [PATCH v2 02/14] drm/i915: s/intel_crtc_bw/intel_dbuf_bw/ Ville Syrjala
2025-03-27 7:57 ` Jani Nikula
2025-03-26 16:25 ` [PATCH v2 03/14] drm/i915: Extract intel_dbuf_bw_changed() Ville Syrjala
2025-03-27 7:57 ` Jani Nikula
2025-03-26 16:25 ` [PATCH v2 04/14] drm/i915: Pass intel_dbuf_bw to skl_*_calc_dbuf_bw() explicitly Ville Syrjala
2025-03-27 7:57 ` Jani Nikula
2025-03-26 16:25 ` [PATCH v2 05/14] drm/i915: Avoid triggering unwanted cdclk changes due to dbuf bandwidth changes Ville Syrjala
2025-03-27 8:00 ` Jani Nikula
2025-03-27 12:06 ` Ville Syrjälä
2025-03-26 16:25 ` [PATCH v2 06/14] drm/i915: Do more bw readout Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 07/14] drm/i915: Flag even inactive crtcs as "inherited" Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 08/14] drm/i915: Drop force_check_qgv Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 09/14] drm/i915: Extract intel_bw_modeset_checks() Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 10/14] drm/i915: Extract intel_bw_check_sagv_mask() Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 11/14] drm/i915: Make intel_bw_check_sagv_mask() internal to intel_bw.c Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 12/14] drm/i915: Make intel_bw_modeset_checks() internal to intel_bw_atomic_check() Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 13/14] drm/i915: Skip bw stuff if per-crtc sagv state doesn't change Ville Syrjala
2025-03-26 16:25 ` [PATCH v2 14/14] drm/i915: Eliminate intel_compute_sagv_mask() Ville Syrjala
2025-03-26 17:45 ` ✓ CI.Patch_applied: success for drm/i915: sagv/bw cleanup (rev2) Patchwork
2025-03-26 17:45 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-26 17:46 ` ✓ CI.KUnit: success " Patchwork
2025-03-26 18:03 ` ✓ CI.Build: " Patchwork
2025-03-26 18:05 ` ✓ CI.Hooks: " Patchwork
2025-03-26 18:07 ` ✗ CI.checksparse: warning " Patchwork
2025-03-26 18:29 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-27 8:02 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-27 11:46 ` Patchwork
2025-04-04 12:59 ` [PATCH v2 00/14] drm/i915: sagv/bw cleanup Jani Nikula
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=87a5967vpi.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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