aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2016-09-14 08:54:59 -0400
committerSean Paul <seanpaul@chromium.org>2016-09-21 09:55:51 -0400
commit646ec68718067a3e6b029b72a9a2919178f0f201 (patch)
treeda61c33216315aa6d923d99858798b8f9e87d949 /drivers/gpu
parent81c248f75a130c1ce46c67e8b05b37e8ffbbb33e (diff)
drm/rockchip: Do not enable vblank without event
Originally we needed to enable vblank for any atomic commit to kick the PSR machine, but that was changed and we no longer need to do so from a vblank interrupt. Let's return to original behavior of enabling vblank only if it is really necessary. This essentially reverts commit 5b6804034ae9 ("drm/rockchip: Enable vblank without event"). Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index b6d47dda691a..d3237f84cbdb 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -116,7 +116,6 @@ struct vop {
116 struct device *dev; 116 struct device *dev;
117 struct drm_device *drm_dev; 117 struct drm_device *drm_dev;
118 bool is_enabled; 118 bool is_enabled;
119 bool vblank_active;
120 119
121 /* mutex vsync_ work */ 120 /* mutex vsync_ work */
122 struct mutex vsync_mutex; 121 struct mutex vsync_mutex;
@@ -1131,11 +1130,10 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc,
1131 rockchip_drm_psr_flush(crtc); 1130 rockchip_drm_psr_flush(crtc);
1132 1131
1133 spin_lock_irq(&crtc->dev->event_lock); 1132 spin_lock_irq(&crtc->dev->event_lock);
1134 vop->vblank_active = true;
1135 WARN_ON(drm_crtc_vblank_get(crtc) != 0);
1136 WARN_ON(vop->event);
1137
1138 if (crtc->state->event) { 1133 if (crtc->state->event) {
1134 WARN_ON(drm_crtc_vblank_get(crtc) != 0);
1135 WARN_ON(vop->event);
1136
1139 vop->event = crtc->state->event; 1137 vop->event = crtc->state->event;
1140 crtc->state->event = NULL; 1138 crtc->state->event = NULL;
1141 } 1139 }
@@ -1232,12 +1230,8 @@ static void vop_handle_vblank(struct vop *vop)
1232 spin_lock_irqsave(&drm->event_lock, flags); 1230 spin_lock_irqsave(&drm->event_lock, flags);
1233 if (vop->event) { 1231 if (vop->event) {
1234 drm_crtc_send_vblank_event(crtc, vop->event); 1232 drm_crtc_send_vblank_event(crtc, vop->event);
1235 vop->event = NULL;
1236
1237 }
1238 if (vop->vblank_active) {
1239 vop->vblank_active = false;
1240 drm_crtc_vblank_put(crtc); 1233 drm_crtc_vblank_put(crtc);
1234 vop->event = NULL;
1241 } 1235 }
1242 spin_unlock_irqrestore(&drm->event_lock, flags); 1236 spin_unlock_irqrestore(&drm->event_lock, flags);
1243 1237
@@ -1514,7 +1508,6 @@ static int vop_initial(struct vop *vop)
1514 clk_disable(vop->aclk); 1508 clk_disable(vop->aclk);
1515 1509
1516 vop->is_enabled = false; 1510 vop->is_enabled = false;
1517 vop->vblank_active = false;
1518 1511
1519 return 0; 1512 return 0;
1520 1513