public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode
@ 2026-01-08 10:19 AngeloGioacchino Del Regno
  2026-01-08 16:30 ` Gary Bisson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-01-08 10:19 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: p.zabel, airlied, simona, matthias.bgg, angelogioacchino.delregno,
	dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	bisson.gary, kernel

Up until now, the MediaTek DSI Controller has always been working
in Low Power Mode (LPM), as this driver has always ignored the
MIPI_DSI_MSG_USE_LPM flag hence never setting HS mode.

In the current state of the driver the only thing that is needed
to add support for DSI High Speed (HS) transmit is to simply set
the "HSTX" config bit in the configuration register.

Check if flag MIPI_DSI_MSG_USE_LPM is set and, if not, set HSTX.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index e4953d5cb6a8..a90cae9512c5 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -155,6 +155,7 @@
 #define SHORT_PACKET			0
 #define LONG_PACKET			2
 #define BTA				BIT(2)
+#define HSTX				BIT(3)
 #define DATA_ID				GENMASK(15, 8)
 #define DATA_0				GENMASK(23, 16)
 #define DATA_1				GENMASK(31, 24)
@@ -1177,6 +1178,9 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg)
 	else
 		config = (msg->tx_len > 2) ? LONG_PACKET : SHORT_PACKET;
 
+	if (!(msg->flags & MIPI_DSI_MSG_USE_LPM))
+		config |= HSTX;
+
 	if (msg->tx_len > 2) {
 		cmdq_size = 1 + (msg->tx_len + 3) / 4;
 		cmdq_off = 4;
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode
  2026-01-08 10:19 [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode AngeloGioacchino Del Regno
@ 2026-01-08 16:30 ` Gary Bisson
  2026-01-16  8:15 ` CK Hu (胡俊光)
  2026-01-16 23:51 ` Chun-Kuang Hu
  2 siblings, 0 replies; 4+ messages in thread
From: Gary Bisson @ 2026-01-08 16:30 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, kernel

On Thu, Jan 08, 2026 at 11:19:59AM +0100, AngeloGioacchino Del Regno wrote:
> Up until now, the MediaTek DSI Controller has always been working
> in Low Power Mode (LPM), as this driver has always ignored the
> MIPI_DSI_MSG_USE_LPM flag hence never setting HS mode.
> 
> In the current state of the driver the only thing that is needed
> to add support for DSI High Speed (HS) transmit is to simply set
> the "HSTX" config bit in the configuration register.
> 
> Check if flag MIPI_DSI_MSG_USE_LPM is set and, if not, set HSTX.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Tested-by: Gary Bisson <bisson.gary@gmail.com>

This patch was needed for the TI SN65DSI83 DSI to LVDS bridge to work as
it requires HS mode.

Regards,
Gary


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode
  2026-01-08 10:19 [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode AngeloGioacchino Del Regno
  2026-01-08 16:30 ` Gary Bisson
@ 2026-01-16  8:15 ` CK Hu (胡俊光)
  2026-01-16 23:51 ` Chun-Kuang Hu
  2 siblings, 0 replies; 4+ messages in thread
From: CK Hu (胡俊光) @ 2026-01-16  8:15 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, chunkuang.hu@kernel.org
  Cc: simona@ffwll.ch, dri-devel@lists.freedesktop.org,
	airlied@gmail.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, p.zabel@pengutronix.de,
	matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org,
	bisson.gary@gmail.com, kernel@collabora.com

On Thu, 2026-01-08 at 11:19 +0100, AngeloGioacchino Del Regno wrote:
> Up until now, the MediaTek DSI Controller has always been working
> in Low Power Mode (LPM), as this driver has always ignored the
> MIPI_DSI_MSG_USE_LPM flag hence never setting HS mode.
> 
> In the current state of the driver the only thing that is needed
> to add support for DSI High Speed (HS) transmit is to simply set
> the "HSTX" config bit in the configuration register.
> 
> Check if flag MIPI_DSI_MSG_USE_LPM is set and, if not, set HSTX.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index e4953d5cb6a8..a90cae9512c5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -155,6 +155,7 @@
>  #define SHORT_PACKET			0
>  #define LONG_PACKET			2
>  #define BTA				BIT(2)
> +#define HSTX				BIT(3)
>  #define DATA_ID				GENMASK(15, 8)
>  #define DATA_0				GENMASK(23, 16)
>  #define DATA_1				GENMASK(31, 24)
> @@ -1177,6 +1178,9 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg)
>  	else
>  		config = (msg->tx_len > 2) ? LONG_PACKET : SHORT_PACKET;
>  
> +	if (!(msg->flags & MIPI_DSI_MSG_USE_LPM))
> +		config |= HSTX;
> +
>  	if (msg->tx_len > 2) {
>  		cmdq_size = 1 + (msg->tx_len + 3) / 4;
>  		cmdq_off = 4;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode
  2026-01-08 10:19 [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode AngeloGioacchino Del Regno
  2026-01-08 16:30 ` Gary Bisson
  2026-01-16  8:15 ` CK Hu (胡俊光)
@ 2026-01-16 23:51 ` Chun-Kuang Hu
  2 siblings, 0 replies; 4+ messages in thread
From: Chun-Kuang Hu @ 2026-01-16 23:51 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg, dri-devel,
	linux-mediatek, linux-kernel, linux-arm-kernel, bisson.gary,
	kernel

Hi, Angelo:

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於
2026年1月8日週四 上午10:20寫道:
>
> Up until now, the MediaTek DSI Controller has always been working
> in Low Power Mode (LPM), as this driver has always ignored the
> MIPI_DSI_MSG_USE_LPM flag hence never setting HS mode.
>
> In the current state of the driver the only thing that is needed
> to add support for DSI High Speed (HS) transmit is to simply set
> the "HSTX" config bit in the configuration register.
>
> Check if flag MIPI_DSI_MSG_USE_LPM is set and, if not, set HSTX.

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index e4953d5cb6a8..a90cae9512c5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -155,6 +155,7 @@
>  #define SHORT_PACKET                   0
>  #define LONG_PACKET                    2
>  #define BTA                            BIT(2)
> +#define HSTX                           BIT(3)
>  #define DATA_ID                                GENMASK(15, 8)
>  #define DATA_0                         GENMASK(23, 16)
>  #define DATA_1                         GENMASK(31, 24)
> @@ -1177,6 +1178,9 @@ static void mtk_dsi_cmdq(struct mtk_dsi *dsi, const struct mipi_dsi_msg *msg)
>         else
>                 config = (msg->tx_len > 2) ? LONG_PACKET : SHORT_PACKET;
>
> +       if (!(msg->flags & MIPI_DSI_MSG_USE_LPM))
> +               config |= HSTX;
> +
>         if (msg->tx_len > 2) {
>                 cmdq_size = 1 + (msg->tx_len + 3) / 4;
>                 cmdq_off = 4;
> --
> 2.52.0
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-16 23:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 10:19 [PATCH] drm/mediatek: mtk_dsi: Add support for High Speed (HS) mode AngeloGioacchino Del Regno
2026-01-08 16:30 ` Gary Bisson
2026-01-16  8:15 ` CK Hu (胡俊光)
2026-01-16 23:51 ` Chun-Kuang Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox