]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/msm: dpu: Don't queue the frame_done watchdog for cursor
authorSean Paul <seanpaul@chromium.org>
Mon, 28 Jan 2019 20:42:51 +0000 (15:42 -0500)
committerRob Clark <robdclark@chromium.org>
Thu, 18 Apr 2019 17:04:10 +0000 (10:04 -0700)
In the case of an async/cursor update, we don't wait for the frame_done
event, which means handle_frame_done is never called, and the frame_done
watchdog isn't canceled. Currently, this results in a frame_done timeout
every time the cursor moves without a synchronous frame following it up
before the timeout expires. Since we don't wait for frame_done, and
don't handle it, we shouldn't modify the watchdog.

Reviewed-by: Fritz Koenig <frkoenig@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190128204306.95076-4-sean@poorly.run
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

index e8dfdb48016e929123b2cda47aa04fac1944b1ad..472cdb464458622efe983743d7682a02dec1f0e7 100644 (file)
@@ -1791,7 +1791,6 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc, bool async)
 {
        struct dpu_encoder_virt *dpu_enc;
        struct dpu_encoder_phys *phys;
-       unsigned long timeout_ms;
        ktime_t wakeup_time;
        unsigned int i;
 
@@ -1804,12 +1803,20 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc, bool async)
 
        trace_dpu_enc_kickoff(DRMID(drm_enc));
 
-       timeout_ms = DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES * 1000 /
-               drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode);
+       /*
+        * Asynchronous frames don't handle FRAME_DONE events. As such, they
+        * shouldn't enable the frame_done watchdog since it will always time
+        * out.
+        */
+       if (!async) {
+               unsigned long timeout_ms;
+               timeout_ms = DPU_ENCODER_FRAME_DONE_TIMEOUT_FRAMES * 1000 /
+                       drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode);
 
-       atomic_set(&dpu_enc->frame_done_timeout_ms, timeout_ms);
-       mod_timer(&dpu_enc->frame_done_timer,
-                 jiffies + msecs_to_jiffies(timeout_ms));
+               atomic_set(&dpu_enc->frame_done_timeout_ms, timeout_ms);
+               mod_timer(&dpu_enc->frame_done_timer,
+                         jiffies + msecs_to_jiffies(timeout_ms));
+       }
 
        /* All phys encs are ready to go, trigger the kickoff */
        _dpu_encoder_kickoff_phys(dpu_enc, async);