2019-05-27 10:24:21

by Yannick FERTRE

[permalink] [raw]
Subject: [PATCH v1 0/2] dw-mipi-dsi: add power on & off optional phy ops and update stm

These patches fix a bug concerning an access issue to display controler (ltdc)
registers.
If the physical layer of the DSI is started too early then the fifo DSI are full
very quickly which implies ltdc register's access hang up. To avoid this
problem, it is necessary to start the DSI physical layer only when the bridge
is enable.

Yannick Fertré (2):
drm/bridge/synopsys: dsi: add power on/off optional phy ops
drm/stm: dsi: add power on/off phy ops

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 8 ++++++++
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 21 ++++++++++++++++++++-
include/drm/bridge/dw_mipi_dsi.h | 2 ++
3 files changed, 30 insertions(+), 1 deletion(-)

--
2.7.4


2019-05-27 10:24:31

by Yannick FERTRE

[permalink] [raw]
Subject: [PATCH v1 2/2] drm/stm: dsi: add power on/off phy ops

These new physical operations are helpful to power_on/off the dsi
wrapper. If the dsi wrapper is powered in video mode, the display
controller (ltdc) register access will hang when DSI fifos are full.

Signed-off-by: Yannick Fertré <[email protected]>
---
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 01db020..0ab32fe 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -210,10 +210,27 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
if (ret)
DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");

+ return 0;
+}
+
+static void dw_mipi_dsi_phy_power_on(void *priv_data)
+{
+ struct dw_mipi_dsi_stm *dsi = priv_data;
+
+ DRM_DEBUG_DRIVER("\n");
+
/* Enable the DSI wrapper */
dsi_set(dsi, DSI_WCR, WCR_DSIEN);
+}

- return 0;
+static void dw_mipi_dsi_phy_power_off(void *priv_data)
+{
+ struct dw_mipi_dsi_stm *dsi = priv_data;
+
+ DRM_DEBUG_DRIVER("\n");
+
+ /* Disable the DSI wrapper */
+ dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
}

static int
@@ -287,6 +304,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,

static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_stm_phy_ops = {
.init = dw_mipi_dsi_phy_init,
+ .power_on = dw_mipi_dsi_phy_power_on,
+ .power_off = dw_mipi_dsi_phy_power_off,
.get_lane_mbps = dw_mipi_dsi_get_lane_mbps,
};

--
2.7.4

2019-05-27 12:56:36

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] drm/stm: dsi: add power on/off phy ops

Hi Yannick,
and thank you for your patch.

Tested successfully on stm32f too.

Acked-by: Philippe Cornu <[email protected]>
Tested-by: Philippe Cornu <[email protected]>

Philippe :-)

On 5/27/19 12:21 PM, Yannick Fertré wrote:
> These new physical operations are helpful to power_on/off the dsi
> wrapper. If the dsi wrapper is powered in video mode, the display
> controller (ltdc) register access will hang when DSI fifos are full.
>
> Signed-off-by: Yannick Fertré <[email protected]>
> ---
> drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 01db020..0ab32fe 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -210,10 +210,27 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
> if (ret)
> DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");
>
> + return 0;
> +}
> +
> +static void dw_mipi_dsi_phy_power_on(void *priv_data)
> +{
> + struct dw_mipi_dsi_stm *dsi = priv_data;
> +
> + DRM_DEBUG_DRIVER("\n");
> +
> /* Enable the DSI wrapper */
> dsi_set(dsi, DSI_WCR, WCR_DSIEN);
> +}
>
> - return 0;
> +static void dw_mipi_dsi_phy_power_off(void *priv_data)
> +{
> + struct dw_mipi_dsi_stm *dsi = priv_data;
> +
> + DRM_DEBUG_DRIVER("\n");
> +
> + /* Disable the DSI wrapper */
> + dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
> }
>
> static int
> @@ -287,6 +304,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>
> static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_stm_phy_ops = {
> .init = dw_mipi_dsi_phy_init,
> + .power_on = dw_mipi_dsi_phy_power_on,
> + .power_off = dw_mipi_dsi_phy_power_off,
> .get_lane_mbps = dw_mipi_dsi_get_lane_mbps,
> };
>
>

2019-06-12 08:32:41

by Andrzej Hajda

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] drm/stm: dsi: add power on/off phy ops

On 27.05.2019 12:21, Yannick Fertré wrote:
> These new physical operations are helpful to power_on/off the dsi
> wrapper. If the dsi wrapper is powered in video mode, the display
> controller (ltdc) register access will hang when DSI fifos are full.
>
> Signed-off-by: Yannick Fertré <[email protected]>


Reviewed-by: Andrzej Hajda <[email protected]>


 --
Regards
Andrzej


> ---
> drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 01db020..0ab32fe 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -210,10 +210,27 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
> if (ret)
> DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");
>
> + return 0;
> +}
> +
> +static void dw_mipi_dsi_phy_power_on(void *priv_data)
> +{
> + struct dw_mipi_dsi_stm *dsi = priv_data;
> +
> + DRM_DEBUG_DRIVER("\n");
> +
> /* Enable the DSI wrapper */
> dsi_set(dsi, DSI_WCR, WCR_DSIEN);
> +}
>
> - return 0;
> +static void dw_mipi_dsi_phy_power_off(void *priv_data)
> +{
> + struct dw_mipi_dsi_stm *dsi = priv_data;
> +
> + DRM_DEBUG_DRIVER("\n");
> +
> + /* Disable the DSI wrapper */
> + dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
> }
>
> static int
> @@ -287,6 +304,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
>
> static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_stm_phy_ops = {
> .init = dw_mipi_dsi_phy_init,
> + .power_on = dw_mipi_dsi_phy_power_on,
> + .power_off = dw_mipi_dsi_phy_power_off,
> .get_lane_mbps = dw_mipi_dsi_get_lane_mbps,
> };
>


2019-06-12 08:34:35

by Andrzej Hajda

[permalink] [raw]
Subject: Re: [PATCH v1 0/2] dw-mipi-dsi: add power on & off optional phy ops and update stm

On 27.05.2019 12:21, Yannick Fertré wrote:
> These patches fix a bug concerning an access issue to display controler (ltdc)
> registers.
> If the physical layer of the DSI is started too early then the fifo DSI are full
> very quickly which implies ltdc register's access hang up. To avoid this
> problem, it is necessary to start the DSI physical layer only when the bridge
> is enable.
>
> Yannick Fertré (2):
> drm/bridge/synopsys: dsi: add power on/off optional phy ops
> drm/stm: dsi: add power on/off phy ops
>
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 8 ++++++++
> drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 21 ++++++++++++++++++++-
> include/drm/bridge/dw_mipi_dsi.h | 2 ++
> 3 files changed, 30 insertions(+), 1 deletion(-)
>
> --
> 2.7.4
>
>
>
Queued both patches to drm-misc-next.

--
Regards
Andrzej