From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Coelho, Luciano" <luciano.coelho@intel.com>
Subject: Re: [PATCH 2/6] drm/i915/wm: move intel_sagv_init() to avoid forward declaration
Date: Tue, 16 Sep 2025 08:53:38 +0000 [thread overview]
Message-ID: <37f6f1e6c7bbf36574b696dcce95c9272f79f10b.camel@intel.com> (raw)
In-Reply-To: <20250908073734.1180687-3-luciano.coelho@intel.com>
On Mon, 2025-09-08 at 10:35 +0300, Luca Coelho wrote:
> There's no need to have a forward-declaration for skl_sagv_disable(),
> so move the intel_sagv_init() function below the called function to
> prevent it.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/gpu/drm/i915/display/skl_watermark.c | 60 ++++++++++----------
> 1 file changed, 29 insertions(+), 31 deletions(-)
>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c
> b/drivers/gpu/drm/i915/display/skl_watermark.c
> index d74cbb43ae6f..3b409442db37 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -53,8 +53,6 @@ struct intel_dbuf_state {
> #define intel_atomic_get_new_dbuf_state(state) \
> to_intel_dbuf_state(intel_atomic_get_new_global_obj_state(state,
> &to_intel_display(state)->dbuf.obj))
>
> -static void skl_sagv_disable(struct intel_display *display);
> -
> /* Stores plane specific WM parameters */
> struct skl_wm_params {
> bool x_tiled, y_tiled;
> @@ -130,35 +128,6 @@ intel_sagv_block_time(struct intel_display *display)
> }
> }
>
> -static void intel_sagv_init(struct intel_display *display)
> -{
> - if (!HAS_SAGV(display))
> - display->sagv.status = I915_SAGV_NOT_CONTROLLED;
> -
> - /*
> - * Probe to see if we have working SAGV control.
> - * For icl+ this was already determined by intel_bw_init_hw().
> - */
> - if (DISPLAY_VER(display) < 11)
> - skl_sagv_disable(display);
> -
> - drm_WARN_ON(display->drm, display->sagv.status == I915_SAGV_UNKNOWN);
> -
> - display->sagv.block_time_us = intel_sagv_block_time(display);
> -
> - drm_dbg_kms(display->drm, "SAGV supported: %s, original SAGV block time: %u us\n",
> - str_yes_no(intel_has_sagv(display)), display->sagv.block_time_us);
> -
> - /* avoid overflow when adding with wm0 latency/etc. */
> - if (drm_WARN(display->drm, display->sagv.block_time_us > U16_MAX,
> - "Excessive SAGV block time %u, ignoring\n",
> - display->sagv.block_time_us))
> - display->sagv.block_time_us = 0;
> -
> - if (!intel_has_sagv(display))
> - display->sagv.block_time_us = 0;
> -}
> -
> /*
> * SAGV dynamically adjusts the system agent voltage and clock frequencies
> * depending on power and performance requirements. The display engine access
> @@ -233,6 +202,35 @@ static void skl_sagv_disable(struct intel_display *display)
> display->sagv.status = I915_SAGV_DISABLED;
> }
>
> +static void intel_sagv_init(struct intel_display *display)
> +{
> + if (!HAS_SAGV(display))
> + display->sagv.status = I915_SAGV_NOT_CONTROLLED;
> +
> + /*
> + * Probe to see if we have working SAGV control.
> + * For icl+ this was already determined by intel_bw_init_hw().
> + */
> + if (DISPLAY_VER(display) < 11)
> + skl_sagv_disable(display);
> +
> + drm_WARN_ON(display->drm, display->sagv.status == I915_SAGV_UNKNOWN);
> +
> + display->sagv.block_time_us = intel_sagv_block_time(display);
> +
> + drm_dbg_kms(display->drm, "SAGV supported: %s, original SAGV block time: %u us\n",
> + str_yes_no(intel_has_sagv(display)), display->sagv.block_time_us);
> +
> + /* avoid overflow when adding with wm0 latency/etc. */
> + if (drm_WARN(display->drm, display->sagv.block_time_us > U16_MAX,
> + "Excessive SAGV block time %u, ignoring\n",
> + display->sagv.block_time_us))
> + display->sagv.block_time_us = 0;
> +
> + if (!intel_has_sagv(display))
> + display->sagv.block_time_us = 0;
> +}
> +
> static void skl_sagv_pre_plane_update(struct intel_atomic_state *state)
> {
> struct intel_display *display = to_intel_display(state);
next prev parent reply other threads:[~2025-09-16 8:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 7:35 [PATCH 0/6] drm/i915/wm: some clean-ups and a bit of refactoring Luca Coelho
2025-09-08 7:35 ` [PATCH 1/6] drm/i915/wm: clarify watermark ops with comments Luca Coelho
2025-09-16 8:52 ` Govindapillai, Vinod
2025-09-22 10:26 ` Luca Coelho
2025-09-08 7:35 ` [PATCH 2/6] drm/i915/wm: move intel_sagv_init() to avoid forward declaration Luca Coelho
2025-09-16 8:53 ` Govindapillai, Vinod [this message]
2025-09-08 7:35 ` [PATCH 3/6] drm/i915/wm: remove stale FIXME in skl_needs_memory_bw_wa() Luca Coelho
2025-09-16 9:21 ` Govindapillai, Vinod
2025-09-08 7:35 ` [PATCH 4/6] drm/i915/wm: convert x/y-tiling bools to an enum Luca Coelho
2025-09-08 12:43 ` Gustavo Sousa
2025-09-08 12:53 ` Luca Coelho
2025-09-19 8:36 ` Ville Syrjälä
2025-09-22 12:38 ` Luca Coelho
2025-09-22 12:48 ` Ville Syrjälä
2025-09-08 7:35 ` [PATCH 5/6] drm/i915/wm: convert tiling mode check in slk_compute_plane_wm() to a switch-case Luca Coelho
2025-09-08 12:51 ` Gustavo Sousa
2025-09-08 12:57 ` Luca Coelho
2025-09-08 7:35 ` [PATCH 6/6] drm/i915/wm: move method selection and calculation to a separate function Luca Coelho
2025-09-19 18:00 ` Ville Syrjälä
2025-09-29 7:21 ` Luca Coelho
2025-09-08 17:20 ` ✓ i915.CI.BAT: success for drm/i915/wm: some clean-ups and a bit of refactoring Patchwork
2025-09-09 2:47 ` ✗ i915.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=37f6f1e6c7bbf36574b696dcce95c9272f79f10b.camel@intel.com \
--to=vinod.govindapillai@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luciano.coelho@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).