From: Svyatoslav Ryhel Date: Tue, 9 Sep 2025 07:33:35 +0000 (+0300) Subject: drm/tegra: dsi: Calculate packet parameters for video mode X-Git-Tag: v6.19-rc1~157^2~1^2~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef8ff0429a1fc4e7fb899208f49c719ed8293f81;p=thirdparty%2Fkernel%2Flinux.git drm/tegra: dsi: Calculate packet parameters for video mode Calculate packet parameters for video mode same way it is done for command mode, by halving timings plugged into equations. Signed-off-by: Svyatoslav Ryhel Signed-off-by: Thierry Reding Link: https://patch.msgid.link/20250909073335.91531-3-clamor95@gmail.com --- diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 368a3be59c6c8..ae13b7a6837c0 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -546,12 +546,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;