difos/target/linux/bcm27xx/patches-6.12/950-0637-drm-vc4-Add-vblank-callback-to-DSI0-to-reset-FIFO.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

42 lines
1.4 KiB
Diff

From 0e638ddb4a3bbd380c5826021c6ab9f2176b5f03 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 5 Apr 2024 17:40:05 +0100
Subject: [PATCH] drm/vc4: Add vblank callback to DSI0 to reset FIFO
The pixel to byte FIFO appears to not always reset correctly,
which can lead to colour errors and/or horizontal shifts.
Reset on every vblank to work around the issue.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_dsi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -1462,6 +1462,15 @@ static const struct drm_bridge_funcs vc4
.mode_fixup = vc4_dsi_bridge_mode_fixup,
};
+static void vc4_dsi_reset_fifo(struct drm_encoder *encoder)
+{
+ struct vc4_dsi *dsi = to_vc4_dsi(encoder);
+ u32 val;
+
+ val = DSI_PORT_READ(CTRL);
+ DSI_PORT_WRITE(CTRL, val | DSI0_CTRL_CLR_PBCF);
+}
+
static int vc4_dsi_late_register(struct drm_encoder *encoder)
{
struct drm_device *drm = encoder->dev;
@@ -1710,6 +1719,9 @@ static int vc4_dsi_bind(struct device *d
dsi->encoder.type = dsi->variant->port ?
VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
+ if (dsi->encoder.type == VC4_ENCODER_TYPE_DSI0)
+ dsi->encoder.vblank = vc4_dsi_reset_fifo;
+
dsi->regs = vc4_ioremap_regs(pdev, 0);
if (IS_ERR(dsi->regs))
return PTR_ERR(dsi->regs);