From: Maxime Ripard Date: Sat, 27 May 2017 16:09:29 +0000 (+0200) Subject: drm/sun4i: tcon: Fix tcon channel 1 backporch calculation X-Git-Tag: v4.13-rc1~45^2~23^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cb2f46b3da4c45342414c63cd465de483cb102a;p=platform%2Fkernel%2Flinux-exynos.git drm/sun4i: tcon: Fix tcon channel 1 backporch calculation It seems like what's called a backporch in the datasheet is actually the backporch plus the sync period. Fix that in our driver. Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 28da61a..6993ef3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -269,7 +269,7 @@ void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, SUN4I_TCON1_BASIC2_Y(mode->crtc_vdisplay)); /* Set horizontal display timings */ - bp = mode->crtc_htotal - mode->crtc_hsync_end; + bp = mode->crtc_htotal - mode->crtc_hsync_start; DRM_DEBUG_DRIVER("Setting horizontal total %d, backporch %d\n", mode->htotal, bp); regmap_write(tcon->regs, SUN4I_TCON1_BASIC3_REG, @@ -277,7 +277,7 @@ void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, SUN4I_TCON1_BASIC3_H_BACKPORCH(bp)); /* Set vertical display timings */ - bp = mode->crtc_vtotal - mode->crtc_vsync_end; + bp = mode->crtc_vtotal - mode->crtc_vsync_start; DRM_DEBUG_DRIVER("Setting vertical total %d, backporch %d\n", mode->vtotal, bp); regmap_write(tcon->regs, SUN4I_TCON1_BASIC4_REG,