Skip to content

Commit 25b7a67

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: [email protected] Signed-off-by: Val Packett <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a17dfde commit 25b7a67

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,10 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
15661566
VOP_AFBC_SET(vop, enable, s->enable_afbc);
15671567
vop_cfg_done(vop);
15681568

1569+
/* Ack the DMA transfer of the previous frame (RK3066). */
1570+
if (VOP_HAS_REG(vop, common, dma_stop))
1571+
VOP_REG_SET(vop, common, dma_stop, 0);
1572+
15691573
spin_unlock(&vop->reg_lock);
15701574

15711575
/*

drivers/gpu/drm/rockchip/rockchip_drm_vop.h

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ static const struct vop_output rk3066_output = {
435435
};
436436

437437
static const struct vop_common rk3066_common = {
438+
.dma_stop = VOP_REG(RK3066_SYS_CTRL0, 0x1, 0),
438439
.standby = VOP_REG(RK3066_SYS_CTRL0, 0x1, 1),
439440
.out_mode = VOP_REG(RK3066_DSP_CTRL0, 0xf, 0),
440441
.cfg_done = VOP_REG(RK3066_REG_CFG_DONE, 0x1, 0),

0 commit comments

Comments
 (0)