On Fri, Nov 14, 2025 at 10:57:45AM +0530, Ankit Nautiyal wrote:
> The pre_plane_update and post_plane_update hooks used slightly different
> conditions for LOBF state changes. Rewrite them to be minimal and
> complementary:
> 
>   - pre runs only when LOBF is being disabled (old=1 -> new=0)
>   - post runs only when LOBF is being enabled (old=0 -> new=1),
>     with an early return if PSR is active.
> 
> This will help for subsequent changes to handle LOBF during LRR and
> seamless MN transitions.
> 
> Signed-off-by: Ankit Nautiyal <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c 
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 5cfb9345776a..db2b9608f7f8 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -461,7 +461,8 @@ void intel_alpm_pre_plane_update(struct 
> intel_atomic_state *state,
>       if (DISPLAY_VER(display) < 20)
>               return;
>  
> -     if (crtc_state->has_lobf || crtc_state->has_lobf == 
> old_crtc_state->has_lobf)
> +     if (!old_crtc_state->has_lobf ||
> +         crtc_state->has_lobf == old_crtc_state->has_lobf)
>               return;

Looks to me like these should be converted into

if (intel_crtc_lobf_disabling(...))
        intel_alpm_lobf_disable(...);
and
if (intel_crtc_lobf_enabling(...))
        intel_alpm_lobf_enable(...);

and implemented using is_{enabling,disabling}().

>  
>       for_each_intel_encoder_mask(display->drm, encoder,
> @@ -512,7 +513,10 @@ void intel_alpm_post_plane_update(struct 
> intel_atomic_state *state,
>               intel_atomic_get_old_crtc_state(state, crtc);
>       struct intel_encoder *encoder;
>  
> -     if (crtc_state->has_psr || !crtc_state->has_lobf ||
> +     if (crtc_state->has_psr)
> +             return;
> +
> +     if (!crtc_state->has_lobf ||
>           crtc_state->has_lobf == old_crtc_state->has_lobf)
>               return;
>  
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

Reply via email to