diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-08-14 21:43:32 +0200 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2014-08-22 13:19:26 +0100 |
commit | 0f1c0bac5fd263fd610ec118d558e9ad285394ba (patch) | |
tree | 6b653c9cb31d786c8dc0c2d168c774c0ebe7f407 | |
parent | 7ba5b0cd67b6963f5338308e0c69f826ed0b39f0 (diff) | |
download | juno-0f1c0bac5fd263fd610ec118d558e9ad285394ba.tar.gz |
drm/i2c: tda998x: prepare for broken sync workaround
Some LCD controller cannot provide valid VESA style sync, i.e. coincident
HS/VS edges. First, this patch adds hskew passed from the adjusted_mode to
reference pixel calculation to allow those controllers to add an offset
relative to the expected reference pixel.
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Russell King <rmk_kernel@arm.linux.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 179f1aa407b466c06a94f9e54abc948d1e1146e7)
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | drivers/gpu/drm/i2c/tda998x_drv.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 92fcb3deae2..c2bd711e86e 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -782,6 +782,14 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder, de_pix_s = mode->htotal - mode->hdisplay; ref_pix = 3 + hs_pix_s; + /* + * Attached LCD controllers may generate broken sync. Allow + * those to adjust the position of the rising VS edge by adding + * HSKEW to ref_pix. + */ + if (adjusted_mode->flags & DRM_MODE_FLAG_HSKEW) + ref_pix += adjusted_mode->hskew; + if ((mode->flags & DRM_MODE_FLAG_INTERLACE) == 0) { ref_line = 1 + mode->vsync_start - mode->vdisplay; vwin1_line_s = mode->vtotal - mode->vdisplay - 1; |