Commit 52ab7891 authored by Mark Yao's avatar Mark Yao

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: default avatarMark Yao <mark.yao@rock-chips.com>
parent 31e980c5
...@@ -420,6 +420,11 @@ static void vop_enable(struct drm_crtc *crtc) ...@@ -420,6 +420,11 @@ static void vop_enable(struct drm_crtc *crtc)
goto err_disable_aclk; goto err_disable_aclk;
} }
/*
* At here, vop clock & iommu is enable, R/W vop regs would be safe.
*/
vop->is_enabled = true;
spin_lock(&vop->reg_lock); spin_lock(&vop->reg_lock);
VOP_CTRL_SET(vop, standby, 0); VOP_CTRL_SET(vop, standby, 0);
...@@ -430,8 +435,6 @@ static void vop_enable(struct drm_crtc *crtc) ...@@ -430,8 +435,6 @@ static void vop_enable(struct drm_crtc *crtc)
drm_vblank_on(vop->drm_dev, vop->pipe); drm_vblank_on(vop->drm_dev, vop->pipe);
vop->is_enabled = true;
return; return;
err_disable_aclk: err_disable_aclk:
...@@ -462,6 +465,8 @@ static void vop_disable(struct drm_crtc *crtc) ...@@ -462,6 +465,8 @@ static void vop_disable(struct drm_crtc *crtc)
VOP_CTRL_SET(vop, standby, 1); VOP_CTRL_SET(vop, standby, 1);
spin_unlock(&vop->reg_lock); spin_unlock(&vop->reg_lock);
vop->is_enabled = false;
/* /*
* disable dclk to stop frame scan, so we can safely detach iommu, * disable dclk to stop frame scan, so we can safely detach iommu,
*/ */
...@@ -471,8 +476,6 @@ static void vop_disable(struct drm_crtc *crtc) ...@@ -471,8 +476,6 @@ static void vop_disable(struct drm_crtc *crtc)
clk_disable(vop->aclk); clk_disable(vop->aclk);
clk_disable(vop->hclk); clk_disable(vop->hclk);
vop->is_enabled = false;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment