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 08/10] drm/i915/display: Call the compute function
Date: Tue, 11 Mar 2025 17:41:53 +0530 [thread overview]
Message-ID: <9729c9bc-90be-4b15-9f40-9ef0aa0b09d1@intel.com> (raw)
In-Reply-To: <20250304102857.326544-9-nemesa.garg@intel.com>
On 3/4/2025 3:58 PM, Nemesa Garg wrote:
> Once the casf_compute config is called then the
> strength and win_size bit of sharpness ctl register
> will be set. Read back the bits in get_config.
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_casf.c | 11 +++++++
> drivers/gpu/drm/i915/display/intel_display.c | 4 +++
> drivers/gpu/drm/i915/display/skl_scaler.c | 32 +++++++++++++++-----
> 3 files changed, 40 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
> index 1d9196c4d22f..9f14418dc3c9 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf.c
> +++ b/drivers/gpu/drm/i915/display/intel_casf.c
> @@ -97,6 +97,17 @@ static void intel_casf_compute_win_size(struct intel_crtc_state *crtc_state)
>
> int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
> {
> + struct intel_display *display = to_intel_display(crtc_state);
> +
> + if (!HAS_CASF(display))
> + return 0;
> +
> + if (crtc_state->uapi.sharpness_strength == 0) {
> + crtc_state->hw.casf_params.casf_enable = false;
> + crtc_state->hw.casf_params.strength = 0;
> + return 0;
> + }
> +
All this can be part of the patch#3.
Then this function will be just calling the compute config and get
config part.
Also the subject can be improved as the patch is calling compute_config
and get_config for sharpening feature.
Regards,
Ankit
> crtc_state->hw.casf_params.casf_enable = true;
>
> /*
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 03acf01cac75..a2fb68c7cf7a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -4267,6 +4267,10 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
> return ret;
> }
>
> + ret = intel_casf_compute_config(crtc_state);
> + if (ret)
> + return ret;
> +
> if (DISPLAY_VER(dev_priv) >= 9 ||
> IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv)) {
> ret = hsw_compute_linetime_wm(state, crtc);
> diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
> index 93a847c05535..79b6749c157e 100644
> --- a/drivers/gpu/drm/i915/display/skl_scaler.c
> +++ b/drivers/gpu/drm/i915/display/skl_scaler.c
> @@ -957,23 +957,41 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
>
> /* find scaler attached to this pipe */
> for (i = 0; i < crtc->num_scalers; i++) {
> - u32 ctl, pos, size;
> + u32 ctl, pos, size, sharp;
>
> ctl = intel_de_read(display, SKL_PS_CTRL(crtc->pipe, i));
> if ((ctl & (PS_SCALER_EN | PS_BINDING_MASK)) != (PS_SCALER_EN | PS_BINDING_PIPE))
> continue;
>
> id = i;
> - crtc_state->pch_pfit.enabled = true;
> +
> + if (HAS_CASF(display) && id == 1) {
> + sharp = intel_de_read(display, SHARPNESS_CTL(crtc->pipe));
> + if (sharp & FILTER_EN) {
> + if (drm_WARN_ON(display->drm,
> + REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp) < 16))
> + crtc_state->hw.casf_params.strength = 0;
> + else
> + crtc_state->hw.casf_params.strength =
> + REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp) - 16;
> + crtc_state->hw.casf_params.casf_enable = true;
> + crtc_state->hw.casf_params.win_size =
> + REG_FIELD_GET(FILTER_SIZE_MASK, sharp);
> + }
> + }
> +
> + if (!crtc_state->hw.casf_params.casf_enable)
> + crtc_state->pch_pfit.enabled = true;
>
> pos = intel_de_read(display, SKL_PS_WIN_POS(crtc->pipe, i));
> size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, i));
>
> - drm_rect_init(&crtc_state->pch_pfit.dst,
> - REG_FIELD_GET(PS_WIN_XPOS_MASK, pos),
> - REG_FIELD_GET(PS_WIN_YPOS_MASK, pos),
> - REG_FIELD_GET(PS_WIN_XSIZE_MASK, size),
> - REG_FIELD_GET(PS_WIN_YSIZE_MASK, size));
> + if (!crtc_state->hw.casf_params.casf_enable)
> + drm_rect_init(&crtc_state->pch_pfit.dst,
> + REG_FIELD_GET(PS_WIN_XPOS_MASK, pos),
> + REG_FIELD_GET(PS_WIN_YPOS_MASK, pos),
> + REG_FIELD_GET(PS_WIN_XSIZE_MASK, size),
> + REG_FIELD_GET(PS_WIN_YSIZE_MASK, size));
>
> scaler_state->scalers[i].in_use = true;
> break;
next prev parent reply other threads:[~2025-03-11 12:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 10:28 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-03-04 10:28 ` [PATCH 01/10] drm/i915/display: Introduce sharpness strength property Nemesa Garg
2025-03-04 10:28 ` [PATCH 02/10] drm/i915/display: Introduce HAS_CASF macro Nemesa Garg
2025-03-11 11:55 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 03/10] drm/i915/display: Add sharpness strength and winsize Nemesa Garg
2025-03-11 11:58 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-03-11 12:00 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 05/10] drm/i915/display: Compute the scaler filter coefficients Nemesa Garg
2025-03-11 12:02 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-03-11 12:03 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 07/10] drm/i915/display: Configure the second scaler for sharpness Nemesa Garg
2025-03-11 12:07 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 08/10] drm/i915/display: Call the compute function Nemesa Garg
2025-03-11 12:11 ` Nautiyal, Ankit K [this message]
2025-03-04 10:28 ` [PATCH 09/10] drm/i915/display: Enable/disable casf Nemesa Garg
2025-03-11 12:14 ` Nautiyal, Ankit K
2025-03-04 10:28 ` [PATCH 10/10] drm/i915/display: Expose casf property Nemesa Garg
2025-03-11 12:15 ` Nautiyal, Ankit K
2025-03-04 12:11 ` ✗ Fi.CI.CHECKPATCH: warning for Introduce drm sharpness property (rev10) Patchwork
2025-03-04 12:12 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-03-04 12:30 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-05 4:30 ` ✗ 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=9729c9bc-90be-4b15-9f40-9ef0aa0b09d1@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox