> -----Original Message-----
> From: Intel-gfx <[email protected]> On Behalf Of Maarten
> Lankhorst
> Sent: Tuesday, November 4, 2025 2:06 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; Maarten Lankhorst <[email protected]>;
> Mario
> Kleiner <[email protected]>; Mike Galbraith
> <[email protected]>; Thomas Gleixner <[email protected]>; Sebastian
> Andrzej Siewior <[email protected]>; Clark Williams
> <[email protected]>; Steven Rostedt <[email protected]>
> Subject: [PATCH v2 3/7] drm/i915/display: Move vblank put until after critical
> section
>
> drm_crtc_vblank_put may take some locks, this should probably not be the first
> thing we do after entering the time sensitive part.
>
> A better place is after programming is completed. Add a flag to put the
> vblank after
> completion.
>
> In the case of drm_vblank_work_schedule, we may not even need to disable the
> vblank interrupt any more if it takes its own reference.
This looks good to me.
Reviewed-by: Uma Shankar <[email protected]>
> Signed-off-by: Maarten Lankhorst <[email protected]>
> ---
> drivers/gpu/drm/i915/display/intel_cursor.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c
> b/drivers/gpu/drm/i915/display/intel_cursor.c
> index 7aa14348aa6d4..6b3bc8d94e51a 100644
> --- a/drivers/gpu/drm/i915/display/intel_cursor.c
> +++ b/drivers/gpu/drm/i915/display/intel_cursor.c
> @@ -816,6 +816,7 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
> to_intel_crtc_state(crtc->base.state);
> struct intel_crtc_state *new_crtc_state;
> struct intel_vblank_evade_ctx evade;
> + bool has_vblank = false;
> int ret;
>
> /*
> @@ -913,6 +914,8 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
> intel_psr_lock(crtc_state);
>
> if (!drm_WARN_ON(display->drm, drm_crtc_vblank_get(&crtc->base))) {
> + has_vblank = true;
> +
> /*
> * TODO: maybe check if we're still in PSR
> * and skip the vblank evasion entirely?
> @@ -922,8 +925,6 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
> local_irq_disable();
>
> intel_vblank_evade(&evade);
> -
> - drm_crtc_vblank_put(&crtc->base);
> } else {
> local_irq_disable();
> }
> @@ -939,6 +940,9 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>
> intel_psr_unlock(crtc_state);
>
> + if (has_vblank)
> + drm_crtc_vblank_put(&crtc->base);
> +
> if (old_plane_state->ggtt_vma != new_plane_state->ggtt_vma) {
> drm_vblank_work_init(&old_plane_state->unpin_work, &crtc-
> >base,
> intel_cursor_unpin_work);
> --
> 2.51.0