Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nemesa Garg <nemesa.garg@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Cc: Nemesa Garg <nemesa.garg@intel.com>
Subject: [PATCH 04/10] drm/i915/display: Add filter lut values
Date: Tue,  4 Mar 2025 15:58:51 +0530	[thread overview]
Message-ID: <20250304102857.326544-5-nemesa.garg@intel.com> (raw)
In-Reply-To: <20250304102857.326544-1-nemesa.garg@intel.com>

Add the register bits related to filter lut values
and populate the table.

Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
 drivers/gpu/drm/i915/display/intel_casf.c     | 22 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_casf.h     |  3 +++
 .../gpu/drm/i915/display/intel_casf_regs.h    | 11 ++++++++++
 3 files changed, 36 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 2c406e7c5fb6..ed72bccbb93f 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -25,6 +25,28 @@
  * to 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
+};
+
+void intel_filter_lut_load(struct intel_crtc *crtc,
+			   const struct intel_crtc_state *crtc_state)
+{
+	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 6e308c367c17..faeed50de2ba 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.h
+++ b/drivers/gpu/drm/i915/display/intel_casf.h
@@ -9,8 +9,11 @@
 #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_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 e5fa4d9bb309..c61755a401ff 100644
--- a/drivers/gpu/drm/i915/display/intel_casf_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_casf_regs.h
@@ -19,5 +19,16 @@
 #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
+#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__ */
 
-- 
2.25.1


  parent reply	other threads:[~2025-03-04 10:33 UTC|newest]

Thread overview: 40+ 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 ` Nemesa Garg [this message]
2025-03-11 12:00   ` [PATCH 04/10] drm/i915/display: Add filter lut values 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
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:03 ` ✓ CI.Patch_applied: success for Introduce drm sharpness property (rev10) Patchwork
2025-03-04 12:03 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-04 12:04 ` ✓ CI.KUnit: success " Patchwork
2025-03-04 12:21 ` ✓ CI.Build: " Patchwork
2025-03-04 12:23 ` ✓ CI.Hooks: " Patchwork
2025-03-04 12:25 ` ✗ CI.checksparse: warning " Patchwork
2025-03-04 12:43 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-04 13:46 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
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-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-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-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-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-09-26 11:37 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
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
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-10-26 17:26 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-10-26 17:26 ` [PATCH 04/10] drm/i915/display: Add filter lut values 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=20250304102857.326544-5-nemesa.garg@intel.com \
    --to=nemesa.garg@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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