drm/rockchip: vop2: add support for primary plane check

If the plane mask and primary plane both are assigned in DTS, the
primary plane should be included in the plane mask of VPx.

Change-Id: Ie282782aa6f71a177fd61b507893b256261d4dc3
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
Damon Ding
2025-03-18 17:59:27 +08:00
committed by Tao Huang
parent c8de2ce6ad
commit e5ce22e75e

View File

@@ -15336,6 +15336,7 @@ static bool vop2_plane_mask_check(struct vop2 *vop2)
u32 full_plane_mask = 0, plane_mask = 0;
u32 phys_id;
u32 nr_planes;
int primary_plane_id;
int i, j;
/*
@@ -15346,8 +15347,21 @@ static bool vop2_plane_mask_check(struct vop2 *vop2)
for (i = 0; i < vop2_data->nr_vps; i++) {
vp = &vop2->vps[i];
plane_mask = vp->plane_mask;
primary_plane_id = vp->primary_plane_phy_id;
nr_planes = hweight32(plane_mask);
/*
* If the plane mask and primary plane both are assigned in DTS, the
* primary plane should be included in the plane mask of VPx.
*/
if (plane_mask && primary_plane_id != ROCKCHIP_VOP2_PHY_ID_INVALID &&
!(BIT(primary_plane_id) & plane_mask)) {
DRM_WARN("Invalid primary plane %s[0x%lx] for VP%d[plane mask: 0x%08x]\n",
vop2_plane_phys_id_to_string(primary_plane_id),
BIT(primary_plane_id), i, plane_mask);
return false;
}
/*
* Every plane assigned to the specific VP should follow the constraints
* of default &vop2_win.possible_vp_mask.