From: Nemesa Garg Date: Tue, 28 Oct 2025 12:07:45 +0000 (+0530) Subject: drm/i915/display: Enable/disable casf X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39f39d2e9d0edfbd4a2f26ab438b0982ef6611d1;p=thirdparty%2Fkernel%2Flinux.git drm/i915/display: Enable/disable casf Call intel_casf_enable and intel_casf_disable in atomic commit path to enable and disable casf. Call intel_casf_update_strength to only update the desired strength value. v2: Introduce casf_enable here.[Ankit] v3: Use is_disabling in casf_disabling.[Ankit] v4: Swap old_state and new_state param.[Ankit] v5: In disable fn move win_sz after sharpness_ctl. v6: Rebase and update commit message. Signed-off-by: Nemesa Garg Reviewed-by: Ankit Nautiyal Link: https://patch.msgid.link/20251028120747.3027332-10-ankit.k.nautiyal@intel.com Signed-off-by: Jani Nikula --- diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index c82439150eb9d..94fff7c5f8dcc 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -980,6 +980,24 @@ 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(hw.casf_params.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(hw.casf_params.casf_enable, old_crtc_state, new_crtc_state); +} + #undef is_disabling #undef is_enabling @@ -1135,6 +1153,9 @@ 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)) @@ -6735,6 +6756,11 @@ 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->hw.casf_params.strength != old_crtc_state->hw.casf_params.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));