summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2019-02-11 15:41:23 +0100
committerMaxime Ripard <maxime.ripard@bootlin.com>2019-02-19 11:08:21 +0100
commitda676c6aa6413d59ab0a80c97bbc273025e640b2 (patch)
tree1ed37b4bc58b66cf9f3b7e02d3587bae24c83924 /drivers/gpu/drm/sun4i
parent85fb352666732a9e5caf6027b9c253b3d7881d8f (diff)
downloadlinux-da676c6aa6413d59ab0a80c97bbc273025e640b2.tar.gz
linux-da676c6aa6413d59ab0a80c97bbc273025e640b2.tar.bz2
linux-da676c6aa6413d59ab0a80c97bbc273025e640b2.zip
drm/sun4i: dsi: Change the start delay calculation
The current calculation for the video start delay in the current DSI driver is that it is the total vertical size, minus the front porch and sync length, plus 1. This equals to the active vertical size plus the back porch plus 1. That 1 is coming in the Allwinner BSP from an variable that is set to 1. However, if we look at the Allwinner BSP more closely, and especially in the "legacy" code for the display (in drivers/video/sunxi/legacy/), we can see that this variable is actually computed from the porches and the sync minus 10, clamped between 8 and 100. This fixes the start delay symptom we've seen on some panels (vblank timeouts with vertical white stripes at the bottom of the panel). Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/6e5f72e68f47ca0223877464bf12f0c3f3978de8.1549896081.git-series.maxime.ripard@bootlin.com
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r--drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index 318994cd1b85..25d8cb9f9266 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -358,7 +358,9 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi,
static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,
struct drm_display_mode *mode)
{
- return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1;
+ u16 start = clamp(mode->vtotal - mode->vdisplay - 10, 8, 100);
+
+ return mode->vtotal - (mode->vsync_end - mode->vdisplay) + start;
}
static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,