mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
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>
This commit is contained in:
committed by
Dom Cobley
parent
9d88a534df
commit
e2bc0d08a4
@@ -1460,6 +1460,15 @@ static const struct drm_bridge_funcs vc4_dsi_bridge_funcs = {
|
|||||||
.mode_fixup = vc4_dsi_bridge_mode_fixup,
|
.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)
|
static int vc4_dsi_late_register(struct drm_encoder *encoder)
|
||||||
{
|
{
|
||||||
struct drm_device *drm = encoder->dev;
|
struct drm_device *drm = encoder->dev;
|
||||||
@@ -1690,6 +1699,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
|||||||
dsi->encoder.type = dsi->variant->port ?
|
dsi->encoder.type = dsi->variant->port ?
|
||||||
VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
|
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);
|
dsi->regs = vc4_ioremap_regs(pdev, 0);
|
||||||
if (IS_ERR(dsi->regs))
|
if (IS_ERR(dsi->regs))
|
||||||
return PTR_ERR(dsi->regs);
|
return PTR_ERR(dsi->regs);
|
||||||
|
|||||||
Reference in New Issue
Block a user