On Thu, 24 Jul 2025, Maarten Lankhorst <d...@lankhorst.se> wrote:
> drm_crtc_accurate_vblank_count takes a spinlock, which we should avoid
> in tracepoints and debug functions.
>
> This also prevents taking the spinlock 2x during the critical
> section of pipe updates.

Don't we have vblank->max_vblank_count != 0 in most cases, and don't we
want accuracy in the rest of the cases?

The commit message should explain why it's okay to make this change.

BR,
Jani.

>
> Link: https://lore.kernel.org/r/20250715101636.906092-9-...@lankhorst.se
> Signed-off-by: Maarten Lankhorst <d...@lankhorst.se>
> ---
>  drivers/gpu/drm/i915/display/intel_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c 
> b/drivers/gpu/drm/i915/display/intel_crtc.c
> index dbdc4d9b2a33c..65a57cadfa3bf 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -85,7 +85,7 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
>               return 0;
>  
>       if (!vblank->max_vblank_count)
> -             return (u32)drm_crtc_accurate_vblank_count(&crtc->base);
> +             return (u32)drm_crtc_vblank_count(&crtc->base);
>  
>       return crtc->base.funcs->get_vblank_counter(&crtc->base);
>  }

-- 
Jani Nikula, Intel

Reply via email to