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 06/10] drm/i915/display: Add and compute scaler parameter
Date: Tue, 4 Mar 2025 15:58:53 +0530 [thread overview]
Message-ID: <20250304102857.326544-7-nemesa.garg@intel.com> (raw)
In-Reply-To: <20250304102857.326544-1-nemesa.garg@intel.com>
Compute the values for second scaler for sharpness.
Fill the register bits corresponding to the scaler.
v1: Rename the title of patch [Ankit]
Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 3 ++
drivers/gpu/drm/i915/display/skl_scaler.c | 46 +++++++++++++++++++++++
drivers/gpu/drm/i915/display/skl_scaler.h | 1 +
3 files changed, 50 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index ff34e390c8fe..15ae555e571e 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -8,6 +8,7 @@
#include "intel_casf_regs.h"
#include "intel_de.h"
#include "intel_display_types.h"
+#include "skl_scaler.h"
#define MAX_PIXELS_FOR_3_TAP_FILTER (1920 * 1080)
#define MAX_PIXELS_FOR_5_TAP_FILTER (3840 * 2160)
@@ -211,4 +212,6 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
void intel_casf_enable(struct intel_crtc_state *crtc_state)
{
intel_casf_write_coeff(crtc_state);
+
+ skl_scaler_setup_casf(crtc_state);
}
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index f0cf966211c9..39fc537e54f0 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -133,6 +133,13 @@ static void skl_scaler_max_dst_size(struct intel_crtc *crtc,
}
}
+#define CASF_SCALER_FILTER_SELECT \
+ (PS_FILTER_PROGRAMMED | \
+ PS_Y_VERT_FILTER_SELECT(0) | \
+ PS_Y_HORZ_FILTER_SELECT(0) | \
+ PS_UV_VERT_FILTER_SELECT(0) | \
+ PS_UV_HORZ_FILTER_SELECT(0))
+
static int
skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
unsigned int scaler_user, int *scaler_id,
@@ -722,6 +729,45 @@ static void skl_scaler_setup_filter(struct intel_display *display,
}
}
+void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state)
+{
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+ struct intel_display *display = to_intel_display(crtc);
+ struct drm_display_mode *adjusted_mode =
+ &crtc_state->hw.adjusted_mode;
+ struct intel_crtc_scaler_state *scaler_state =
+ &crtc_state->scaler_state;
+ struct drm_rect src, dest;
+ int id, width, height;
+ int x = 0, y = 0;
+ enum pipe pipe = crtc->pipe;
+ u32 ps_ctrl;
+
+ width = adjusted_mode->crtc_hdisplay;
+ height = adjusted_mode->crtc_vdisplay;
+
+ drm_rect_init(&dest, x, y, width, height);
+
+ width = drm_rect_width(&dest);
+ height = drm_rect_height(&dest);
+ id = scaler_state->scaler_id;
+
+ drm_rect_init(&src, 0, 0,
+ drm_rect_width(&crtc_state->pipe_src) << 16,
+ drm_rect_height(&crtc_state->pipe_src) << 16);
+
+ trace_intel_pipe_scaler_update_arm(crtc, id, x, y, width, height);
+
+ ps_ctrl = PS_SCALER_EN | PS_BINDING_PIPE | scaler_state->scalers[id].mode |
+ CASF_SCALER_FILTER_SELECT;
+
+ intel_de_write_fw(display, SKL_PS_CTRL(pipe, id), ps_ctrl);
+ intel_de_write_fw(display, SKL_PS_WIN_POS(pipe, id),
+ PS_WIN_XPOS(x) | PS_WIN_YPOS(y));
+ intel_de_write_fw(display, SKL_PS_WIN_SZ(pipe, id),
+ PS_WIN_XSIZE(width) | PS_WIN_YSIZE(height));
+}
+
void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(crtc_state);
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.h b/drivers/gpu/drm/i915/display/skl_scaler.h
index 355ea15260ca..22fcfe78b506 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.h
+++ b/drivers/gpu/drm/i915/display/skl_scaler.h
@@ -31,5 +31,6 @@ void skl_detach_scalers(struct intel_dsb *dsb,
void skl_scaler_disable(const struct intel_crtc_state *old_crtc_state);
void skl_scaler_get_config(struct intel_crtc_state *crtc_state);
+void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state);
#endif
--
2.25.1
next prev parent reply other threads:[~2025-03-04 10:33 UTC|newest]
Thread overview: 36+ 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 ` Nemesa Garg [this message]
2025-03-11 12:03 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter 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 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-04-08 10:24 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-04-08 10:25 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-05-19 12:26 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-05-19 12:26 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-07-24 13:45 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-07-24 13:45 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-08-07 9:28 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-08-07 9:28 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-09-26 11:37 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-09-26 11:37 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-10-01 6:34 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-10-01 6:34 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter Nemesa Garg
2025-10-26 17:26 [PATCH 00/10] Introduce drm sharpness property Nemesa Garg
2025-10-26 17:26 ` [PATCH 06/10] drm/i915/display: Add and compute scaler parameter 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-7-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