Skip to contentSkip to conversation

tegra: dsi: improvements for video mode ganged panels

PATCH RESEND In review Svyatoslav Ryhel 2 participants 5 messages Dec 4, 2025 – Jan 15

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

cover tegra: dsi: improvements for video mode ganged panels

Expand SOL delay and packet parameters calculations to include video mode ganged panels. At the moment only command mode ganged panels are supported.

Svyatoslav Ryhel (2):
gpu/drm: tegra: dsi: make SOL delay calculation mode independent gpu/drm: tegra: dsi: calculate packet parameters for video mode

 drivers/gpu/drm/tegra/dsi.c | 54 ++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 27 deletions(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH RESEND 1/2 gpu/drm: tegra: dsi: make SOL delay calculation mode independent

Move SOL delay calculation outside of video mode conditions.

---
 drivers/gpu/drm/tegra/dsi.c | 41 +++++++++++++++----------------------
 1 file changed, 17 insertions(+), 24 deletions(-)
drivers/gpu/drm/tegra/dsi.c +17 -24
index 924611061cfa..aab555a2eb68 100644
@@ -560,11 +560,6 @@ static void tegra_dsi_configure(struct tegra_dsi *dsi, unsigned int pipe,
 		tegra_dsi_writel(dsi, hact << 16 | hbp, DSI_PKT_LEN_2_3);
 		tegra_dsi_writel(dsi, hfp, DSI_PKT_LEN_4_5);
 		tegra_dsi_writel(dsi, 0x0f0f << 16, DSI_PKT_LEN_6_7);
-
-		/* set SOL delay (for non-burst mode only) */
-		tegra_dsi_writel(dsi, 8 * mul / div, DSI_SOL_DELAY);
-
-		/* TODO: implement ganged mode */
 	} else {
 		u16 bytes;
 
@@ -586,28 +581,26 @@ static void tegra_dsi_configure(struct tegra_dsi *dsi, unsigned int pipe,
 		value = MIPI_DCS_WRITE_MEMORY_START << 8 |
 			MIPI_DCS_WRITE_MEMORY_CONTINUE;
 		tegra_dsi_writel(dsi, value, DSI_DCS_CMDS);
+	}
 
-		/* set SOL delay */
-		if (dsi->master || dsi->slave) {
-			unsigned long delay, bclk, bclk_ganged;
-			unsigned int lanes = state->lanes;
-
-			/* SOL to valid, valid to FIFO and FIFO write delay */
-			delay = 4 + 4 + 2;
-			delay = DIV_ROUND_UP(delay * mul, div * lanes);
-			/* FIFO read delay */
-			delay = delay + 6;
-
-			bclk = DIV_ROUND_UP(mode->htotal * mul, div * lanes);
-			bclk_ganged = DIV_ROUND_UP(bclk * lanes / 2, lanes);
-			value = bclk - bclk_ganged + delay + 20;
-		} else {
-			/* TODO: revisit for non-ganged mode */
-			value = 8 * mul / div;
-		}
+	/* set SOL delay */
+	if (dsi->master || dsi->slave) {
+		unsigned long delay, bclk, bclk_ganged;
+		unsigned int lanes = state->lanes;
 
-		tegra_dsi_writel(dsi, value, DSI_SOL_DELAY);
+		/* SOL to valid, valid to FIFO and FIFO write delay */
+		delay = 4 + 4 + 2;
+		delay = DIV_ROUND_UP(delay * mul, div * lanes);
+		/* FIFO read delay */
+		delay = delay + 6;
+
+		bclk = DIV_ROUND_UP(mode->htotal * mul, div * lanes);
+		bclk_ganged = DIV_ROUND_UP(bclk * lanes / 2, lanes);
+		value = bclk - bclk_ganged + delay + 20;
+	} else {
+		value = 8 * mul / div;
 	}
+	tegra_dsi_writel(dsi, value, DSI_SOL_DELAY);
 
 	if (dsi->slave) {
 		tegra_dsi_configure(dsi->slave, pipe, mode);
Signature · 1 line
2.48.1
#2 lore raw

PATCH RESEND 2/2 gpu/drm: tegra: dsi: calculate packet parameters for video mode

In reply to Svyatoslav Ryhel

Calculate packet parameters for video mode same way it is done or command mode, by halving timings plugged into equations.

---
 drivers/gpu/drm/tegra/dsi.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/tegra/dsi.c +10 -3
index aab555a2eb68..1ec3f03d2577 100644
@@ -545,12 +545,19 @@ static void tegra_dsi_configure(struct tegra_dsi *dsi, unsigned int pipe,
 		/* horizontal back porch */
 		hbp = (mode->htotal - mode->hsync_end) * mul / div;
 
-		if ((dsi->flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
-			hbp += hsw;
-
 		/* horizontal front porch */
 		hfp = (mode->hsync_start - mode->hdisplay) * mul / div;
 
+		if (dsi->master || dsi->slave) {
+			hact /= 2;
+			hsw /= 2;
+			hbp /= 2;
+			hfp /= 2;
+		}
+
+		if ((dsi->flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
+			hbp += hsw;
+
 		/* subtract packet overhead */
 		hsw -= 10;
 		hbp -= 14;
Signature · 1 line
2.48.1
maintainer
#3 lore raw
In reply to Svyatoslav Ryhel
Quoted 11 lines · Svyatoslav Ryhel

Expand SOL delay and packet parameters calculations to include video mode ganged panels. At the moment only command mode ganged panels are supported.

Svyatoslav Ryhel (2):
gpu/drm: tegra: dsi: make SOL delay calculation mode independent gpu/drm: tegra: dsi: calculate packet parameters for video mode

 drivers/gpu/drm/tegra/dsi.c | 54 ++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

I can see this series has been merged.

Mikko

#4 lore raw

чт, 15 січ. 2026 р. о 09:09 Mikko Perttunen <[email protected]> пише:

Quoted 9 lines · Svyatoslav Ryhel
Quoted 7 lines

Expand SOL delay and packet parameters calculations to include video mode ganged panels. At the moment only command mode ganged panels are supported.

Svyatoslav Ryhel (2):
gpu/drm: tegra: dsi: make SOL delay calculation mode independent gpu/drm: tegra: dsi: calculate packet parameters for video mode

Quoted 9 lines
Quoted 4 lines
 drivers/gpu/drm/tegra/dsi.c | 54 ++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

I can see this series has been merged.

Mikko

I wasn't notified that this series was accepted, thank you for letting me know.