Skip to contentSkip to conversation

drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode

PATCH Applied Liu Ying 2 participants 2 messages Oct 18, 2023 – Oct 24, 2023

Subsystems (3)
lore
Share & tools
lore

Liu Ying

author
#0 lore raw

PATCH 1/1 drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode

In order to support burst mode, vendor drivers set lane_mbps higher than bandwidth through DPI interface. So, calculate horizontal component lane byte clock cycle(lbcc) based on lane_mbps instead of pixel clock rate for burst mode.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +12 -6
index 8789eca26188..824fb3c65742 100644
@@ -774,13 +774,19 @@ static u32 dw_mipi_dsi_get_hcomponent_lbcc(struct dw_mipi_dsi *dsi,
 	u32 frac, lbcc, minimum_lbcc;
 	int bpp;
 
-	bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
-	if (bpp < 0) {
-		dev_err(dsi->dev, "failed to get bpp\n");
-		return 0;
-	}
+	if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
+		/* lbcc based on lane_mbps */
+		lbcc = hcomponent * dsi->lane_mbps * MSEC_PER_SEC / 8;
+	} else {
+		/* lbcc based on pixel clock rate */
+		bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+		if (bpp < 0) {
+			dev_err(dsi->dev, "failed to get bpp\n");
+			return 0;
+		}
 
-	lbcc = div_u64((u64)hcomponent * mode->clock * bpp, dsi->lanes * 8);
+		lbcc = div_u64((u64)hcomponent * mode->clock * bpp, dsi->lanes * 8);
+	}
 
 	frac = lbcc % mode->clock;
 	lbcc = lbcc / mode->clock;
Signature · 1 line
2.37.1
#1 lore raw
Quoted 6 lines · Liu Ying

In order to support burst mode, vendor drivers set lane_mbps higher than bandwidth through DPI interface. So, calculate horizontal component lane byte clock cycle(lbcc) based on lane_mbps instead of pixel clock rate for burst mode.

Applied, thanks!

[1/1] drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode

      commit: 93e82bb4de0196c4caeca1d8a6eef67863981d8f

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>