video: tegra20: dsi: calculate packet parameters for video mode
authorSvyatoslav Ryhel <clamor95@gmail.com>
Mon, 2 Dec 2024 06:12:36 +0000 (08:12 +0200)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Wed, 26 Feb 2025 11:06:40 +0000 (13:06 +0200)
Calculate packet parameters for video mode same way it is done or
command mode, by halving timings plugged into equations.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/video/tegra20/tegra-dsi.c

index e1502d8..2beb9ec 100644 (file)
@@ -697,12 +697,19 @@ static void tegra_dsi_configure(struct udevice *dev,
                /* horizontal back porch */
                hbp = timing->hback_porch.typ * mul / div;
 
-               if ((mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
-                       hbp += hsw;
-
                /* horizontal front porch */
                hfp = timing->hfront_porch.typ * mul / div;
 
+               if (priv->master || priv->slave) {
+                       hact /= 2;
+                       hsw /= 2;
+                       hbp = hbp / 2 - 1;
+                       hfp /= 2;
+               }
+
+               if ((mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
+                       hbp += hsw;
+
                /* subtract packet overhead */
                hsw -= 10;
                hbp -= 14;