From d3cc85847cb179d1cfa58e012f2e4ab1aa2ea6d0 Mon Sep 17 00:00:00 2001 From: Sandy Huang Date: Wed, 7 Mar 2018 15:09:13 +0800 Subject: [PATCH] drm/rockchip: px30 vop: fix iommu pagefault when disable win2 In the bandwidth tension environment when close win2, vop will access the freed memory lead to iommu pagefault. so we add this reset to workaround. Change-Id: I22b0c0f145d042e3aaf98fb45ffff6304c93963c Signed-off-by: Sandy Huang --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index d844e427f10c..b9eb1c14f984 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1561,6 +1561,15 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, if (win->area_id == 0) VOP_WIN_SET(vop, win, gate, 0); + /* + * IC design bug: in the bandwidth tension environment when close win2, + * vop will access the freed memory lead to iommu pagefault. + * so we add this reset to workaround. + */ + if (VOP_MAJOR(vop->version) == 2 && VOP_MINOR(vop->version) == 5 && + win->win_id == 2) + VOP_WIN_SET(vop, win, yrgb_mst, 0); + spin_unlock(&vop->reg_lock); vop_plane_state->enable = false;