drm/rockchip: vop2: No need to wait when config same VP

Just overwrite config done bit for the same VP.

Change-Id: I41931e0fc595b3bfbf4f0fa04e615c5af2326f70
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
Andy Yan
2021-01-26 09:19:31 +08:00
committed by Tao Huang
parent c75258fee8
commit 2cc91f4dfb

View File

@@ -770,14 +770,17 @@ static inline void vop2_cfg_done(struct drm_crtc *crtc)
/* we have some vp wait for config done take effect */
if (done_bits) {
vp_id = ffs(done_bits) - 1;
done_vp = &vop2->vps[vp_id];
vcstate = to_rockchip_crtc_state(done_vp->crtc.state);
vcnt = vop2_readl(vop2, RK3568_SYS_STATUS0 + (vp_id << 2));
vcnt >>= 16;
/* if close to the last 1/4 frame, wait to next frame */
if (vcnt > (vcstate->vdisplay * 3 >> 2)) {
vop2_wait_for_irq_fs(done_vp);
done_bits = 0;
/* no need to wait for same vp */
if (vp_id != vp->id) {
done_vp = &vop2->vps[vp_id];
vcstate = to_rockchip_crtc_state(done_vp->crtc.state);
vcnt = vop2_readl(vop2, RK3568_SYS_STATUS0 + (vp_id << 2));
vcnt >>= 16;
/* if close to the last 1/4 frame, wait to next frame */
if (vcnt > (vcstate->vdisplay * 3 >> 2)) {
vop2_wait_for_irq_fs(done_vp);
done_bits = 0;
}
}
}
val = RK3568_VOP2_GLB_CFG_DONE_EN | BIT(vp->id) | done_bits;