mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-10 18:53:38 +00:00
drm/rockchip: vop: reset scale mode when win is disabled
commite9abc611a9
upstream. NV12 framebuffers produced by the VPU shows distorted on RK3288 after win has been disabled when scaling is active. This issue can be reproduced using a 1080p modeset by: - Scale a 1280x720 NV12 framebuffer to 1920x1080 on win0 - Disable win0 - Display a 1920x1080 NV12 framebuffer without scaling on win0 - Output will now show the framebuffer distorted And by: - Scale a 1280x720 NV12 framebuffer to 1920x1080 - Change to a 720p modeset (win gets disabled and scaling reset to none) - Output will now show the framebuffer distorted Fix this by setting scale mode to none when win is disabled. Fixes:4c156c21c7
("drm/rockchip: vop: support plane scale") Cc: stable@vger.kernel.org Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/AM3PR03MB0966DE3E19BACE07328CD637AC7D0@AM3PR03MB0966.eurprd03.prod.outlook.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a93cd9137f
commit
7fb7414da9
1 changed files with 15 additions and 3 deletions
|
@ -505,6 +505,18 @@ static void vop_core_clks_disable(struct vop *vop)
|
|||
clk_disable(vop->hclk);
|
||||
}
|
||||
|
||||
static void vop_win_disable(struct vop *vop, const struct vop_win_data *win)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
static int vop_enable(struct drm_crtc *crtc)
|
||||
{
|
||||
struct vop *vop = to_vop(crtc);
|
||||
|
@ -550,7 +562,7 @@ static int vop_enable(struct drm_crtc *crtc)
|
|||
struct vop_win *vop_win = &vop->win[i];
|
||||
const struct vop_win_data *win = vop_win->data;
|
||||
|
||||
VOP_WIN_SET(vop, win, enable, 0);
|
||||
vop_win_disable(vop, win);
|
||||
}
|
||||
spin_unlock(&vop->reg_lock);
|
||||
|
||||
|
@ -694,7 +706,7 @@ static void vop_plane_atomic_disable(struct drm_plane *plane,
|
|||
|
||||
spin_lock(&vop->reg_lock);
|
||||
|
||||
VOP_WIN_SET(vop, win, enable, 0);
|
||||
vop_win_disable(vop, win);
|
||||
|
||||
spin_unlock(&vop->reg_lock);
|
||||
}
|
||||
|
@ -1449,7 +1461,7 @@ static int vop_initial(struct vop *vop)
|
|||
int channel = i * 2 + 1;
|
||||
|
||||
VOP_WIN_SET(vop, win, channel, (channel + 1) << 4 | channel);
|
||||
VOP_WIN_SET(vop, win, enable, 0);
|
||||
vop_win_disable(vop, win);
|
||||
VOP_WIN_SET(vop, win, gate, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue