drm/rockchip: vop2: set vop min size to 4x4

Change-Id: I6e11917386400cec306520b52feecf4f78a971f7
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
Sandy Huang
2021-03-12 10:48:08 +08:00
parent 6749d4644b
commit e1370ed7ec

View File

@@ -2505,6 +2505,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta
vpstate->format = vop2_convert_format(fb->format->format);
if (vpstate->format < 0)
return vpstate->format;
if (state->src_w >> 16 < 4 || state->src_h >> 16 < 4 ||
state->crtc_w < 4 || state->crtc_h < 4) {
DRM_ERROR("Invalid size: %dx%d->%dx%d, min size is 4x4\n",
state->src_w >> 16, state->src_h >> 16,
state->crtc_w, state->crtc_h);
return -EINVAL;
}
if (drm_rect_width(src) >> 16 > vop2_data->max_input.width ||
drm_rect_height(src) >> 16 > vop2_data->max_input.height) {
DRM_ERROR("Invalid source: %dx%d. max input: %dx%d\n",