On Fri, Oct 17, 2025 at 10:32:00AM +0530, Ankit Nautiyal wrote:
> Check if guardband is sufficient for all DP SDP latencies.
> If its not, fail .compute_config_late().
> 
> Signed-off-by: Ankit Nautiyal <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 3f2c319e3d6f..8ae99cee79d4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -93,6 +93,7 @@
>  #include "intel_psr.h"
>  #include "intel_quirks.h"
>  #include "intel_tc.h"
> +#include "intel_vblank.h"
>  #include "intel_vdsc.h"
>  #include "intel_vrr.h"
>  
> @@ -6980,14 +6981,35 @@ void intel_dp_mst_resume(struct intel_display 
> *display)
>       }
>  }
>  
> +static
> +int intel_dp_sdp_compute_config_late(struct intel_crtc_state *crtc_state)
> +{
> +     struct intel_display *display = to_intel_display(crtc_state);
> +     int guardband = intel_crtc_vblank_length(crtc_state);

In theory we might have enough legacy TG vblank but not VRR guardband
(I suppose that can only happen on ICL/TGL due to the pipeline full
limit) so I was pondering whether we might need to check both. But I
think this is fine. We would just fail when trying to enable VRR in
those cases, but without VRR enabled we can still light up th display.

Reviewed-by: Ville Syrjälä <[email protected]>

> +     int min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
> +
> +     if (guardband < min_sdp_guardband) {
> +             drm_dbg_kms(display->drm, "guardband %d < min sdp guardband 
> %d\n",
> +                         guardband, min_sdp_guardband);
> +             return -EINVAL;
> +     }
> +
> +     return 0;
> +}
> +
>  int intel_dp_compute_config_late(struct intel_encoder *encoder,
>                                struct intel_crtc_state *crtc_state,
>                                struct drm_connector_state *conn_state)
>  {
>       struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> +     int ret;
>  
>       intel_psr_compute_config_late(intel_dp, crtc_state);
>  
> +     ret = intel_dp_sdp_compute_config_late(crtc_state);
> +     if (ret)
> +             return ret;
> +
>       return 0;
>  }
>  
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

Reply via email to