]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/tegra: dsi: Use proper back-porch for non-sync video mode
authorThierry Reding <treding@nvidia.com>
Wed, 8 Apr 2015 14:58:07 +0000 (16:58 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 13 Aug 2015 11:47:44 +0000 (13:47 +0200)
In video modes without sync pulses, the horizontal back-porch needs to
include the horizontal sync width.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dsi.c

index ed970f62290306e5c78158f9600211d51251dc78..5c489c25755523afb66ef5130b1c4510d4951415 100644 (file)
@@ -548,14 +548,19 @@ static void tegra_dsi_configure(struct tegra_dsi *dsi, unsigned int pipe,
 
                /* horizontal sync width */
                hsw = (mode->hsync_end - mode->hsync_start) * mul / div;
-               hsw -= 10;
 
                /* horizontal back porch */
                hbp = (mode->htotal - mode->hsync_end) * mul / div;
-               hbp -= 14;
+
+               if ((dsi->flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) == 0)
+                       hbp += hsw;
 
                /* horizontal front porch */
                hfp = (mode->hsync_start - mode->hdisplay) * mul / div;
+
+               /* subtract packet overhead */
+               hsw -= 10;
+               hbp -= 14;
                hfp -= 8;
 
                tegra_dsi_writel(dsi, hsw << 16 | 0, DSI_PKT_LEN_0_1);