From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/3] drm/i915/display: Common wrapper for casf and pfit
Date: Thu, 12 Mar 2026 16:49:43 +0530 [thread overview]
Message-ID: <164a153d-a688-4ff2-a1b7-0ae2d04a228b@intel.com> (raw)
In-Reply-To: <20251223081300.1196417-4-nemesa.garg@intel.com>
On 12/23/2025 1:43 PM, Nemesa Garg wrote:
> Make a common wrapper for pipe_scaling and sharpness
> which will be invoked from hsw_crtc_enable and
> pipe_fastset. Then accoridng to the condition
s/accoridng/according
> pfit_enable or casf_enable or casf_update_strength
> can be invoked. This is done so that all pipe
> related functions can be under one umberalla.
You mean pipe scaler related functions?
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 24 ++++------------
> drivers/gpu/drm/i915/display/skl_scaler.c | 29 ++++++++++++++++++++
> drivers/gpu/drm/i915/display/skl_scaler.h | 3 ++
> 3 files changed, 37 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 568730ffe359..ddab4a1417ec 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -991,15 +991,6 @@ static bool audio_disabling(const struct intel_crtc_state *old_crtc_state,
> memcmp(old_crtc_state->eld, new_crtc_state->eld, MAX_ELD_BYTES) != 0);
> }
>
> -static bool intel_casf_enabling(const struct intel_crtc_state *new_crtc_state,
> - const struct intel_crtc_state *old_crtc_state)
> -{
> - if (!new_crtc_state->hw.active)
> - return false;
> -
> - return is_enabling(hw.casf_params.casf_enable, old_crtc_state, new_crtc_state);
> -}
> -
> static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
> const struct intel_crtc_state *new_crtc_state)
> {
> @@ -1679,7 +1670,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
> glk_pipe_scaler_clock_gating_wa(pipe_crtc, true);
>
> if (DISPLAY_VER(display) >= 9)
> - skl_pfit_enable(pipe_crtc_state);
> + skl_scaler_enable(state, crtc);
> else
> ilk_pfit_enable(pipe_crtc_state);
>
> @@ -6635,7 +6626,8 @@ void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc,
> }
> }
>
> -static void intel_pipe_fastset(const struct intel_crtc_state *old_crtc_state,
> +static void intel_pipe_fastset(struct intel_atomic_state *state,
> + const struct intel_crtc_state *old_crtc_state,
> const struct intel_crtc_state *new_crtc_state)
> {
> struct intel_display *display = to_intel_display(new_crtc_state);
> @@ -6653,8 +6645,7 @@ static void intel_pipe_fastset(const struct intel_crtc_state *old_crtc_state,
>
> /* on skylake this is done by detaching scalers */
> if (DISPLAY_VER(display) >= 9) {
> - if (new_crtc_state->pch_pfit.enabled)
> - skl_pfit_enable(new_crtc_state);
> + skl_scaler_enable(state, crtc);
> } else if (HAS_PCH_SPLIT(display)) {
> if (new_crtc_state->pch_pfit.enabled)
> ilk_pfit_enable(new_crtc_state);
> @@ -6706,7 +6697,7 @@ static void commit_pipe_pre_planes(struct intel_atomic_state *state,
> bdw_set_pipe_misc(NULL, new_crtc_state);
>
> if (intel_crtc_needs_fastset(new_crtc_state))
> - intel_pipe_fastset(old_crtc_state, new_crtc_state);
> + intel_pipe_fastset(state, old_crtc_state, new_crtc_state);
> }
>
> intel_psr2_program_trans_man_trk_ctl(NULL, new_crtc_state);
> @@ -6805,11 +6796,6 @@ static void intel_pre_update_crtc(struct intel_atomic_state *state,
> intel_vrr_set_transcoder_timings(new_crtc_state);
> }
>
> - if (intel_casf_enabling(new_crtc_state, old_crtc_state))
> - intel_casf_enable(new_crtc_state);
> - else if (new_crtc_state->hw.casf_params.strength != old_crtc_state->hw.casf_params.strength)
> - intel_casf_update_strength(new_crtc_state);
> -
> intel_fbc_update(state, crtc);
>
> drm_WARN_ON(display->drm, !intel_display_power_is_enabled(display, POWER_DOMAIN_DC_OFF));
> diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
> index abd951f7dd71..19a9c4a0da0a 100644
> --- a/drivers/gpu/drm/i915/display/skl_scaler.c
> +++ b/drivers/gpu/drm/i915/display/skl_scaler.c
> @@ -752,6 +752,19 @@ static void skl_scaler_setup_filter(struct intel_display *display,
> }
> }
>
> +#define is_enabling(feature, old_crtc_state, new_crtc_state) \
> + ((!(old_crtc_state)->feature || intel_crtc_needs_modeset(new_crtc_state)) && \
> + (new_crtc_state)->feature)
I think if this is indeed needed this should be placed in
intel_display.h instead of having a copy here.
> +
> +static bool intel_casf_enabling(const struct intel_crtc_state *new_crtc_state,
> + const struct intel_crtc_state *old_crtc_state)
This doesn't seem to belong to this file.
> +{
> + if (!new_crtc_state->hw.active)
> + return false;
> +
> + return is_enabling(hw.casf_params.casf_enable, old_crtc_state, new_crtc_state);
> +}
> +
> #define CASF_SCALER_FILTER_SELECT \
> (PS_FILTER_PROGRAMMED | \
> PS_Y_VERT_FILTER_SELECT(0) | \
> @@ -859,6 +872,22 @@ void skl_pipe_scaler_setup(const struct intel_crtc_state *crtc_state,
> PS_WIN_XPOS(x) | PS_WIN_YPOS(y));
> }
>
> +void skl_scaler_enable(struct intel_atomic_state *state,
> + struct intel_crtc *crtc)
> +{
> + struct intel_crtc_state *new_crtc_state =
> + intel_atomic_get_new_crtc_state(state, crtc);
> + struct intel_crtc_state *old_crtc_state =
> + intel_atomic_get_old_crtc_state(state, crtc);
> +
> + if (new_crtc_state->pch_pfit.enabled)
> + skl_pfit_enable(new_crtc_state);
The function `skl_pfit_enable()` was called from intel_display.c
earlier. Since this is not used outside this file this should be a
static function.
Regards,
Ankit
> + else if (intel_casf_enabling(new_crtc_state, old_crtc_state))
> + intel_casf_enable(new_crtc_state);
> + else if (new_crtc_state->hw.casf_params.strength != old_crtc_state->hw.casf_params.strength)
> + intel_casf_update_strength(new_crtc_state);
> +}
> +
> void
> skl_program_plane_scaler(struct intel_dsb *dsb,
> struct intel_plane *plane,
> diff --git a/drivers/gpu/drm/i915/display/skl_scaler.h b/drivers/gpu/drm/i915/display/skl_scaler.h
> index 94bde5d1c06a..3d49836334b7 100644
> --- a/drivers/gpu/drm/i915/display/skl_scaler.h
> +++ b/drivers/gpu/drm/i915/display/skl_scaler.h
> @@ -40,6 +40,9 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state);
>
> void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state);
>
> +void skl_scaler_enable(struct intel_atomic_state *state,
> + struct intel_crtc *crtc);
> +
> enum drm_mode_status
> skl_scaler_mode_valid(struct intel_display *display,
> const struct drm_display_mode *mode,
next prev parent reply other threads:[~2026-03-12 11:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 8:12 [PATCH 0/3] Make casf updates atomic and dsb ready Nemesa Garg
2025-12-23 8:12 ` [PATCH 1/3] drm/i915/display: Move casf_compute_config Nemesa Garg
2026-03-12 3:13 ` Nautiyal, Ankit K
2025-12-23 8:12 ` [PATCH 2/3] drm/i915/display: Introduce skl_pipe_scaler_setup() Nemesa Garg
2026-03-12 4:30 ` Nautiyal, Ankit K
2025-12-23 8:13 ` [PATCH 3/3] drm/i915/display: Common wrapper for casf and pfit Nemesa Garg
2026-03-12 11:19 ` Nautiyal, Ankit K [this message]
2025-12-23 9:14 ` ✗ i915.CI.BAT: failure for Make casf updates atomic and dsb ready (rev2) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-03-26 12:00 [PATCH 0/3] Make casf updates atomic and dsb ready Nemesa Garg
2026-03-26 12:00 ` [PATCH 3/3] drm/i915/display: Common wrapper for casf and pfit Nemesa Garg
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=164a153d-a688-4ff2-a1b7-0ae2d04a228b@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=nemesa.garg@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