aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorMark Yao <mark.yao@rock-chips.com>2015-01-22 05:29:57 -0500
committerMark Yao <mark.yao@rock-chips.com>2015-03-16 01:50:32 -0400
commit52ab7891fb8e45bda6015da8b5ac82ad600355e3 (patch)
tree9e65cc1eb981f4b4dbd1a334b8d60072b6c17ad6 /drivers/gpu/drm
parent31e980c5a2d35ce411034b7fd842433542c1c60e (diff)
drm/rockchip: vop: set vop enabled after enable iommu
there is a Bug that: vop_enable()->drm_vblank_on, drm_vblank_on may call vop enable vblank. if it happen, vblank enable would failed, then cause irq status error. because is_enabled value is set after drm_vblank_on. after enable vop clocks and iommu regs, we can sure that R/W vop regs and do vop plane flip is safe, so place is_enabled = true after enable iommu is suitable. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index c75117a2f133..04b619a8d064 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -420,6 +420,11 @@ static void vop_enable(struct drm_crtc *crtc)
420 goto err_disable_aclk; 420 goto err_disable_aclk;
421 } 421 }
422 422
423 /*
424 * At here, vop clock & iommu is enable, R/W vop regs would be safe.
425 */
426 vop->is_enabled = true;
427
423 spin_lock(&vop->reg_lock); 428 spin_lock(&vop->reg_lock);
424 429
425 VOP_CTRL_SET(vop, standby, 0); 430 VOP_CTRL_SET(vop, standby, 0);
@@ -430,8 +435,6 @@ static void vop_enable(struct drm_crtc *crtc)
430 435
431 drm_vblank_on(vop->drm_dev, vop->pipe); 436 drm_vblank_on(vop->drm_dev, vop->pipe);
432 437
433 vop->is_enabled = true;
434
435 return; 438 return;
436 439
437err_disable_aclk: 440err_disable_aclk:
@@ -462,6 +465,8 @@ static void vop_disable(struct drm_crtc *crtc)
462 VOP_CTRL_SET(vop, standby, 1); 465 VOP_CTRL_SET(vop, standby, 1);
463 466
464 spin_unlock(&vop->reg_lock); 467 spin_unlock(&vop->reg_lock);
468
469 vop->is_enabled = false;
465 /* 470 /*
466 * disable dclk to stop frame scan, so we can safely detach iommu, 471 * disable dclk to stop frame scan, so we can safely detach iommu,
467 */ 472 */
@@ -471,8 +476,6 @@ static void vop_disable(struct drm_crtc *crtc)
471 476
472 clk_disable(vop->aclk); 477 clk_disable(vop->aclk);
473 clk_disable(vop->hclk); 478 clk_disable(vop->hclk);
474
475 vop->is_enabled = false;
476} 479}
477 480
478/* 481/*