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 04/10] drm/i915/display: Add filter lut values
Date: Wed, 1 Oct 2025 11:01:44 +0530 [thread overview]
Message-ID: <8a461b13-4b08-44c0-9619-76b96b4d386b@intel.com> (raw)
In-Reply-To: <20250926113728.606315-5-nemesa.garg@intel.com>
On 9/26/2025 5:07 PM, Nemesa Garg wrote:
> Add the register bits related to filter lut values.
> These values are golden values and these value has
> to be loaded one time while enabling the casf.
>
> v2: update commit message[Ankit]
> v3: Make filter_load fn name same[Jani]
> v4: Define the filter macros here
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_casf.c | 47 +++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_casf.h | 3 ++
> .../gpu/drm/i915/display/intel_casf_regs.h | 11 +++++
> 3 files changed, 61 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
> index 4597e576b6dc..45bc67377d21 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf.c
> +++ b/drivers/gpu/drm/i915/display/intel_casf.c
> @@ -16,6 +16,13 @@
> #define MAX_PIXELS_FOR_3_TAP_FILTER (1920 * 1080)
> #define MAX_PIXELS_FOR_5_TAP_FILTER (3840 * 2160)
>
> +#define FILTER_COEFF_0_125 125
> +#define FILTER_COEFF_0_25 250
> +#define FILTER_COEFF_0_5 500
> +#define FILTER_COEFF_1_0 1000
> +#define FILTER_COEFF_0_0 0
> +#define SET_POSITIVE_SIGN(x) ((x) & (~SIGN))
> +
> /**
> * DOC: Content Adaptive Sharpness Filter (CASF)
> *
> @@ -31,6 +38,46 @@
> * original image.
> */
>
> +/* Default LUT values to be loaded one time. */
> +static const u16 sharpness_lut[] = {
> + 4095, 2047, 1364, 1022, 816, 678, 579,
> + 504, 444, 397, 357, 323, 293, 268, 244, 224,
> + 204, 187, 170, 154, 139, 125, 111, 98, 85,
> + 73, 60, 48, 36, 24, 12, 0
> +};
> +
> +const u16 filtercoeff_1[] = {
> + FILTER_COEFF_0_0, FILTER_COEFF_0_0, FILTER_COEFF_0_5,
> + FILTER_COEFF_1_0, FILTER_COEFF_0_5, FILTER_COEFF_0_0,
> + FILTER_COEFF_0_0,
> +};
> +
> +const u16 filtercoeff_2[] = {
> + FILTER_COEFF_0_0, FILTER_COEFF_0_25, FILTER_COEFF_0_5,
> + FILTER_COEFF_1_0, FILTER_COEFF_0_5, FILTER_COEFF_0_25,
> + FILTER_COEFF_0_0,
> +};
> +
> +const u16 filtercoeff_3[] = {
> + FILTER_COEFF_0_125, FILTER_COEFF_0_25, FILTER_COEFF_0_5,
> + FILTER_COEFF_1_0, FILTER_COEFF_0_5, FILTER_COEFF_0_25,
> + FILTER_COEFF_0_125,
> +};
> +
> +void intel_casf_filter_lut_load(struct intel_crtc *crtc,
> + const struct intel_crtc_state *crtc_state)
This should be static and should be called from intel_casf_enable().
> +{
> + struct intel_display *display = to_intel_display(crtc_state);
> + int i;
> +
> + intel_de_write(display, SHRPLUT_INDEX(crtc->pipe),
> + INDEX_AUTO_INCR | INDEX_VALUE(0));
> +
> + for (i = 0; i < ARRAY_SIZE(sharpness_lut); i++)
> + intel_de_write(display, SHRPLUT_DATA(crtc->pipe),
> + sharpness_lut[i]);
> +}
> +
> void intel_casf_update_strength(struct intel_crtc_state *crtc_state)
> {
> struct intel_display *display = to_intel_display(crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_casf.h b/drivers/gpu/drm/i915/display/intel_casf.h
> index 83523fe66c48..3edbc3ad51cf 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf.h
> +++ b/drivers/gpu/drm/i915/display/intel_casf.h
> @@ -9,9 +9,12 @@
> #include <linux/types.h>
>
> struct intel_crtc_state;
> +struct intel_crtc;
>
> int intel_casf_compute_config(struct intel_crtc_state *crtc_state);
> void intel_casf_update_strength(struct intel_crtc_state *new_crtc_state);
> void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state);
> +void intel_casf_filter_lut_load(struct intel_crtc *crtc,
> + const struct intel_crtc_state *crtc_state);
>
> #endif /* __INTEL_CASF_H__ */
> diff --git a/drivers/gpu/drm/i915/display/intel_casf_regs.h b/drivers/gpu/drm/i915/display/intel_casf_regs.h
> index c24ba281ae37..b96950a48335 100644
> --- a/drivers/gpu/drm/i915/display/intel_casf_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_casf_regs.h
> @@ -19,4 +19,15 @@
> #define SHARPNESS_FILTER_SIZE_5X5 REG_FIELD_PREP(FILTER_SIZE_MASK, 1)
> #define SHARPNESS_FILTER_SIZE_7X7 REG_FIELD_PREP(FILTER_SIZE_MASK, 2)
>
> +#define _SHRPLUT_DATA_A 0x682B8
> +#define _SHRPLUT_DATA_B 0x68AB8
> +#define SHRPLUT_DATA(pipe) _MMIO_PIPE(pipe, _SHRPLUT_DATA_A, _SHRPLUT_DATA_B)
> +
> +#define _SHRPLUT_INDEX_A 0x682B4
> +#define _SHRPLUT_INDEX_B 0x68AB4
It seems the macros and the registers offsets seems to be not separated
by tab, but spaces in some places.
Can you check these once?
As per i915_reg.h : “Indent macro values from macro names using TABs"
Regards,
Ankit
> +#define SHRPLUT_INDEX(pipe) _MMIO_PIPE(pipe, _SHRPLUT_INDEX_A, _SHRPLUT_INDEX_B)
> +#define INDEX_AUTO_INCR REG_BIT(10)
> +#define INDEX_VALUE_MASK REG_GENMASK(4, 0)
> +#define INDEX_VALUE(x) REG_FIELD_PREP(INDEX_VALUE_MASK, (x))
> +
> #endif /* __INTEL_CASF_REGS__ */
next prev parent reply other threads:[~2025-10-01 5:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 11:37 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-09-26 11:37 ` [PATCH 01/10] drm/drm_crtc: Introduce sharpness strength property Nemesa Garg
2025-09-26 11:37 ` [PATCH 02/10] drm/i915/display: Introduce HAS_CASF for sharpness support Nemesa Garg
2025-09-26 11:37 ` [PATCH 03/10] drm/i915/display: Add strength and winsize register Nemesa Garg
2025-10-01 5:29 ` Nautiyal, Ankit K
2025-09-26 11:37 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-10-01 5:31 ` Nautiyal, Ankit K [this message]
2025-09-26 11:37 ` [PATCH 05/10] drm/i915/display: Compute the scaler coefficients Nemesa Garg
2025-09-26 11:37 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-09-26 11:37 ` [PATCH 07/10] drm/i915/display: Configure the second scaler Nemesa Garg
2025-09-26 11:37 ` [PATCH 08/10] drm/i915/display: Set and get the casf config Nemesa Garg
2025-09-26 11:37 ` [PATCH 09/10] drm/i915/display: Enable/disable casf Nemesa Garg
2025-09-26 11:37 ` [PATCH 10/10] drm/i915/display: Expose sharpness strength property Nemesa Garg
2025-09-26 12:57 ` ✗ CI.checkpatch: warning for Introduce drm sharpness property Patchwork
2025-09-26 12:58 ` ✓ CI.KUnit: success " Patchwork
2025-09-26 13:13 ` ✗ CI.checksparse: warning " Patchwork
2025-09-26 13:43 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-26 19:00 ` ✓ Xe.CI.Full: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-10-26 17:26 [PATCH 00/10] " Nemesa Garg
2025-10-26 17:26 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-10-01 6:34 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-10-01 6:34 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-10-09 10:51 ` Nautiyal, Ankit K
2025-08-07 9:28 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-08-07 9:28 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-07-24 13:45 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-07-24 13:45 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-05-19 12:26 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-05-19 12:26 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-05-19 12:45 ` Jani Nikula
2025-05-27 3:26 ` Garg, Nemesa
2025-04-08 10:24 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-04-08 10:25 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-04-02 12:56 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-04-02 12:56 ` [PATCH 04/10] drm/i915/display: Add filter lut values Nemesa Garg
2025-03-04 10:28 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
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
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=8a461b13-4b08-44c0-9619-76b96b4d386b@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