Re: [PATCH] drm/mcde: Support using DSI in LP mode

2019-11-20 Thread Linus Walleij
On Tue, Nov 19, 2019 at 10:42 PM Linus Walleij  wrote:

> It is possible to set a flag in the struct mipi_dsi_device
> so the panel is handled in low power (LP) mode. Some displays
> only support this mode and it is also good for testing.
>
> Cc: Stephan Gerhold 
> Signed-off-by: Linus Walleij 

Inki: this is the patch making the MCDE use LP mode on
all commands also screen updates on command-mode panels.

If this is how the flag is intended please ACK this and I'll make
a patch to the documentation as well making it clear that this
is the intended semantics of the flag.

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/mcde: Support using DSI in LP mode

2019-11-19 Thread Linus Walleij
It is possible to set a flag in the struct mipi_dsi_device
so the panel is handled in low power (LP) mode. Some displays
only support this mode and it is also good for testing.

Cc: Stephan Gerhold 
Signed-off-by: Linus Walleij 
---
 drivers/gpu/drm/mcde/mcde_dsi.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 889c39efa80c..d4a12fe7ff01 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -648,10 +648,11 @@ static void mcde_dsi_start(struct mcde_dsi *d)
/* Command mode, clear IF1 ID */
val = readl(d->regs + DSI_CMD_MODE_CTL);
/*
-* If we enable low-power mode here, with
-* val |= DSI_CMD_MODE_CTL_IF1_LP_EN
+* If we enable low-power mode here,
 * then display updates become really slow.
 */
+   if (d->mdsi->mode_flags & MIPI_DSI_MODE_LPM)
+   val |= DSI_CMD_MODE_CTL_IF1_LP_EN;
val &= ~DSI_CMD_MODE_CTL_IF1_ID_MASK;
writel(val, d->regs + DSI_CMD_MODE_CTL);
 
@@ -740,10 +741,11 @@ static void mcde_dsi_bridge_pre_enable(struct drm_bridge 
*bridge)
/* Command mode, clear IF1 ID */
val = readl(d->regs + DSI_CMD_MODE_CTL);
/*
-* If we enable low-power mode here with
-* val |= DSI_CMD_MODE_CTL_IF1_LP_EN
+* If we enable low-power mode here
 * the display updates become really slow.
 */
+   if (d->mdsi->mode_flags & MIPI_DSI_MODE_LPM)
+   val |= DSI_CMD_MODE_CTL_IF1_LP_EN;
val &= ~DSI_CMD_MODE_CTL_IF1_ID_MASK;
writel(val, d->regs + DSI_CMD_MODE_CTL);
}
-- 
2.21.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel