summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2016-08-10 23:24:39 +0300
committerSean Paul <seanpaul@chromium.org>2016-08-23 18:44:37 +0300
commit5b6804034ae9a7e792298786f70b95405730ea90 (patch)
tree6660410cc2a134661e00c1a6043dd55d8a1bef33
parentd761b2df5d30b8a0dc5369390eeb32b7a88bbed5 (diff)
downloadlinux-5b6804034ae9a7e792298786f70b95405730ea90.tar.xz
drm/rockchip: Enable vblank without event
vblank should be enabled regardless of whether an event is expected back. This is especially important for a cursor plane. Reviewed-by: Yakir Yang <ykk@rock-chips.com> Tested-by: Yakir Yang <ykk@rock-chip.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 5eb2b9998d40..790ba917e12d 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -110,6 +110,7 @@ struct vop {
struct device *dev;
struct drm_device *drm_dev;
bool is_enabled;
+ bool vblank_active;
/* mutex vsync_ work */
struct mutex vsync_mutex;
@@ -1090,10 +1091,11 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc,
struct vop *vop = to_vop(crtc);
spin_lock_irq(&crtc->dev->event_lock);
- if (crtc->state->event) {
- WARN_ON(drm_crtc_vblank_get(crtc) != 0);
- WARN_ON(vop->event);
+ vop->vblank_active = true;
+ WARN_ON(drm_crtc_vblank_get(crtc) != 0);
+ WARN_ON(vop->event);
+ if (crtc->state->event) {
vop->event = crtc->state->event;
crtc->state->event = NULL;
}
@@ -1180,12 +1182,14 @@ static void vop_handle_vblank(struct vop *vop)
spin_lock_irqsave(&drm->event_lock, flags);
if (vop->event) {
-
drm_crtc_send_vblank_event(crtc, vop->event);
- drm_crtc_vblank_put(crtc);
vop->event = NULL;
}
+ if (vop->vblank_active) {
+ vop->vblank_active = false;
+ drm_crtc_vblank_put(crtc);
+ }
spin_unlock_irqrestore(&drm->event_lock, flags);
if (!completion_done(&vop->wait_update_complete))
@@ -1455,6 +1459,7 @@ static int vop_initial(struct vop *vop)
clk_disable(vop->aclk);
vop->is_enabled = false;
+ vop->vblank_active = false;
return 0;