drm/rockchip: vop2: only when have active win then need to wait win close

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ieaf6497a8597d5d6d3f4a0eb0169fba55c93b4e2
This commit is contained in:
Sandy Huang
2021-06-04 14:13:35 +08:00
committed by Tao Huang
parent 91b41a2818
commit 93f2587f47

View File

@@ -1679,18 +1679,21 @@ static void vop2_disable_all_planes_for_crtc(struct drm_crtc *crtc)
struct vop2_win *win;
unsigned long win_mask = vp->win_mask;
int phys_id, ret;
bool active;
bool active, need_wait_win_disabled = false;
for_each_set_bit(phys_id, &win_mask, ROCKCHIP_MAX_LAYER) {
win = vop2_find_win_by_phys_id(vop2, phys_id);
need_wait_win_disabled |= VOP_WIN_GET(vop2, win, enable);
vop2_win_disable(win);
}
vop2_cfg_done(crtc);
ret = readx_poll_timeout_atomic(vop2_is_allwin_disabled, crtc,
active, active, 0, 500 * 1000);
if (ret)
DRM_DEV_ERROR(vop2->dev, "wait win close timeout\n");
if (need_wait_win_disabled) {
vop2_cfg_done(crtc);
ret = readx_poll_timeout_atomic(vop2_is_allwin_disabled, crtc,
active, active, 0, 500 * 1000);
if (ret)
DRM_DEV_ERROR(vop2->dev, "wait win close timeout\n");
}
}
/*