Skip to contentSkip to conversation

drm/bridge/synopsys: dsi: allow sending longer LP commands

PATCH In review Yannick Fertre 3 participants 3 messages Jul 1, 2020 – Sep 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge/synopsys: dsi: allow sending longer LP commands

From: Antonio Borneo <[email protected]>

Current code does not properly computes the max length of LP commands that can be send during H or V sync, and rely on static values.
Limiting the max LP length to 4 byte during the V-sync is overly conservative.

Relax the limit and allows longer LP commands (16 bytes) to be sent during V-sync.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +9 -8
index d580b2aa4ce9..1a24ea648ef8 100644
@@ -360,6 +360,15 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
 	bool lpm = msg->flags & MIPI_DSI_MSG_USE_LPM;
 	u32 val = 0;
 
+	/*
+	 * TODO dw drv improvements
+	 * largest packet sizes during hfp or during vsa/vpb/vfp
+	 * should be computed according to byte lane, lane number and only
+	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
+	 */
+	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(16)
+		  | INVACT_LPCMD_TIME(4));
+
 	if (msg->flags & MIPI_DSI_MSG_REQ_ACK)
 		val |= ACK_RQST_EN;
 	if (lpm)
@@ -611,14 +620,6 @@ static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi,
 	dsi_write(dsi, DSI_DPI_VCID, DPI_VCID(dsi->channel));
 	dsi_write(dsi, DSI_DPI_COLOR_CODING, color);
 	dsi_write(dsi, DSI_DPI_CFG_POL, val);
-	/*
-	 * TODO dw drv improvements
-	 * largest packet sizes during hfp or during vsa/vpb/vfp
-	 * should be computed according to byte lane, lane number and only
-	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
-	 */
-	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(4)
-		  | INVACT_LPCMD_TIME(4));
 }
 
 static void dw_mipi_dsi_packet_handler_config(struct dw_mipi_dsi *dsi)
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 42 lines · Yannick Fertre

From: Antonio Borneo <[email protected]>

Current code does not properly computes the max length of LP commands that can be send during H or V sync, and rely on static values.
Limiting the max LP length to 4 byte during the V-sync is overly conservative.

Relax the limit and allows longer LP commands (16 bytes) to be sent during V-sync.

---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 17 +++++++++--------
  1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +9 -1
index d580b2aa4ce9..1a24ea648ef8 100644
@@ -360,6 +360,15 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
  	bool lpm = msg->flags & MIPI_DSI_MSG_USE_LPM;
  	u32 val = 0;
 
+	/*
+	 * TODO dw drv improvements
+	 * largest packet sizes during hfp or during vsa/vpb/vfp
+	 * should be computed according to byte lane, lane number and only
+	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
+	 */
+	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(16)
+		  | INVACT_LPCMD_TIME(4));
+
  	if (msg->flags & MIPI_DSI_MSG_REQ_ACK)
  		val |= ACK_RQST_EN;
  	if (lpm)
@@ -611,14 +620,6 @@ static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi,
  	dsi_write(dsi, DSI_DPI_VCID, DPI_VCID(dsi->channel));
  	dsi_write(dsi, DSI_DPI_COLOR_CODING, color);
  	dsi_write(dsi, DSI_DPI_CFG_POL, val);
-	/*

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi, · line 625

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -7
-	 * TODO dw drv improvements
-	 * largest packet sizes during hfp or during vsa/vpb/vfp
-	 * should be computed according to byte lane, lane number and only
-	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
-	 */
-	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(4)
-		  | INVACT_LPCMD_TIME(4));
  }
 
  static void dw_mipi_dsi_packet_handler_config(struct dw_mipi_dsi *dsi)

(+ Antonio)

Hi Yannick & Antonio,

(Tested with the 3 patches named
drm/bridge/synopsys: dsi: allow LP commands in video mode drm/bridge/synopsys: dsi: allow sending longer LP commands drm/bridge/synopsys: dsi: add support for non-continuous HS clock on various dsi bridges + stm32mp157 disco board)

Many thanks
Philippe :-)

Acked-by on v1 1/1
#2 lore raw
In reply to Yannick Fertre
Quoted 42 lines · Yannick Fertre

From: Antonio Borneo <[email protected]>

Current code does not properly computes the max length of LP commands that can be send during H or V sync, and rely on static values.
Limiting the max LP length to 4 byte during the V-sync is overly conservative.

Relax the limit and allows longer LP commands (16 bytes) to be sent during V-sync.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +9 -1
index d580b2aa4ce9..1a24ea648ef8 100644
@@ -360,6 +360,15 @@ static void dw_mipi_message_config(struct dw_mipi_dsi *dsi,
 	bool lpm = msg->flags & MIPI_DSI_MSG_USE_LPM;
 	u32 val = 0;
 
+	/*
+	 * TODO dw drv improvements
+	 * largest packet sizes during hfp or during vsa/vpb/vfp
+	 * should be computed according to byte lane, lane number and only
+	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
+	 */
+	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(16)
+		  | INVACT_LPCMD_TIME(4));
+
 	if (msg->flags & MIPI_DSI_MSG_REQ_ACK)
 		val |= ACK_RQST_EN;
 	if (lpm)
@@ -611,14 +620,6 @@ static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi,
 	dsi_write(dsi, DSI_DPI_VCID, DPI_VCID(dsi->channel));
 	dsi_write(dsi, DSI_DPI_COLOR_CODING, color);
 	dsi_write(dsi, DSI_DPI_CFG_POL, val);
-	/*

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi, · line 625

Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -7
-	 * TODO dw drv improvements
-	 * largest packet sizes during hfp or during vsa/vpb/vfp
-	 * should be computed according to byte lane, lane number and only
-	 * if sending lp cmds in high speed is enable (PHY_TXREQUESTCLKHS)
-	 */
-	dsi_write(dsi, DSI_DPI_LP_CMD_TIM, OUTVACT_LPCMD_TIME(4)
-		  | INVACT_LPCMD_TIME(4));
 }
 
 static void dw_mipi_dsi_packet_handler_config(struct dw_mipi_dsi *dsi)

Tested on Amlogic AXG (v1.21a)

Applying to drm-misc-next

Thanks !
Neil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel