From bfc49df5158de6f6e44d744084d0721417d3e3cc Mon Sep 17 00:00:00 2001 From: Sandy Huang Date: Fri, 19 May 2023 17:20:54 +0800 Subject: [PATCH] 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 Change-Id: I0b8a7de251707bf4737b107b167be73270fe63bc --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 214a785da2d0..e41b0f7cf16a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -4979,19 +4979,19 @@ static void vop2_win_atomic_update(struct vop2_win *win, struct drm_rect *src, s } } - if (dst->x1 + dsp_w > adjusted_mode->hdisplay) { + if (dst->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, dst->x1, dsp_w, adjusted_mode->hdisplay); - dsp_w = adjusted_mode->hdisplay - dst->x1; + vp->id, win->name, dst->x1, dsp_w, adjusted_mode->crtc_hdisplay); + dsp_w = adjusted_mode->crtc_hdisplay - dst->x1; if (dsp_w < 4) dsp_w = 4; actual_w = dsp_w * actual_w / drm_rect_width(dst); } dsp_h = drm_rect_height(dst); - if (dst->y1 + dsp_h > adjusted_mode->vdisplay) { + if (dst->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, dst->y1, dsp_h, adjusted_mode->vdisplay); - dsp_h = adjusted_mode->vdisplay - dst->y1; + vp->id, win->name, dst->y1, dsp_h, adjusted_mode->crtc_vdisplay); + dsp_h = adjusted_mode->crtc_vdisplay - dst->y1; if (dsp_h < 4) dsp_h = 4; actual_h = dsp_h * actual_h / drm_rect_height(dst);