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 <[email protected]>
---
 drivers/video/tegra20/tegra-dsi.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/video/tegra20/tegra-dsi.c 
b/drivers/video/tegra20/tegra-dsi.c
index b65d2118de9..6cf6cffc0e4 100644
--- a/drivers/video/tegra20/tegra-dsi.c
+++ b/drivers/video/tegra20/tegra-dsi.c
@@ -683,12 +683,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 /= 2;
+                       hfp /= 2;
+               }
+
+               if ((mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
+                       hbp += hsw;
+
                /* subtract packet overhead */
                hsw -= 10;
                hbp -= 14;
-- 
2.43.0

Reply via email to