Skip to content

Commit 447fb14

Browse files
trettermmind
authored andcommitted
drm/rockchip: vop2: disable planes when disabling the crtc
The vop2 driver needs to explicitly disable the planes if the crtc is disabled. Unless the planes are explicitly disabled, the address of the last framebuffer is kept in the registers of the VOP2. When re-enabling the encoder after it has been disabled by the driver, the VOP2 will start and read the framebuffer that has been freed but is still pointed to by the register. The iommu will catch these read accesses and print errors. Explicitly disable the planes when the crtc is disabled to reset the registers. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-3-m.tretter@pengutronix.de
1 parent 471bf24 commit 447fb14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,14 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc,
877877
{
878878
struct vop2_video_port *vp = to_vop2_video_port(crtc);
879879
struct vop2 *vop2 = vp->vop2;
880+
struct drm_crtc_state *old_crtc_state;
880881
int ret;
881882

882883
vop2_lock(vop2);
883884

885+
old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
886+
drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, false);
887+
884888
drm_crtc_vblank_off(crtc);
885889

886890
/*

0 commit comments

Comments
 (0)