summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mcde/mcde_dsi.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2019-11-06 17:58:30 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-11-09 22:18:51 +0100
commitd920e8da3d837bcc041800b8da9b335a728490f7 (patch)
tree363da2014b2625063a1750f257dc792651dc246d /drivers/gpu/drm/mcde/mcde_dsi.c
parent768859c239922264f91d8a49ff8b1b227e7ad7d9 (diff)
drm/mcde: Fix frame sync setup for video mode panels
The MCDE driver differentiates only between "te_sync" (for hardware TE0 sync) and software sync (i.e. manually triggered updates) at the moment. However, none of these options work correctly for video mode panels. Therefore, we need to make some changes to make them work correctly: - Select hardware sync coming from the (DSI) formatter. - Keep the FIFO permanently enabled (otherwise MCDE will stop feeding data to the panel). - Skip manual software sync (this is not necessary in video mode). Automatically detect if the connected panel is using video mode and enable the necessary changes in that case. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Tested-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20191106165835.2863-3-stephan@gerhold.net
Diffstat (limited to 'drivers/gpu/drm/mcde/mcde_dsi.c')
-rw-r--r--drivers/gpu/drm/mcde/mcde_dsi.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index d6214d3c8b33..ffd2e0b64628 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -130,6 +130,15 @@ bool mcde_dsi_irq(struct mipi_dsi_device *mdsi)
return te_received;
}
+static void mcde_dsi_attach_to_mcde(struct mcde_dsi *d)
+{
+ d->mcde->mdsi = d->mdsi;
+
+ d->mcde->video_mode = !!(d->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO);
+ /* Enable use of the TE signal for all command mode panels */
+ d->mcde->te_sync = !d->mcde->video_mode;
+}
+
static int mcde_dsi_host_attach(struct mipi_dsi_host *host,
struct mipi_dsi_device *mdsi)
{
@@ -148,7 +157,7 @@ static int mcde_dsi_host_attach(struct mipi_dsi_host *host,
d->mdsi = mdsi;
if (d->mcde)
- d->mcde->mdsi = mdsi;
+ mcde_dsi_attach_to_mcde(d);
return 0;
}
@@ -901,7 +910,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
d->mcde = mcde;
/* If the display attached before binding, set this up */
if (d->mdsi)
- d->mcde->mdsi = d->mdsi;
+ mcde_dsi_attach_to_mcde(d);
/* Obtain the clocks */
d->hs_clk = devm_clk_get(dev, "hs");