From: Jiaxi Zhang <[email protected]> The synchronous and async commit paths acquire a vblank reference before flush, then release it before calling complete_commit. The DPU completion callback reaches dpu_crtc_complete_commit and _dpu_crtc_complete_flip, which sends the pending page-flip event with drm_crtc_send_vblank_event. That function consumes the vblank counter and timestamp.
Release the commit's reference after the completion callback returns. There is then no zero-reference interval between the commit's wait_flush and its remaining event delivery. This matters when immediate vblank IRQ disabling is enabled. Keep the existing enable_commit/disable_commit clock lifetime and CRTC locking, in both commit paths; no callback or wait is moved outside that lifetime. This is a reference-lifetime correction, not an assertion that completion waits for another TE interrupt. It does not impose an always-on IRQ policy or change the encoder's transfer-completion mechanism. Signed-off-by: Jiaxi Zhang <[email protected]> --- diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -91,9 +91,8 @@ kms->funcs->wait_flush(kms, crtc_mask); trace_msm_atomic_wait_flush_finish(crtc_mask); + kms->funcs->complete_commit(kms, crtc_mask); vblank_put(kms, crtc_mask); - - kms->funcs->complete_commit(kms, crtc_mask); unlock_crtcs(kms, crtc_mask); kms->funcs->disable_commit(kms); @@ -310,10 +309,9 @@ kms->funcs->wait_flush(kms, crtc_mask); trace_msm_atomic_wait_flush_finish(crtc_mask); - vblank_put(kms, crtc_mask); - lock_crtcs(kms, crtc_mask); kms->funcs->complete_commit(kms, crtc_mask); + vblank_put(kms, crtc_mask); unlock_crtcs(kms, crtc_mask); kms->funcs->disable_commit(kms);
