drm/rockchip: vop: add check if global/pixel alpha both enable

VOP in RK3308 supports global alpha and pixel alpha.
Only one alpha mode can be enabled at the same time.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ia749deeb82a31b7e5298ca14586bbfb75606469f
This commit is contained in:
Damon Ding
2023-06-13 10:53:09 +08:00
committed by Tao Huang
parent 21815401b7
commit 68382fc3ee

View File

@@ -1795,6 +1795,12 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
vop = to_vop(crtc);
vop_data = vop->data;
if (VOP_MAJOR(vop->version) == 2 && is_alpha_support(fb->format->format) &&
vop_plane_state->global_alpha != 0xff) {
DRM_ERROR("Pixel alpha and global alpha can't be enabled at the same time\n");
return -EINVAL;
}
if (drm_rect_width(src) >> 16 < 4 || drm_rect_height(src) >> 16 < 4 ||
drm_rect_width(dest) < 4 || drm_rect_width(dest) < 4) {
DRM_ERROR("Invalid size: %dx%d->%dx%d, min size is 4x4\n",