From 03b6bb941d4f3eb2b2e6300176b811d6b2d2b4ef Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Tue, 9 Nov 2021 09:28:38 +0800 Subject: [PATCH] drm/rockchip: vop2: No need to check act_width on rk3588 VOP has a limitation of act_width on rk3568: (1) The act_width should align as 4 pixel at afbc mode (2) can't handle a act_width % 16 = 1 VOP on rk3588 has no such limitation. Signed-off-by: Andy Yan Change-Id: I56f2ff32ac384bff81b6b911cd10ef599e5f44c3 --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 095c3a3da022..506d2082d016 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -3638,20 +3638,25 @@ static void vop2_win_atomic_update(struct vop2_win *win, struct drm_rect *src, s } /* - * This is workaround solution for IC design: - * esmart can't support scale down when actual_w % 16 == 1. + * Workaround only for rk3568 vop */ - if (!(win->feature & WIN_FEATURE_AFBDC)) { - if (actual_w > dsp_w && (actual_w & 0xf) == 1) { - DRM_WARN("vp%d %s act_w[%d] MODE 16 == 1\n", vp->id, win->name, actual_w); - actual_w -= 1; + if (vop2->version == VOP_VERSION_RK3568) { + /* + * This is workaround solution for IC design: + * esmart can't support scale down when actual_w % 16 == 1. + */ + if (!(win->feature & WIN_FEATURE_AFBDC)) { + if (actual_w > dsp_w && (actual_w & 0xf) == 1) { + DRM_WARN("vp%d %s act_w[%d] MODE 16 == 1\n", vp->id, win->name, actual_w); + actual_w -= 1; + } } - } - if (vpstate->afbc_en && actual_w % 4) { - DRM_ERROR("vp%d %s actual_w[%d] should align as 4 pixel when enable afbc\n", - vp->id, win->name, actual_w); - actual_w = ALIGN_DOWN(actual_w, 4); + if (vpstate->afbc_en && actual_w % 4) { + DRM_ERROR("vp%d %s actual_w[%d] should align as 4 pixel when enable afbc\n", + vp->id, win->name, actual_w); + actual_w = ALIGN_DOWN(actual_w, 4); + } } act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);