On Fri, Nov 14, 2025 at 10:57:43AM +0530, Ankit Nautiyal wrote:
> LOBF must be disabled if the number of lines within Window 1 is not greater
> than ALPM_CTL[ALPM Entry Check]
> 
> v2: Consider the case where SCL is in the active region. (Ville)
> 
> Bspec:71041
> Signed-off-by: Ankit Nautiyal <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c 
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 98cbf5dde73b..686e4d13f864 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -263,6 +263,23 @@ int intel_alpm_lobf_min_guardband(struct 
> intel_crtc_state *crtc_state)
>       return first_sdp_position + waketime_in_lines + 
> crtc_state->set_context_latency;
>  }
>  
> +static bool intel_alpm_lobf_is_window1_sufficient(struct intel_crtc_state 
> *crtc_state)
> +{
> +     struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
> +     int vblank = adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay;
> +     int window1;
> +
> +     /*
> +      * LOBF must be disabled if the number of lines within Window 1 is not
> +      * greater than ALPM_CTL[ALPM Entry Check]
> +      */
> +     window1 = vblank - min(vblank,
> +                            crtc_state->vrr.guardband +
> +                            crtc_state->set_context_latency);

Dunno why you have the min() here? guardband+SCL can never
exceed the total vblank length.

> +
> +     return window1 > crtc_state->alpm_state.check_entry_lines;
> +}
> +
>  void intel_alpm_lobf_compute_config_late(struct intel_dp *intel_dp,
>                                        struct intel_crtc_state *crtc_state)
>  {
> @@ -272,6 +289,11 @@ void intel_alpm_lobf_compute_config_late(struct intel_dp 
> *intel_dp,
>       if (!crtc_state->has_lobf)
>               return;
>  
> +     if (!intel_alpm_lobf_is_window1_sufficient(crtc_state)) {
> +             crtc_state->has_lobf = false;
> +             return;
> +     }
> +
>       /*
>        * LOBF can only be enabled if the time from the start of the 
> SCL+Guardband
>        * window to the position of the first SDP is greater than the time it 
> takes
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

Reply via email to