From da6e598940eeb0841baa414061d27cc6a744615e Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Mon, 28 Nov 2016 16:32:52 +0800 Subject: [PATCH] drm/rockchip: vop: fix scale abnormal after window power on/off Change-Id: Ifcaddf2f2b1c9c031bdf28ceb80468cfb79ce52b Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 6ac5afff4653..19219c079b4f 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -748,6 +748,12 @@ static void vop_crtc_disable(struct drm_crtc *crtc) struct vop_win *win = &vop->win[i]; spin_lock(&vop->reg_lock); + if (win->phy->scl && win->phy->scl->ext) { + VOP_SCL_SET_EXT(vop, win, yrgb_hor_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, yrgb_ver_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, cbcr_hor_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, cbcr_ver_scl_mode, SCALE_NONE); + } VOP_WIN_SET(vop, win, enable, 0); spin_unlock(&vop->reg_lock); } @@ -923,6 +929,16 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, spin_lock(&vop->reg_lock); + /* + * FIXUP: some of the vop scale would be abnormal after windows power + * on/off so deinit scale to scale_none mode. + */ + if (win->phy->scl && win->phy->scl->ext) { + VOP_SCL_SET_EXT(vop, win, yrgb_hor_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, yrgb_ver_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, cbcr_hor_scl_mode, SCALE_NONE); + VOP_SCL_SET_EXT(vop, win, cbcr_ver_scl_mode, SCALE_NONE); + } VOP_WIN_SET(vop, win, enable, 0); spin_unlock(&vop->reg_lock); -- 2.34.1