diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 657e5e84f5bd..bcb5354a11d4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2804,15 +2804,6 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta return -EINVAL; } - src->x1 = state->src_x; - src->y1 = state->src_y; - src->x2 = state->src_x + state->src_w; - src->y2 = state->src_y + state->src_h; - dest->x1 = state->crtc_x; - dest->y1 = state->crtc_y; - - dest->x2 = state->crtc_x + state->crtc_w; - dest->y2 = state->crtc_y + state->crtc_h; ret = drm_atomic_helper_check_plane_state(state, cstate, min_scale, max_scale, @@ -2820,8 +2811,22 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta if (ret) return ret; - if (!state->visible) + if (!state->visible) { + DRM_ERROR("%s is invisible(src: pos[%d, %d] rect[%d x %d] dst: pos[%d, %d] rect[%d x %d]\n", + plane->name, state->src_x >> 16, state->src_y >> 16, state->src_w >> 16, + state->src_h >> 16, state->crtc_x, state->crtc_y, state->crtc_w, + state->crtc_h); return 0; + } + + src->x1 = state->src.x1; + src->y1 = state->src.y1; + src->x2 = state->src.x2; + src->y2 = state->src.y2; + dest->x1 = state->dst.x1; + dest->y1 = state->dst.y1; + dest->x2 = state->dst.x2; + dest->y2 = state->dst.y2; vpstate->zpos = state->zpos; vpstate->global_alpha = state->alpha >> 8; @@ -2830,12 +2835,13 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, struct drm_plane_sta 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) { + 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", - state->src_w >> 16, state->src_h >> 16, - state->crtc_w, state->crtc_h); - return -EINVAL; + drm_rect_width(src) >> 16, drm_rect_height(src) >> 16, + drm_rect_width(dest), drm_rect_height(dest)); + state->visible = false; + return 0; } if (drm_rect_width(src) >> 16 > vop2_data->max_input.width ||