drm/rockchip: vop2: check win_mask for each plane on crtc

win_mask is more safe than plane_mask on crtc_state,
because crtc_state may changed by many interface.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I886c8e1e1c0505e46292721de05d9be7c167d956
This commit is contained in:
Andy Yan
2021-05-16 21:08:43 +08:00
committed by Tao Huang
parent c0b3b7be82
commit 96cba3c6bb

View File

@@ -1661,11 +1661,12 @@ static bool vop2_is_allwin_disabled(struct drm_crtc *crtc)
{
struct vop2_video_port *vp = to_vop2_video_port(crtc);
struct vop2 *vop2 = vp->vop2;
struct drm_plane *plane;
unsigned long win_mask = vp->win_mask;
struct vop2_win *win;
int phys_id;
drm_atomic_crtc_for_each_plane(plane, crtc) {
win = to_vop2_win(plane);
for_each_set_bit(phys_id, &win_mask, ROCKCHIP_MAX_LAYER) {
win = vop2_find_win_by_phys_id(vop2, phys_id);
if (VOP_WIN_GET(vop2, win, enable) != 0)
return false;
}
@@ -1677,13 +1678,14 @@ static void vop2_disable_all_planes_for_crtc(struct drm_crtc *crtc)
{
struct vop2_video_port *vp = to_vop2_video_port(crtc);
struct vop2 *vop2 = vp->vop2;
struct drm_plane *plane;
struct vop2_win *win;
unsigned long win_mask = vp->win_mask;
int phys_id, ret;
bool active;
int ret;
drm_atomic_crtc_for_each_plane(plane, crtc) {
win = to_vop2_win(plane);
for_each_set_bit(phys_id, &win_mask, ROCKCHIP_MAX_LAYER) {
win = vop2_find_win_by_phys_id(vop2, phys_id);
vop2_win_disable(win);
}
vop2_cfg_done(crtc);