drm/rockchip: vop3: plane display size check use crtc_* parameter is more correct

Just like some 3D mode, the mode->crtc_* parameter will be recalculate
according the mode->flag, and we use the mode->crtc_* parameter to config
to VOP register, so we need use crtc_* parameter to do plane size check.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I0b8a7de251707bf4737b107b167be73270fe63bc
This commit is contained in:
Sandy Huang
2023-05-19 17:20:54 +08:00
committed by Algea Cao
parent 087ac3c05d
commit ba8db7bd63

View File

@ -3673,18 +3673,18 @@ static void vop2_plane_atomic_update(struct drm_plane *plane, struct drm_plane_s
actual_w = drm_rect_width(src) >> 16;
actual_h = drm_rect_height(src) >> 16;
dsp_w = drm_rect_width(dest);
if (dest->x1 + dsp_w > adjusted_mode->hdisplay) {
if (dest->x1 + dsp_w > adjusted_mode->crtc_hdisplay) {
DRM_ERROR("vp%d %s dest->x1[%d] + dsp_w[%d] exceed mode hdisplay[%d]\n",
vp->id, win->name, dest->x1, dsp_w, adjusted_mode->hdisplay);
vp->id, win->name, dest->x1, dsp_w, adjusted_mode->crtc_hdisplay);
dsp_w = adjusted_mode->hdisplay - dest->x1;
if (dsp_w < 4)
dsp_w = 4;
actual_w = dsp_w * actual_w / drm_rect_width(dest);
}
dsp_h = drm_rect_height(dest);
if (dest->y1 + dsp_h > adjusted_mode->vdisplay) {
if (dest->y1 + dsp_h > adjusted_mode->crtc_vdisplay) {
DRM_ERROR("vp%d %s dest->y1[%d] + dsp_h[%d] exceed mode vdisplay[%d]\n",
vp->id, win->name, dest->y1, dsp_h, adjusted_mode->vdisplay);
vp->id, win->name, dest->y1, dsp_h, adjusted_mode->crtc_vdisplay);
dsp_h = adjusted_mode->vdisplay - dest->y1;
if (dsp_h < 4)
dsp_h = 4;