Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 87f34fd

Browse files
valpackettgregkh
authored andcommitted
drm/rockchip: vop: clear DMA stop bit on RK3066
commit 6b44aa5 upstream. The RK3066 VOP sets a dma_stop bit when it's done scanning out a frame and needs the driver to acknowledge that by clearing the bit. Unless we clear it "between" frames, the RGB output only shows noise instead of the picture. atomic_flush is the place for it that least affects other code (doing it on vblank would require converting all other usages of the reg_lock to spin_(un)lock_irq, which would affect performance for everyone). This seems to be a redundant synchronization mechanism that was removed in later iterations of the VOP hardware block. Fixes: f4a6de8 ("drm: rockchip: vop: add rk3066 vop definitions") Cc: stable@vger.kernel.org Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240624204054.5524-2-val@packett.cool Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e93dbd5 commit 87f34fd

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

+4
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,10 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
15831583
VOP_AFBC_SET(vop, enable, s->enable_afbc);
15841584
vop_cfg_done(vop);
15851585

1586+
/* Ack the DMA transfer of the previous frame (RK3066). */
1587+
if (VOP_HAS_REG(vop, common, dma_stop))
1588+
VOP_REG_SET(vop, common, dma_stop, 0);
1589+
15861590
spin_unlock(&vop->reg_lock);
15871591

15881592
/*

drivers/gpu/drm/rockchip/rockchip_drm_vop.h

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct vop_common {
122122
struct vop_reg lut_buffer_index;
123123
struct vop_reg gate_en;
124124
struct vop_reg mmu_en;
125+
struct vop_reg dma_stop;
125126
struct vop_reg out_mode;
126127
struct vop_reg standby;
127128
};

drivers/gpu/drm/rockchip/rockchip_vop_reg.c

+1
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static const struct vop_output rk3066_output = {
466466
};
467467

468468
static const struct vop_common rk3066_common = {
469+
.dma_stop = VOP_REG(RK3066_SYS_CTRL0, 0x1, 0),
469470
.standby = VOP_REG(RK3066_SYS_CTRL0, 0x1, 1),
470471
.out_mode = VOP_REG(RK3066_DSP_CTRL0, 0xf, 0),
471472
.cfg_done = VOP_REG(RK3066_REG_CFG_DONE, 0x1, 0),

0 commit comments

Comments
 (0)