]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/disp/dpu1: avoid perf update in frame done event
authorKrishna Manikandan <mkrishn@codeaurora.org>
Thu, 27 May 2021 05:07:56 +0000 (10:37 +0530)
committerRob Clark <robdclark@chromium.org>
Wed, 23 Jun 2021 14:32:16 +0000 (07:32 -0700)
Crtc perf update from frame event work can result in
wrong bandwidth and clock update from dpu if the work
is scheduled after the swap state has happened.

Avoid such issues by moving perf update to complete
commit once the frame is accepted by the hardware.

Fixes: a29c8c024165 ("drm/msm/disp/dpu1: fix display underruns during modeset")
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1622092076-5100-1-git-send-email-mkrishn@codeaurora.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

index 3e54dafc2f8af028e1c002a6beb57f3fbd3d5e07..9a5c70c87cc861c33a1e228b2c19d7528209e4fa 100644 (file)
@@ -406,9 +406,6 @@ static void dpu_crtc_frame_event_work(struct kthread_work *work)
                                                                fevent->event);
                }
 
-               if (fevent->event & DPU_ENCODER_FRAME_EVENT_DONE)
-                       dpu_core_perf_crtc_update(crtc, 0, false);
-
                if (fevent->event & (DPU_ENCODER_FRAME_EVENT_DONE
                                        | DPU_ENCODER_FRAME_EVENT_ERROR))
                        frame_done = true;
@@ -476,6 +473,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_core_perf_crtc_update(crtc, 0, false);
        _dpu_crtc_complete_flip(crtc);
 }