* [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code
@ 2026-04-07 17:52 Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 1/9] drm/i915/casf: s/casf_enable/enable/ Ville Syrjala
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The sharpness filter isn't anything special. It's just another
mode of the pipe scaler, so treat is as such.
This gets rid of tons of special casing all over the place,
and will allow me to finally land the pending pipe prefill
series: https://patchwork.freedesktop.org/series/156137/
Note that this will fail some kms_sharpness_filter tests,
because those tests are basically incorrect. But I couldn't
decide yet how much of that entire test should be nuked. It
seems to be doing a *lot* of things, most of which have
nothing to do with the sharpness filter...
v2: Rebase due to related changes
Also reject sharpness + scaling_filter!=DEFAULT
Ville Syrjälä (9):
drm/i915/casf: s/casf_enable/enable/
drm/i915/casf: Make a proper hw state copy of the sharpness_strength
drm/i915/casf: Move the casf state to better place
drm/i915/casf: Extract scaler_has_casf()
drm/i915/casf: Handle CASF in skl_scaler_get_filter_select()
drm/i915/casf: Constify crtc_state
drm/i915/casf: Remove redundant argument from
intel_casf_filter_lut_load()
drm/i915/pfit: Call intel_pfit_compute_config() unconditionally on
(e)DP/HDMI
drm/i915/casf: Integrate the sharpness filter properly into the scaler
code
drivers/gpu/drm/i915/display/intel_casf.c | 102 +++++-----------
drivers/gpu/drm/i915/display/intel_casf.h | 6 +-
.../drm/i915/display/intel_crtc_state_dump.c | 11 +-
drivers/gpu/drm/i915/display/intel_display.c | 46 ++------
.../drm/i915/display/intel_display_debugfs.c | 5 +-
.../drm/i915/display/intel_display_types.h | 5 +-
drivers/gpu/drm/i915/display/intel_dp.c | 9 +-
drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +-
.../drm/i915/display/intel_modeset_setup.c | 1 +
drivers/gpu/drm/i915/display/intel_pfit.c | 13 ++-
drivers/gpu/drm/i915/display/skl_scaler.c | 110 +++++++-----------
drivers/gpu/drm/i915/display/skl_scaler.h | 2 -
12 files changed, 112 insertions(+), 206 deletions(-)
--
2.52.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 1/9] drm/i915/casf: s/casf_enable/enable/
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 2/9] drm/i915/casf: Make a proper hw state copy of the sharpness_strength Ville Syrjala
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The 'casf_enable' boolean is already inside a casf specific
structure, so drop the extra 'casf_' namespace from the bool.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 8 ++++----
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c | 2 +-
drivers/gpu/drm/i915/display/intel_display.c | 6 +++---
drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
drivers/gpu/drm/i915/display/skl_scaler.c | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index b167af31de5b..32e6f7c8acdd 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -110,7 +110,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
return 0;
if (crtc_state->uapi.sharpness_strength == 0) {
- crtc_state->hw.casf_params.casf_enable = false;
+ crtc_state->hw.casf_params.enable = false;
crtc_state->hw.casf_params.strength = 0;
return 0;
}
@@ -121,7 +121,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
return -EINVAL;
}
- crtc_state->hw.casf_params.casf_enable = true;
+ crtc_state->hw.casf_params.enable = true;
/*
* HW takes a value in form (1.0 + strength) in 4.4 fixed format.
@@ -155,7 +155,7 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state)
else
crtc_state->hw.casf_params.strength =
REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp);
- crtc_state->hw.casf_params.casf_enable = true;
+ crtc_state->hw.casf_params.enable = true;
crtc_state->hw.casf_params.win_size =
REG_FIELD_GET(FILTER_SIZE_MASK, sharp);
}
@@ -163,7 +163,7 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state)
bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state)
{
- if (crtc_state->hw.casf_params.casf_enable)
+ if (crtc_state->hw.casf_params.enable)
return true;
return false;
diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
index c85ba9a95322..a11a79a0211e 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -351,7 +351,7 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
drm_printf(&p, "sharpness strength: %d, sharpness tap size: %d, sharpness enable: %d\n",
pipe_config->hw.casf_params.strength,
pipe_config->hw.casf_params.win_size,
- pipe_config->hw.casf_params.casf_enable);
+ pipe_config->hw.casf_params.enable);
drm_printf(&p, "ips: %i, double wide: %i, drrs: %i\n",
pipe_config->ips_enabled, pipe_config->double_wide,
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 10b6c6fcb03f..78d97441f682 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -994,7 +994,7 @@ static bool intel_casf_enabling(const struct intel_crtc_state *new_crtc_state,
if (!new_crtc_state->hw.active)
return false;
- return is_enabling(hw.casf_params.casf_enable, old_crtc_state, new_crtc_state);
+ return is_enabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
}
static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
@@ -1003,7 +1003,7 @@ static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
if (!new_crtc_state->hw.active)
return false;
- return is_disabling(hw.casf_params.casf_enable, old_crtc_state, new_crtc_state);
+ return is_disabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
}
static bool intel_crtc_lobf_enabling(const struct intel_crtc_state *old_crtc_state,
@@ -5371,7 +5371,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
PIPE_CONF_CHECK_I(scaler_state.scaler_id);
PIPE_CONF_CHECK_I(pixel_rate);
- PIPE_CONF_CHECK_BOOL(hw.casf_params.casf_enable);
+ PIPE_CONF_CHECK_BOOL(hw.casf_params.enable);
PIPE_CONF_CHECK_I(hw.casf_params.win_size);
PIPE_CONF_CHECK_I(hw.casf_params.strength);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index e2496db1642a..83bb5d19b6f6 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -997,7 +997,7 @@ struct intel_casf {
struct scaler_filter_coeff coeff[SCALER_FILTER_NUM_TAPS];
u8 strength;
u8 win_size;
- bool casf_enable;
+ bool enable;
};
struct intel_crtc_state {
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 7c5cb188ebf0..cfa17ddb4018 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -986,13 +986,13 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
if (HAS_CASF(display) && id == 1)
intel_casf_sharpness_get_config(crtc_state);
- if (!crtc_state->hw.casf_params.casf_enable)
+ if (!crtc_state->hw.casf_params.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));
- if (!crtc_state->hw.casf_params.casf_enable)
+ if (!crtc_state->hw.casf_params.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),
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/9] drm/i915/casf: Make a proper hw state copy of the sharpness_strength
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 1/9] drm/i915/casf: s/casf_enable/enable/ Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 3/9] drm/i915/casf: Move the casf state to better place Ville Syrjala
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Make a copy of the uapi.sharpness_strength property value in our hw
state. This is how we deal with having proper state for joined pipes.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 4 ++--
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c | 5 +++--
drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
drivers/gpu/drm/i915/display/intel_display_debugfs.c | 5 +++--
drivers/gpu/drm/i915/display/intel_display_types.h | 1 +
drivers/gpu/drm/i915/display/intel_modeset_setup.c | 1 +
6 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 32e6f7c8acdd..4316d8214e80 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -109,7 +109,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
if (!HAS_CASF(display))
return 0;
- if (crtc_state->uapi.sharpness_strength == 0) {
+ if (crtc_state->hw.sharpness_strength == 0) {
crtc_state->hw.casf_params.enable = false;
crtc_state->hw.casf_params.strength = 0;
return 0;
@@ -132,7 +132,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
* Also 85 + 16 = 101.
*/
crtc_state->hw.casf_params.strength =
- min(crtc_state->uapi.sharpness_strength, 0xEF) + 0x10;
+ min(crtc_state->hw.sharpness_strength, 0xEF) + 0x10;
intel_casf_compute_win_size(crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
index a11a79a0211e..42676adf6062 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -328,11 +328,12 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
pipe_config->linetime, pipe_config->ips_linetime);
if (DISPLAY_VER(display) >= 9)
- drm_printf(&p, "num_scalers: %d, scaler_users: 0x%x, scaler_id: %d, scaling_filter: %d\n",
+ drm_printf(&p, "num_scalers: %d, scaler_users: 0x%x, scaler_id: %d, scaling_filter: %d, sharpness_strength: %d\n",
crtc->num_scalers,
pipe_config->scaler_state.scaler_users,
pipe_config->scaler_state.scaler_id,
- pipe_config->hw.scaling_filter);
+ pipe_config->hw.scaling_filter,
+ pipe_config->hw.sharpness_strength);
drm_printf(&p, "pipe src: " DRM_RECT_FMT "\n",
DRM_RECT_ARG(&pipe_config->pipe_src));
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 78d97441f682..a02c58b5a34d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -4550,6 +4550,7 @@ intel_crtc_copy_uapi_to_hw_state_modeset(struct intel_atomic_state *state,
drm_mode_copy(&crtc_state->hw.adjusted_mode,
&crtc_state->uapi.adjusted_mode);
crtc_state->hw.scaling_filter = crtc_state->uapi.scaling_filter;
+ crtc_state->hw.sharpness_strength = crtc_state->uapi.sharpness_strength;
intel_crtc_copy_uapi_to_hw_state_nomodeset(state, crtc);
}
@@ -4615,6 +4616,7 @@ copy_joiner_crtc_state_modeset(struct intel_atomic_state *state,
drm_mode_copy(&secondary_crtc_state->hw.adjusted_mode,
&primary_crtc_state->hw.adjusted_mode);
secondary_crtc_state->hw.scaling_filter = primary_crtc_state->hw.scaling_filter;
+ secondary_crtc_state->hw.sharpness_strength = primary_crtc_state->hw.sharpness_strength;
if (primary_crtc_state->dp_tunnel_ref.tunnel)
drm_dp_tunnel_ref_get(primary_crtc_state->dp_tunnel_ref.tunnel,
@@ -6441,6 +6443,10 @@ int intel_atomic_check(struct drm_device *dev,
if (new_crtc_state->uapi.scaling_filter !=
old_crtc_state->uapi.scaling_filter)
new_crtc_state->uapi.mode_changed = true;
+
+ if (new_crtc_state->uapi.sharpness_strength !=
+ old_crtc_state->uapi.sharpness_strength)
+ new_crtc_state->uapi.mode_changed = true;
}
intel_vrr_check_modeset(state);
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 2614c4863c87..f244a2b5d139 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -416,11 +416,12 @@ static void intel_scaler_info(struct seq_file *m, struct intel_crtc *crtc)
/* Not all platforms have a scaler */
if (num_scalers) {
- seq_printf(m, "\tnum_scalers=%d, scaler_users=%x scaler_id=%d scaling_filter=%d",
+ seq_printf(m, "\tnum_scalers=%d, scaler_users=%x scaler_id=%d scaling_filter=%d sharpness_strength=%d",
num_scalers,
crtc_state->scaler_state.scaler_users,
crtc_state->scaler_state.scaler_id,
- crtc_state->hw.scaling_filter);
+ crtc_state->hw.scaling_filter,
+ crtc_state->hw.sharpness_strength);
for (i = 0; i < num_scalers; i++) {
const struct intel_scaler *sc =
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 83bb5d19b6f6..af0d870de342 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1036,6 +1036,7 @@ struct intel_crtc_state {
struct drm_property_blob *degamma_lut, *gamma_lut, *ctm;
struct drm_display_mode mode, pipe_mode, adjusted_mode;
enum drm_scaling_filter scaling_filter;
+ u8 sharpness_strength;
struct intel_casf casf_params;
} hw;
diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
index 4086f16a12bf..40a65a0d7ec7 100644
--- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c
+++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
@@ -333,6 +333,7 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state
crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;
crtc_state->uapi.scaling_filter = crtc_state->hw.scaling_filter;
+ crtc_state->uapi.sharpness_strength = crtc_state->hw.sharpness_strength;
if (DISPLAY_INFO(display)->color.degamma_lut_size) {
/* assume 1:1 mapping */
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/9] drm/i915/casf: Move the casf state to better place
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 1/9] drm/i915/casf: s/casf_enable/enable/ Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 2/9] drm/i915/casf: Make a proper hw state copy of the sharpness_strength Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 4/9] drm/i915/casf: Extract scaler_has_casf() Ville Syrjala
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The casf state is placed inside the 'hw' state for some reason.
That is only really meant for things we have to duplicate from
the uapi state. The rest can live on its own in our actual state.
And since casf is just one aspect of the pfit/pipe scaler the
proper place for it seems to be under pch_pfit.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 40 +++++++++----------
.../drm/i915/display/intel_crtc_state_dump.c | 6 +--
drivers/gpu/drm/i915/display/intel_display.c | 12 +++---
.../drm/i915/display/intel_display_types.h | 2 +-
drivers/gpu/drm/i915/display/skl_scaler.c | 4 +-
5 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 4316d8214e80..5a8ffb40d30d 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -82,7 +82,7 @@ void intel_casf_update_strength(struct intel_crtc_state *crtc_state)
int win_size;
intel_de_rmw(display, SHARPNESS_CTL(crtc->pipe), FILTER_STRENGTH_MASK,
- FILTER_STRENGTH(crtc_state->hw.casf_params.strength));
+ FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength));
win_size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, 1));
@@ -95,11 +95,11 @@ static void intel_casf_compute_win_size(struct intel_crtc_state *crtc_state)
u32 total_pixels = mode->hdisplay * mode->vdisplay;
if (total_pixels <= MAX_PIXELS_FOR_3_TAP_FILTER)
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_3X3;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_3X3;
else if (total_pixels <= MAX_PIXELS_FOR_5_TAP_FILTER)
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_5X5;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_5X5;
else
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_7X7;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_7X7;
}
int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
@@ -110,8 +110,8 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
return 0;
if (crtc_state->hw.sharpness_strength == 0) {
- crtc_state->hw.casf_params.enable = false;
- crtc_state->hw.casf_params.strength = 0;
+ crtc_state->pch_pfit.casf.enable = false;
+ crtc_state->pch_pfit.casf.strength = 0;
return 0;
}
@@ -121,7 +121,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
return -EINVAL;
}
- crtc_state->hw.casf_params.enable = true;
+ crtc_state->pch_pfit.casf.enable = true;
/*
* HW takes a value in form (1.0 + strength) in 4.4 fixed format.
@@ -131,7 +131,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
* 6.3125 in 4.4 format is b01100101 which is equal to 101.
* Also 85 + 16 = 101.
*/
- crtc_state->hw.casf_params.strength =
+ crtc_state->pch_pfit.casf.strength =
min(crtc_state->hw.sharpness_strength, 0xEF) + 0x10;
intel_casf_compute_win_size(crtc_state);
@@ -151,19 +151,19 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state)
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;
+ crtc_state->pch_pfit.casf.strength = 0;
else
- crtc_state->hw.casf_params.strength =
+ crtc_state->pch_pfit.casf.strength =
REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp);
- crtc_state->hw.casf_params.enable = true;
- crtc_state->hw.casf_params.win_size =
+ crtc_state->pch_pfit.casf.enable = true;
+ crtc_state->pch_pfit.casf.win_size =
REG_FIELD_GET(FILTER_SIZE_MASK, sharp);
}
}
bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state)
{
- if (crtc_state->hw.casf_params.enable)
+ if (crtc_state->pch_pfit.casf.enable)
return true;
return false;
@@ -179,7 +179,7 @@ static u32 casf_coeff(struct intel_crtc_state *crtc_state, int t)
struct scaler_filter_coeff value;
u32 coeff;
- value = crtc_state->hw.casf_params.coeff[t];
+ value = crtc_state->pch_pfit.casf.coeff[t];
value.sign = 0;
coeff = value.sign << 15 | value.exp << 12 | value.mantissa << 3;
@@ -189,7 +189,7 @@ static u32 casf_coeff(struct intel_crtc_state *crtc_state, int t)
/*
* 17 phase of 7 taps requires 119 coefficients in 60 dwords per set.
* To enable casf: program scaler coefficients with the coeffients
- * that are calculated and stored in hw.casf_params.coeff as per
+ * that are calculated and stored in pch_pfit.casf.coeff as per
* SCALER_COEFFICIENT_FORMAT
*/
static void intel_casf_write_coeff(struct intel_crtc_state *crtc_state)
@@ -247,9 +247,9 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
u16 sumcoeff = 0;
int i;
- if (crtc_state->hw.casf_params.win_size == 0)
+ if (crtc_state->pch_pfit.casf.win_size == 0)
filtercoeff = filtercoeff_1;
- else if (crtc_state->hw.casf_params.win_size == 1)
+ else if (crtc_state->pch_pfit.casf.win_size == 1)
filtercoeff = filtercoeff_2;
else
filtercoeff = filtercoeff_3;
@@ -259,7 +259,7 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
for (i = 0; i < SCALER_FILTER_NUM_TAPS; i++) {
filter_coeff[i] = (*(filtercoeff + i) * 100 / sumcoeff);
- convert_sharpness_coef_binary(&crtc_state->hw.casf_params.coeff[i],
+ convert_sharpness_coef_binary(&crtc_state->pch_pfit.casf.coeff[i],
filter_coeff[i]);
}
}
@@ -274,9 +274,9 @@ void intel_casf_enable(struct intel_crtc_state *crtc_state)
intel_casf_write_coeff(crtc_state);
- sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->hw.casf_params.strength);
+ sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength);
- sharpness_ctl |= crtc_state->hw.casf_params.win_size;
+ sharpness_ctl |= crtc_state->pch_pfit.casf.win_size;
intel_de_write(display, SHARPNESS_CTL(crtc->pipe), sharpness_ctl);
diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
index 42676adf6062..4493483f10a9 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -350,9 +350,9 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
str_yes_no(pipe_config->pch_pfit.force_thru));
drm_printf(&p, "sharpness strength: %d, sharpness tap size: %d, sharpness enable: %d\n",
- pipe_config->hw.casf_params.strength,
- pipe_config->hw.casf_params.win_size,
- pipe_config->hw.casf_params.enable);
+ pipe_config->pch_pfit.casf.strength,
+ pipe_config->pch_pfit.casf.win_size,
+ pipe_config->pch_pfit.casf.enable);
drm_printf(&p, "ips: %i, double wide: %i, drrs: %i\n",
pipe_config->ips_enabled, pipe_config->double_wide,
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index a02c58b5a34d..e02e69467871 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -994,7 +994,7 @@ static bool intel_casf_enabling(const struct intel_crtc_state *new_crtc_state,
if (!new_crtc_state->hw.active)
return false;
- return is_enabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
+ return is_enabling(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
}
static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
@@ -1003,7 +1003,7 @@ static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
if (!new_crtc_state->hw.active)
return false;
- return is_disabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
+ return is_disabling(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
}
static bool intel_crtc_lobf_enabling(const struct intel_crtc_state *old_crtc_state,
@@ -5370,12 +5370,12 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
PIPE_CONF_CHECK_BOOL(pch_pfit.enabled);
PIPE_CONF_CHECK_RECT(pch_pfit.dst);
+ PIPE_CONF_CHECK_BOOL(pch_pfit.casf.enable);
+ PIPE_CONF_CHECK_I(pch_pfit.casf.win_size);
+ PIPE_CONF_CHECK_I(pch_pfit.casf.strength);
PIPE_CONF_CHECK_I(scaler_state.scaler_id);
PIPE_CONF_CHECK_I(pixel_rate);
- PIPE_CONF_CHECK_BOOL(hw.casf_params.enable);
- PIPE_CONF_CHECK_I(hw.casf_params.win_size);
- PIPE_CONF_CHECK_I(hw.casf_params.strength);
PIPE_CONF_CHECK_X(gamma_mode);
if (display->platform.cherryview)
@@ -6819,7 +6819,7 @@ static void intel_pre_update_crtc(struct intel_atomic_state *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)
+ else if (new_crtc_state->pch_pfit.casf.strength != old_crtc_state->pch_pfit.casf.strength)
intel_casf_update_strength(new_crtc_state);
intel_fbc_update(state, crtc);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index af0d870de342..ca2581fb7bbd 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1037,7 +1037,6 @@ struct intel_crtc_state {
struct drm_display_mode mode, pipe_mode, adjusted_mode;
enum drm_scaling_filter scaling_filter;
u8 sharpness_strength;
- struct intel_casf casf_params;
} hw;
/* actual state of LUTs */
@@ -1224,6 +1223,7 @@ struct intel_crtc_state {
/* Panel fitter placement and size for Ironlake+ */
struct {
+ struct intel_casf casf;
struct drm_rect dst;
bool enabled;
bool force_thru;
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index cfa17ddb4018..e9fe5c0bf6ff 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -986,13 +986,13 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
if (HAS_CASF(display) && id == 1)
intel_casf_sharpness_get_config(crtc_state);
- if (!crtc_state->hw.casf_params.enable)
+ if (!crtc_state->pch_pfit.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));
- if (!crtc_state->hw.casf_params.enable)
+ if (!crtc_state->pch_pfit.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),
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/9] drm/i915/casf: Extract scaler_has_casf()
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (2 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 3/9] drm/i915/casf: Move the casf state to better place Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 5/9] drm/i915/casf: Handle CASF in skl_scaler_get_filter_select() Ville Syrjala
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Extract a small helper to determine if the scaler supports
the sharpness filter or not.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/skl_scaler.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index e9fe5c0bf6ff..525afd736195 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -323,19 +323,24 @@ int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
need_scaler);
}
+static bool scaler_has_casf(struct intel_display *display, int scaler_id)
+{
+ return HAS_CASF(display) && scaler_id == 1;
+}
+
static int intel_allocate_scaler(struct intel_crtc_scaler_state *scaler_state,
struct intel_crtc *crtc,
struct intel_plane_state *plane_state,
bool casf_scaler)
{
+ struct intel_display *display = to_intel_display(crtc);
int i;
for (i = 0; i < crtc->num_scalers; i++) {
if (scaler_state->scalers[i].in_use)
continue;
- /* CASF needs second scaler */
- if (!plane_state && casf_scaler && i != 1)
+ if (casf_scaler && !scaler_has_casf(display, i))
continue;
scaler_state->scalers[i].in_use = true;
@@ -982,8 +987,7 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
id = i;
- /* Read CASF regs for second scaler */
- if (HAS_CASF(display) && id == 1)
+ if (scaler_has_casf(display, i))
intel_casf_sharpness_get_config(crtc_state);
if (!crtc_state->pch_pfit.casf.enable)
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 5/9] drm/i915/casf: Handle CASF in skl_scaler_get_filter_select()
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (3 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 4/9] drm/i915/casf: Extract scaler_has_casf() Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 6/9] drm/i915/casf: Constify crtc_state Ville Syrjala
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Nuke the duplicate CASF_SCALER_FILTER_SELECT and just have
skl_scaler_get_filter_select() return the proper value for
sharpness filter use. It is the same "use programmable coefficients"
value we already use for the nearest neighbor filtering.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/skl_scaler.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 525afd736195..d8bf65c6b4a7 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -730,9 +730,9 @@ static void glk_program_nearest_filter_coefs(struct intel_display *display,
GLK_PS_COEF_INDEX_SET(pipe, id, set), 0);
}
-static u32 skl_scaler_get_filter_select(enum drm_scaling_filter filter)
+static u32 skl_scaler_get_filter_select(enum drm_scaling_filter filter, bool casf)
{
- if (filter == DRM_SCALING_FILTER_NEAREST_NEIGHBOR)
+ if (filter == DRM_SCALING_FILTER_NEAREST_NEIGHBOR || casf)
return (PS_FILTER_PROGRAMMED |
PS_Y_VERT_FILTER_SELECT(0) |
PS_Y_HORZ_FILTER_SELECT(0) |
@@ -757,13 +757,6 @@ static void skl_scaler_setup_filter(struct intel_display *display,
}
}
-#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))
-
void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -794,7 +787,7 @@ void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state)
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;
+ skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, true);
intel_de_write_fw(display, SKL_PS_CTRL(pipe, id), ps_ctrl);
intel_de_write_fw(display, SKL_PS_WIN_POS(pipe, id),
@@ -844,7 +837,7 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
id = scaler_state->scaler_id;
ps_ctrl = PS_SCALER_EN | PS_BINDING_PIPE | scaler_state->scalers[id].mode |
- skl_scaler_get_filter_select(crtc_state->hw.scaling_filter);
+ skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, false);
trace_intel_pipe_scaler_update_arm(crtc, id, x, y, width, height);
@@ -910,7 +903,7 @@ skl_program_plane_scaler(struct intel_dsb *dsb,
}
ps_ctrl = PS_SCALER_EN | PS_BINDING_PLANE(plane->id) | scaler->mode |
- skl_scaler_get_filter_select(plane_state->hw.scaling_filter);
+ skl_scaler_get_filter_select(plane_state->hw.scaling_filter, false);
trace_intel_plane_scaler_update_arm(plane, scaler_id,
crtc_x, crtc_y, crtc_w, crtc_h);
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 6/9] drm/i915/casf: Constify crtc_state
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (4 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 5/9] drm/i915/casf: Handle CASF in skl_scaler_get_filter_select() Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 7/9] drm/i915/casf: Remove redundant argument from intel_casf_filter_lut_load() Ville Syrjala
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Make the crtc_state const everywhere in the sharpness filter
code where it doesn't need to be mutated.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 8 ++++----
drivers/gpu/drm/i915/display/intel_casf.h | 4 ++--
drivers/gpu/drm/i915/display/skl_scaler.c | 8 ++++----
drivers/gpu/drm/i915/display/skl_scaler.h | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 5a8ffb40d30d..f777aae3fc57 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -75,7 +75,7 @@ static void intel_casf_filter_lut_load(struct intel_crtc *crtc,
sharpness_lut[i]);
}
-void intel_casf_update_strength(struct intel_crtc_state *crtc_state)
+void intel_casf_update_strength(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);
@@ -174,7 +174,7 @@ static int casf_coeff_tap(int i)
return i % SCALER_FILTER_NUM_TAPS;
}
-static u32 casf_coeff(struct intel_crtc_state *crtc_state, int t)
+static u32 casf_coeff(const struct intel_crtc_state *crtc_state, int t)
{
struct scaler_filter_coeff value;
u32 coeff;
@@ -192,7 +192,7 @@ static u32 casf_coeff(struct intel_crtc_state *crtc_state, int t)
* that are calculated and stored in pch_pfit.casf.coeff as per
* SCALER_COEFFICIENT_FORMAT
*/
-static void intel_casf_write_coeff(struct intel_crtc_state *crtc_state)
+static void intel_casf_write_coeff(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);
@@ -264,7 +264,7 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
}
}
-void intel_casf_enable(struct intel_crtc_state *crtc_state)
+void intel_casf_enable(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);
diff --git a/drivers/gpu/drm/i915/display/intel_casf.h b/drivers/gpu/drm/i915/display/intel_casf.h
index b3fb0bcb3f5b..c4f984b73348 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.h
+++ b/drivers/gpu/drm/i915/display/intel_casf.h
@@ -11,9 +11,9 @@
struct intel_crtc_state;
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_update_strength(const struct intel_crtc_state *new_crtc_state);
void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state);
-void intel_casf_enable(struct intel_crtc_state *crtc_state);
+void intel_casf_enable(const struct intel_crtc_state *crtc_state);
void intel_casf_disable(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);
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index d8bf65c6b4a7..762f4bb46c2d 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -757,13 +757,13 @@ static void skl_scaler_setup_filter(struct intel_display *display,
}
}
-void skl_scaler_setup_casf(struct intel_crtc_state *crtc_state)
+void skl_scaler_setup_casf(const 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 =
+ const struct drm_display_mode *adjusted_mode =
+ &crtc_state->hw.adjusted_mode;
+ const struct intel_crtc_scaler_state *scaler_state =
&crtc_state->scaler_state;
struct drm_rect src, dest;
int id, width, height;
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.h b/drivers/gpu/drm/i915/display/skl_scaler.h
index 7e8d819c019d..20ecf373eb19 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.h
+++ b/drivers/gpu/drm/i915/display/skl_scaler.h
@@ -36,7 +36,7 @@ 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);
+void skl_scaler_setup_casf(const struct intel_crtc_state *crtc_state);
enum drm_mode_status
skl_scaler_mode_valid(struct intel_display *display,
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 7/9] drm/i915/casf: Remove redundant argument from intel_casf_filter_lut_load()
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (5 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 6/9] drm/i915/casf: Constify crtc_state Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 8/9] drm/i915/pfit: Call intel_pfit_compute_config() unconditionally on (e)DP/HDMI Ville Syrjala
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
intel_casf_filter_lut_load() can find the crtc from the crtc_state.
No need to pass in both.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index f777aae3fc57..21e84a4f9ff5 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -61,10 +61,10 @@ const u16 filtercoeff_3[] = {
FILTER_COEFF_0_125,
};
-static void intel_casf_filter_lut_load(struct intel_crtc *crtc,
- const struct intel_crtc_state *crtc_state)
+static void intel_casf_filter_lut_load(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);
int i;
intel_de_write(display, SHRPLUT_INDEX(crtc->pipe),
@@ -270,7 +270,7 @@ void intel_casf_enable(const struct intel_crtc_state *crtc_state)
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
u32 sharpness_ctl;
- intel_casf_filter_lut_load(crtc, crtc_state);
+ intel_casf_filter_lut_load(crtc_state);
intel_casf_write_coeff(crtc_state);
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 8/9] drm/i915/pfit: Call intel_pfit_compute_config() unconditionally on (e)DP/HDMI
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (6 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 7/9] drm/i915/casf: Remove redundant argument from intel_casf_filter_lut_load() Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 9/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Michał Grzelak, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
We now have three different reasons for calling
intel_pfit_compute_config():
- actual pfit scaling/centering
- YCbCr 4:2:0 output
- sharpness filter
So let's just call intel_pfit_compute_config() unconditionally
from both the DP and HDMI code. Both gmch and ilk+ pfit code
should be capable of judging whether anything actually
needs the pfit.
The only slightly questionable thing in the gmch code is
the dithering knob, but that's only a thing on gen2/3 which
don't even have HDMI/DP outputs, and so not an issue here.
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 9 +++------
drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +++-----
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 4955bd8b11d7..ff3904b77492 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3545,12 +3545,9 @@ intel_dp_compute_config(struct intel_encoder *encoder,
if (ret)
return ret;
- if ((intel_dp_is_edp(intel_dp) && fixed_mode) ||
- pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
- ret = intel_pfit_compute_config(pipe_config, conn_state);
- if (ret)
- return ret;
- }
+ ret = intel_pfit_compute_config(pipe_config, conn_state);
+ if (ret)
+ return ret;
pipe_config->limited_color_range =
intel_dp_limited_color_range(pipe_config, conn_state);
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 05e898d10a2b..17bd2c207453 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2380,11 +2380,9 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
return ret;
}
- if (intel_hdmi_is_ycbcr420(pipe_config)) {
- ret = intel_pfit_compute_config(pipe_config, conn_state);
- if (ret)
- return ret;
- }
+ ret = intel_pfit_compute_config(pipe_config, conn_state);
+ if (ret)
+ return ret;
pipe_config->limited_color_range =
intel_hdmi_limited_color_range(pipe_config, conn_state);
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 9/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (7 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 8/9] drm/i915/pfit: Call intel_pfit_compute_config() unconditionally on (e)DP/HDMI Ville Syrjala
@ 2026-04-07 17:52 ` Ville Syrjala
2026-04-07 21:04 ` ✗ i915.CI.BAT: failure for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev2) Patchwork
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-04-07 17:52 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, Nemesa Garg
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The sharpness filter is just a special mode of the pipe scaler.
It doesn't warrant all this special casing everywhere. Just
integrate it properly into the scaler code so that it's treated
no different from the other pipe scaler uses (scaling,centering,
YCbCr 4:2:0 output).
v2: Also reject scaling_filter vs. sharpness
Reviewed-by: Nemesa Garg <nemesa.garg@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_casf.c | 62 ++------------
drivers/gpu/drm/i915/display/intel_casf.h | 6 +-
drivers/gpu/drm/i915/display/intel_display.c | 34 +-------
drivers/gpu/drm/i915/display/intel_pfit.c | 13 ++-
drivers/gpu/drm/i915/display/skl_scaler.c | 85 ++++++++------------
drivers/gpu/drm/i915/display/skl_scaler.h | 2 -
6 files changed, 53 insertions(+), 149 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_casf.c b/drivers/gpu/drm/i915/display/intel_casf.c
index 21e84a4f9ff5..c2d2746c5f04 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.c
+++ b/drivers/gpu/drm/i915/display/intel_casf.c
@@ -75,20 +75,6 @@ static void intel_casf_filter_lut_load(const struct intel_crtc_state *crtc_state
sharpness_lut[i]);
}
-void intel_casf_update_strength(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);
- int win_size;
-
- intel_de_rmw(display, SHARPNESS_CTL(crtc->pipe), FILTER_STRENGTH_MASK,
- FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength));
-
- win_size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, 1));
-
- intel_de_write_fw(display, SKL_PS_WIN_SZ(crtc->pipe, 1), win_size);
-}
-
static void intel_casf_compute_win_size(struct intel_crtc_state *crtc_state)
{
const struct drm_display_mode *mode = &crtc_state->hw.adjusted_mode;
@@ -102,19 +88,15 @@ static void intel_casf_compute_win_size(struct intel_crtc_state *crtc_state)
crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_7X7;
}
+static void intel_casf_scaler_compute_coef(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))
+ if (crtc_state->hw.sharpness_strength == 0)
return 0;
- if (crtc_state->hw.sharpness_strength == 0) {
- crtc_state->pch_pfit.casf.enable = false;
- crtc_state->pch_pfit.casf.strength = 0;
- return 0;
- }
-
/* CASF with joiner not supported in hardware */
if (crtc_state->joiner_pipes) {
drm_dbg_kms(display->drm, "CASF not supported with joiner\n");
@@ -136,7 +118,7 @@ int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
intel_casf_compute_win_size(crtc_state);
- intel_casf_scaler_compute_config(crtc_state);
+ intel_casf_scaler_compute_coef(crtc_state);
return 0;
}
@@ -161,14 +143,6 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state)
}
}
-bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state)
-{
- if (crtc_state->pch_pfit.casf.enable)
- return true;
-
- return false;
-}
-
static int casf_coeff_tap(int i)
{
return i % SCALER_FILTER_NUM_TAPS;
@@ -240,7 +214,7 @@ static void convert_sharpness_coef_binary(struct scaler_filter_coeff *coeff,
}
}
-void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
+static void intel_casf_scaler_compute_coef(struct intel_crtc_state *crtc_state)
{
const u16 *filtercoeff;
u16 filter_coeff[SCALER_FILTER_NUM_TAPS];
@@ -264,32 +238,8 @@ void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state)
}
}
-void intel_casf_enable(const struct intel_crtc_state *crtc_state)
+void intel_casf_setup(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);
- u32 sharpness_ctl;
-
intel_casf_filter_lut_load(crtc_state);
-
intel_casf_write_coeff(crtc_state);
-
- sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength);
-
- sharpness_ctl |= crtc_state->pch_pfit.casf.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, SKL_PS_CTRL(crtc->pipe, 1), 0);
- intel_de_write(display, SKL_PS_WIN_POS(crtc->pipe, 1), 0);
- intel_de_write(display, SHARPNESS_CTL(crtc->pipe), 0);
- intel_de_write(display, SKL_PS_WIN_SZ(crtc->pipe, 1), 0);
}
diff --git a/drivers/gpu/drm/i915/display/intel_casf.h b/drivers/gpu/drm/i915/display/intel_casf.h
index c4f984b73348..3ebb7522af0a 100644
--- a/drivers/gpu/drm/i915/display/intel_casf.h
+++ b/drivers/gpu/drm/i915/display/intel_casf.h
@@ -11,11 +11,7 @@
struct intel_crtc_state;
int intel_casf_compute_config(struct intel_crtc_state *crtc_state);
-void intel_casf_update_strength(const struct intel_crtc_state *new_crtc_state);
void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state);
-void intel_casf_enable(const struct intel_crtc_state *crtc_state);
-void intel_casf_disable(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_setup(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 e02e69467871..58a654ca0d20 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -58,7 +58,6 @@
#include "intel_audio.h"
#include "intel_bo.h"
#include "intel_bw.h"
-#include "intel_casf.h"
#include "intel_cdclk.h"
#include "intel_clock_gating.h"
#include "intel_color.h"
@@ -988,24 +987,6 @@ 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(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
-}
-
-static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
- const struct intel_crtc_state *new_crtc_state)
-{
- if (!new_crtc_state->hw.active)
- return false;
-
- return is_disabling(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
-}
-
static bool intel_crtc_lobf_enabling(const struct intel_crtc_state *old_crtc_state,
const struct intel_crtc_state *new_crtc_state)
{
@@ -1187,9 +1168,6 @@ 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);
if (hsw_ips_pre_update(state, crtc))
@@ -4308,14 +4286,9 @@ 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(display) >= 9) {
if (intel_crtc_needs_modeset(crtc_state) ||
- intel_crtc_needs_fastset(crtc_state) ||
- intel_casf_needs_scaler(crtc_state)) {
+ intel_crtc_needs_fastset(crtc_state)) {
ret = skl_update_scaler_crtc(crtc_state);
if (ret)
return ret;
@@ -6817,11 +6790,6 @@ 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->pch_pfit.casf.strength != old_crtc_state->pch_pfit.casf.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));
diff --git a/drivers/gpu/drm/i915/display/intel_pfit.c b/drivers/gpu/drm/i915/display/intel_pfit.c
index 2dec4ccf74ce..5b170c74a510 100644
--- a/drivers/gpu/drm/i915/display/intel_pfit.c
+++ b/drivers/gpu/drm/i915/display/intel_pfit.c
@@ -196,7 +196,8 @@ static int pch_panel_fitting(struct intel_crtc_state *crtc_state,
/* Native modes don't need fitting */
if (adjusted_mode->crtc_hdisplay == pipe_src_w &&
adjusted_mode->crtc_vdisplay == pipe_src_h &&
- crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420)
+ crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420 &&
+ crtc_state->hw.sharpness_strength == 0)
return 0;
switch (conn_state->scaling_mode) {
@@ -260,6 +261,16 @@ static int pch_panel_fitting(struct intel_crtc_state *crtc_state,
return -EINVAL;
}
+ if (crtc_state->hw.sharpness_strength &&
+ (width != pipe_src_w || height != pipe_src_h ||
+ crtc_state->hw.scaling_filter != DRM_SCALING_FILTER_DEFAULT ||
+ crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB)) {
+ drm_dbg_kms(display->drm,
+ "[CRTC:%d:%s] no scaling/YCbCr output with sharpness filter\n",
+ crtc->base.base.id, crtc->base.name);
+ return -EINVAL;
+ }
+
drm_rect_init(&crtc_state->pch_pfit.dst,
x, y, width, height);
crtc_state->pch_pfit.enabled = true;
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 762f4bb46c2d..308b8d363bba 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -270,6 +270,11 @@ int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state)
{
const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;
int width, height;
+ int ret;
+
+ ret = intel_casf_compute_config(crtc_state);
+ if (ret)
+ return ret;
if (crtc_state->pch_pfit.enabled) {
width = drm_rect_width(&crtc_state->pch_pfit.dst);
@@ -284,8 +289,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state)
drm_rect_width(&crtc_state->pipe_src),
drm_rect_height(&crtc_state->pipe_src),
width, height, NULL, 0,
- crtc_state->pch_pfit.enabled ||
- intel_casf_needs_scaler(crtc_state));
+ crtc_state->pch_pfit.enabled);
}
/**
@@ -534,14 +538,11 @@ static int setup_crtc_scaler(struct intel_atomic_state *state,
struct intel_crtc_scaler_state *scaler_state =
&crtc_state->scaler_state;
- if (intel_casf_needs_scaler(crtc_state) && crtc_state->pch_pfit.enabled)
- return -EINVAL;
-
return intel_atomic_setup_scaler(crtc_state,
hweight32(scaler_state->scaler_users),
crtc, "CRTC", crtc->base.base.id,
NULL, &scaler_state->scaler_id,
- intel_casf_needs_scaler(crtc_state));
+ crtc_state->pch_pfit.casf.enable);
}
static int setup_plane_scaler(struct intel_atomic_state *state,
@@ -757,43 +758,14 @@ static void skl_scaler_setup_filter(struct intel_display *display,
}
}
-void skl_scaler_setup_casf(const struct intel_crtc_state *crtc_state)
+static u32 casf_sharpness_ctl(const 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);
- const struct drm_display_mode *adjusted_mode =
- &crtc_state->hw.adjusted_mode;
- const 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;
+ if (!crtc_state->pch_pfit.casf.enable)
+ return 0;
- 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 |
- skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, true);
-
- 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));
+ return FILTER_EN |
+ FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength) |
+ crtc_state->pch_pfit.casf.win_size;
}
void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
@@ -837,12 +809,20 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
id = scaler_state->scaler_id;
ps_ctrl = PS_SCALER_EN | PS_BINDING_PIPE | scaler_state->scalers[id].mode |
- skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, false);
+ skl_scaler_get_filter_select(crtc_state->hw.scaling_filter,
+ crtc_state->pch_pfit.casf.enable);
trace_intel_pipe_scaler_update_arm(crtc, id, x, y, width, height);
- skl_scaler_setup_filter(display, NULL, pipe, id, 0,
- crtc_state->hw.scaling_filter);
+ if (crtc_state->pch_pfit.casf.enable)
+ intel_casf_setup(crtc_state);
+ else
+ skl_scaler_setup_filter(display, NULL, pipe, id, 0,
+ crtc_state->hw.scaling_filter);
+
+ if (scaler_has_casf(display, id))
+ intel_de_write_fw(display, SHARPNESS_CTL(crtc->pipe),
+ casf_sharpness_ctl(crtc_state));
intel_de_write_fw(display, SKL_PS_CTRL(pipe, id), ps_ctrl);
@@ -930,6 +910,9 @@ static void skl_detach_scaler(struct intel_dsb *dsb,
trace_intel_scaler_disable_arm(crtc, id);
+ if (scaler_has_casf(display, id))
+ intel_de_write_dsb(display, dsb, SHARPNESS_CTL(crtc->pipe), 0);
+
intel_de_write_dsb(display, dsb, SKL_PS_CTRL(crtc->pipe, id), 0);
intel_de_write_dsb(display, dsb, SKL_PS_WIN_POS(crtc->pipe, id), 0);
intel_de_write_dsb(display, dsb, SKL_PS_WIN_SZ(crtc->pipe, id), 0);
@@ -983,18 +966,16 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
if (scaler_has_casf(display, i))
intel_casf_sharpness_get_config(crtc_state);
- if (!crtc_state->pch_pfit.casf.enable)
- crtc_state->pch_pfit.enabled = true;
+ 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));
- if (!crtc_state->pch_pfit.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));
+ 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;
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.h b/drivers/gpu/drm/i915/display/skl_scaler.h
index 20ecf373eb19..5deabca909e6 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.h
+++ b/drivers/gpu/drm/i915/display/skl_scaler.h
@@ -36,8 +36,6 @@ 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(const struct intel_crtc_state *crtc_state);
-
enum drm_mode_status
skl_scaler_mode_valid(struct intel_display *display,
const struct drm_display_mode *mode,
--
2.52.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* ✗ i915.CI.BAT: failure for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev2)
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (8 preceding siblings ...)
2026-04-07 17:52 ` [PATCH v2 9/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
@ 2026-04-07 21:04 ` Patchwork
2026-04-08 0:04 ` ✓ i915.CI.BAT: success for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3) Patchwork
2026-04-08 9:15 ` ✓ i915.CI.Full: " Patchwork
11 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2026-04-07 21:04 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]
== Series Details ==
Series: drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev2)
URL : https://patchwork.freedesktop.org/series/163953/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_18288 -> Patchwork_163953v2
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_163953v2 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_163953v2, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v2/index.html
Participating hosts (42 -> 40)
------------------------------
Missing (2): bat-dg2-13 fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_163953v2:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live:
- fi-ilk-650: [PASS][1] -> [ABORT][2] +1 other test abort
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18288/fi-ilk-650/igt@i915_selftest@live.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v2/fi-ilk-650/igt@i915_selftest@live.html
Known issues
------------
Here are the changes found in Patchwork_163953v2 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@workarounds:
- bat-mtlp-9: [PASS][3] -> [DMESG-FAIL][4] ([i915#12061]) +1 other test dmesg-fail
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18288/bat-mtlp-9/igt@i915_selftest@live@workarounds.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v2/bat-mtlp-9/igt@i915_selftest@live@workarounds.html
#### Possible fixes ####
* igt@i915_selftest@live:
- bat-dg2-8: [DMESG-FAIL][5] ([i915#12061]) -> [PASS][6] +1 other test pass
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18288/bat-dg2-8/igt@i915_selftest@live.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v2/bat-dg2-8/igt@i915_selftest@live.html
[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
Build changes
-------------
* Linux: CI_DRM_18288 -> Patchwork_163953v2
CI-20190529: 20190529
CI_DRM_18288: 5d432393fd501865b269b97f4cc7574dd6a8237f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8850: 8850
Patchwork_163953v2: 5d432393fd501865b269b97f4cc7574dd6a8237f @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v2/index.html
[-- Attachment #2: Type: text/html, Size: 3520 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ i915.CI.BAT: success for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3)
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (9 preceding siblings ...)
2026-04-07 21:04 ` ✗ i915.CI.BAT: failure for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev2) Patchwork
@ 2026-04-08 0:04 ` Patchwork
2026-04-08 9:15 ` ✓ i915.CI.Full: " Patchwork
11 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2026-04-08 0:04 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 3873 bytes --]
== Series Details ==
Series: drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3)
URL : https://patchwork.freedesktop.org/series/163953/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_18290 -> Patchwork_163953v3
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/index.html
Participating hosts (42 -> 40)
------------------------------
Missing (2): bat-dg2-13 fi-snb-2520m
Known issues
------------
Here are the changes found in Patchwork_163953v3 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@core_auth@basic-auth:
- bat-adlp-9: [PASS][1] -> [DMESG-WARN][2] ([i915#15673])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/bat-adlp-9/igt@core_auth@basic-auth.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/bat-adlp-9/igt@core_auth@basic-auth.html
* igt@i915_selftest@live:
- bat-dg2-8: [PASS][3] -> [DMESG-FAIL][4] ([i915#12061]) +1 other test dmesg-fail
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/bat-dg2-8/igt@i915_selftest@live.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/bat-dg2-8/igt@i915_selftest@live.html
* igt@i915_selftest@live@workarounds:
- bat-arls-5: [PASS][5] -> [DMESG-FAIL][6] ([i915#12061]) +1 other test dmesg-fail
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/bat-arls-5/igt@i915_selftest@live@workarounds.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/bat-arls-5/igt@i915_selftest@live@workarounds.html
- bat-dg2-14: [PASS][7] -> [DMESG-FAIL][8] ([i915#12061]) +1 other test dmesg-fail
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/bat-dg2-14/igt@i915_selftest@live@workarounds.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/bat-dg2-14/igt@i915_selftest@live@workarounds.html
* igt@kms_hdmi_inject@inject-audio:
- fi-tgl-1115g4: [PASS][9] -> [FAIL][10] ([i915#14867])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/fi-tgl-1115g4/igt@kms_hdmi_inject@inject-audio.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/fi-tgl-1115g4/igt@kms_hdmi_inject@inject-audio.html
#### Possible fixes ####
* igt@core_debugfs@read-all-entries:
- bat-adlp-9: [DMESG-WARN][11] ([i915#15673]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/bat-adlp-9/igt@core_debugfs@read-all-entries.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/bat-adlp-9/igt@core_debugfs@read-all-entries.html
* igt@i915_selftest@live@active:
- fi-bsw-nick: [DMESG-FAIL][13] ([i915#14808]) -> [PASS][14] +1 other test pass
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18290/fi-bsw-nick/igt@i915_selftest@live@active.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/fi-bsw-nick/igt@i915_selftest@live@active.html
[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
[i915#14808]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14808
[i915#14867]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14867
[i915#15673]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15673
Build changes
-------------
* Linux: CI_DRM_18290 -> Patchwork_163953v3
CI-20190529: 20190529
CI_DRM_18290: 2dc939ed1bd66b5eac479a95968188a87de9cf81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8850: 8850
Patchwork_163953v3: 2dc939ed1bd66b5eac479a95968188a87de9cf81 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/index.html
[-- Attachment #2: Type: text/html, Size: 4841 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ i915.CI.Full: success for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3)
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
` (10 preceding siblings ...)
2026-04-08 0:04 ` ✓ i915.CI.BAT: success for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3) Patchwork
@ 2026-04-08 9:15 ` Patchwork
11 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2026-04-08 9:15 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]
== Series Details ==
Series: drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3)
URL : https://patchwork.freedesktop.org/series/163953/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_18290_full -> Patchwork_163953v3_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Changes
-------
No changes found
Build changes
-------------
* IGT: IGT_8850 -> None
* Linux: CI_DRM_18290 -> Patchwork_163953v3
CI-20190529: 20190529
CI_DRM_18290: 2dc939ed1bd66b5eac479a95968188a87de9cf81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8850: 8850
Patchwork_163953v3: 2dc939ed1bd66b5eac479a95968188a87de9cf81 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_163953v3/index.html
[-- Attachment #2: Type: text/html, Size: 1652 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-04-08 9:15 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 17:52 [PATCH v2 0/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 1/9] drm/i915/casf: s/casf_enable/enable/ Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 2/9] drm/i915/casf: Make a proper hw state copy of the sharpness_strength Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 3/9] drm/i915/casf: Move the casf state to better place Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 4/9] drm/i915/casf: Extract scaler_has_casf() Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 5/9] drm/i915/casf: Handle CASF in skl_scaler_get_filter_select() Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 6/9] drm/i915/casf: Constify crtc_state Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 7/9] drm/i915/casf: Remove redundant argument from intel_casf_filter_lut_load() Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 8/9] drm/i915/pfit: Call intel_pfit_compute_config() unconditionally on (e)DP/HDMI Ville Syrjala
2026-04-07 17:52 ` [PATCH v2 9/9] drm/i915/casf: Integrate the sharpness filter properly into the scaler code Ville Syrjala
2026-04-07 21:04 ` ✗ i915.CI.BAT: failure for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev2) Patchwork
2026-04-08 0:04 ` ✓ i915.CI.BAT: success for drm/i915/casf: Integrate the sharpness filter properly into the scaler code (rev3) Patchwork
2026-04-08 9:15 ` ✓ i915.CI.Full: " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox