Skip to contentSkip to conversation

drm/rockchip: vop: Support internal display on RK3066

PATCH Applied Val Packett 2 participants 4 messages Jun 24, 2024 – Aug 15, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v4 cover drm/rockchip: vop: Support internal display on RK3066

This tiny patch series makes the changes required to enable the RGB display output on the Rockchip RK3066 SoC. Final version as discussed.

Val Packett (2):
drm/rockchip: vop: clear DMA stop bit on RK3066 drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB on RK3066

 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 +
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++
 3 files changed, 7 insertions(+)
Signature · 1 line
2.45.2
#1 lore raw

PATCH v4 1/2 drm/rockchip: vop: clear DMA stop bit on RK3066

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")
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++++
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 +
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 +
 3 files changed, 6 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +4 -0
index a13473b2d..e88fbd568 100644
@@ -1583,6 +1583,10 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
 	VOP_AFBC_SET(vop, enable, s->enable_afbc);
 	vop_cfg_done(vop);
 
+	/* Ack the DMA transfer of the previous frame (RK3066). */
+	if (VOP_HAS_REG(vop, common, dma_stop))
+		VOP_REG_SET(vop, common, dma_stop, 0);
+
 	spin_unlock(&vop->reg_lock);
 
 	/*
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +1 -0
index b33e5bdc2..0cf512cc1 100644
@@ -122,6 +122,7 @@ struct vop_common {
 	struct vop_reg lut_buffer_index;
 	struct vop_reg gate_en;
 	struct vop_reg mmu_en;
+	struct vop_reg dma_stop;
 	struct vop_reg out_mode;
 	struct vop_reg standby;
 };
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1 -0
index b9ee02061..9bcb40a64 100644
@@ -466,6 +466,7 @@ static const struct vop_output rk3066_output = {
 };
 
 static const struct vop_common rk3066_common = {
+	.dma_stop = VOP_REG(RK3066_SYS_CTRL0, 0x1, 0),
 	.standby = VOP_REG(RK3066_SYS_CTRL0, 0x1, 1),
 	.out_mode = VOP_REG(RK3066_DSP_CTRL0, 0xf, 0),
 	.cfg_done = VOP_REG(RK3066_REG_CFG_DONE, 0x1, 0),
Signature · 1 line
2.45.2
#2 lore raw

PATCH v4 2/2 drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB on RK3066

In reply to Val Packett

The RK3066 does have RGB display output, so it should be marked as such.

Fixes f4a6de8 ("drm: rockchip: vop: add rk3066 vop definitions")
---
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1 -0
index 9bcb40a64..e2c6ba26f 100644
@@ -515,6 +515,7 @@ static const struct vop_data rk3066_vop = {
 	.output = &rk3066_output,
 	.win = rk3066_vop_win_data,
 	.win_size = ARRAY_SIZE(rk3066_vop_win_data),
+	.feature = VOP_FEATURE_INTERNAL_RGB,
 	.max_output = { 1920, 1080 },
 };
 
Signature · 1 line
2.45.2
maintainer Applied
#3 lore raw
In reply to Val Packett
Quoted 8 lines · Val Packett

This tiny patch series makes the changes required to enable the RGB display output on the Rockchip RK3066 SoC. Final version as discussed.

Val Packett (2):
drm/rockchip: vop: clear DMA stop bit on RK3066 drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB on RK3066

[...]

Applied, thanks!

[1/2] drm/rockchip: vop: clear DMA stop bit on RK3066

      commit: 6b44aa559d6c7f4ea591ef9d2352a7250138d62a
[2/2] drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB on RK3066
      commit: 6ed51ba95e27221ce87979bd2ad5926033b9e1b9

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>