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>,
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 11/12] drm/i915/display: Enable/disable casf
Date: Tue, 1 Apr 2025 11:39:11 +0530 [thread overview]
Message-ID: <1bd83249-b8aa-41a8-a978-cdf1fef86cc7@intel.com> (raw)
In-Reply-To: <20250321160628.2663912-12-nemesa.garg@intel.com>
On 3/21/2025 9:36 PM, Nemesa Garg wrote:
> To enable or disable the sharpness check the
> casf_enable flag. While enabling the sharpness
> write the programmable coefficients, sharpness
> register bits and also enable the scaler.
> Load the filter lut value which needs to be done
> one time while enabling the sharpness.
>
> v2: Introduce casf_enable here[Ankit]
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_casf.c | 27 ++++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_casf.h | 2 ++
> drivers/gpu/drm/i915/display/intel_display.c | 27 ++++++++++++++++++++
> 3 files changed, 56 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
> index 367a73a91ae6..58fa57596457 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf.c
> +++ b/drivers/gpu/drm/i915/display/intel_casf.c
> @@ -248,3 +248,30 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
> filter_coeff[i]);
> }
> }
> +
> +void intel_casf_enable(struct intel_crtc_state *crtc_state)
> +{
> + struct intel_display *display = to_intel_display(crtc_state);
> + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> + u32 sharpness_ctl;
> +
> + intel_filter_lut_load(crtc, crtc_state);
> +
> + intel_casf_write_coeff(crtc_state);
> +
> + sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->hw.casf_params.strength);
> +
> + sharpness_ctl |= crtc_state->hw.casf_params.win_size;
> +
> + intel_de_write(display, SHARPNESS_CTL(crtc->pipe), sharpness_ctl);
> +
> + skl_scaler_setup_casf(crtc_state);
> +}
> +
> +void intel_casf_disable(const struct intel_crtc_state *crtc_state)
> +{
> + struct intel_display *display = to_intel_display(crtc_state);
> + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +
> + intel_de_write(display, SHARPNESS_CTL(crtc->pipe), 0);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_casf.h b/drivers/gpu/drm/i915/display/intel_casf.h
> index 026a2b8348df..301a9fbd930f 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf.h
> +++ b/drivers/gpu/drm/i915/display/intel_casf.h
> @@ -18,5 +18,7 @@ void intel_filter_lut_load(struct intel_crtc *crtc,
> const struct intel_crtc_state *crtc_state);
> void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state);
> bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state);
> +void intel_casf_enable(struct intel_crtc_state *crtc_state);
> +void intel_casf_disable(const struct intel_crtc_state *crtc_state);
>
> #endif /* __INTEL_CASF_H__ */
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index d6691cb07173..cda8a4fed7bc 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1036,6 +1036,25 @@ 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 *new_crtc_state,
> + const struct intel_crtc_state *old_crtc_state)
> +{
> + if (!new_crtc_state->hw.active)
> + return false;
> +
> + return (old_crtc_state->hw.casf_params.casf_enable &&
> + !new_crtc_state->hw.casf_params.casf_enable);
> +}
> +
> #undef is_disabling
> #undef is_enabling
>
> @@ -1183,6 +1202,9 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
> if (audio_disabling(old_crtc_state, new_crtc_state))
> intel_encoders_audio_disable(state, crtc);
>
> + if (intel_casf_disabling(old_crtc_state, new_crtc_state))
> + intel_casf_disable(new_crtc_state);
> +
> intel_drrs_deactivate(old_crtc_state);
>
> intel_psr_pre_plane_update(state, crtc);
> @@ -6699,6 +6721,11 @@ 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));
next prev parent reply other threads:[~2025-04-01 6:09 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 16:06 [PATCH 00/12] Introduce drm sharpness property Nemesa Garg
2025-03-21 16:06 ` [PATCH 01/12] drm/i915/display: Introduce sharpness strength property Nemesa Garg
2025-03-21 16:06 ` [PATCH 02/12] drm/i915/display: Introduce HAS_CASF for sharpness support Nemesa Garg
2025-04-01 5:22 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 03/12] drm/i915/display: Add sharpness strength and winsize Nemesa Garg
2025-04-01 5:28 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 04/12] drm/i915/display: Add filter lut values Nemesa Garg
2025-03-21 16:06 ` [PATCH 05/12] drm/i915/display: Compute the scaler filter Nemesa Garg
2025-04-01 5:29 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 06/12] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-03-21 16:06 ` [PATCH 07/12] drm/i915/display: Configure the second scaler for Nemesa Garg
2025-04-01 5:32 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 08/12] drm/i915/display: Compare the sharpness state Nemesa Garg
2025-04-01 5:34 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 09/12] drm/i915/display: Set a scaler mode Nemesa Garg
2025-04-01 5:37 ` Nautiyal, Ankit K
2025-04-01 5:54 ` Garg, Nemesa
2025-03-21 16:06 ` [PATCH 10/12] drm/i915/display: Write and read back the casf registers Nemesa Garg
2025-04-01 5:40 ` Nautiyal, Ankit K
2025-03-21 16:06 ` [PATCH 11/12] drm/i915/display: Enable/disable casf Nemesa Garg
2025-04-01 6:09 ` Nautiyal, Ankit K [this message]
2025-03-21 16:06 ` [PATCH 12/12] drm/i915/display: Expose sharpness strength property Nemesa Garg
2025-04-01 6:10 ` Nautiyal, Ankit K
2025-03-21 16:17 ` ✓ CI.Patch_applied: success for Introduce drm sharpness property (rev11) Patchwork
2025-03-21 16:17 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-21 16:19 ` ✓ CI.KUnit: success " Patchwork
2025-03-21 16:35 ` ✓ CI.Build: " Patchwork
2025-03-21 16:37 ` ✓ CI.Hooks: " Patchwork
2025-03-21 16:39 ` ✗ CI.checksparse: warning " Patchwork
2025-03-21 17:04 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-21 17:46 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2025-03-21 17:46 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-03-21 18:05 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-21 18:11 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-21 21:40 ` ✗ i915.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=1bd83249-b8aa-41a8-a978-cdf1fef86cc7@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.