[PATCH 1/2] drm/msm/dpu: move vblank events to complete_commit()

abhinavk at codeaurora.org abhinavk at codeaurora.org
Tue Sep 8 19:06:55 UTC 2020


On 2020-09-07 10:04, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>
> 
> We could get a vblank event racing with the current atomic commit,
> resulting in sending the pageflip event to userspace early, causing
> tearing.  On the other hand, complete_commit() ensures that the
> pending flush is complete.
> 
> Signed-off-by: Rob Clark <robdclark at chromium.org>

I checked our downstream code as well and yes we are not signaling
page flips inside the vblank_cb and are doing it after 
wait_for_commit_done
This aligns with that.
Hence,
Reviewed-by: Abhinav Kumar <abhinavk at codeaurora.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index c2729f71e2fa..89c0245b5de5 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -297,7 +297,6 @@ void dpu_crtc_vblank_callback(struct drm_crtc 
> *crtc)
>  		dpu_crtc->vblank_cb_time = ktime_get();
>  	else
>  		dpu_crtc->vblank_cb_count++;
> -	_dpu_crtc_complete_flip(crtc);
>  	drm_crtc_handle_vblank(crtc);
>  	trace_dpu_crtc_vblank_cb(DRMID(crtc));
>  }
> @@ -402,6 +401,7 @@ static void dpu_crtc_frame_event_cb(void *data, u32 
> event)
>  void dpu_crtc_complete_commit(struct drm_crtc *crtc)
>  {
>  	trace_dpu_crtc_complete_commit(DRMID(crtc));
> +	_dpu_crtc_complete_flip(crtc);
>  }
> 
>  static void _dpu_crtc_setup_lm_bounds(struct drm_crtc *crtc,


More information about the dri-devel mailing list