diff mbox

[1/2] drm/i2c/tda998x prepare for tilcdc sync workaround

Message ID 1374777138-22567-2-git-send-email-detheridge@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Etheridge, Darren July 25, 2013, 6:32 p.m. UTC
Add necessary support for flipping the hsync signal and shifting
the display to the right by a certain number of pixels.  Changes
only take effect if adjusted_mode is changed in fixup function.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
---
 drivers/gpu/drm/i2c/tda998x_drv.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index e384b59..ad870e6 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -778,6 +778,16 @@  tda998x_encoder_mode_set(struct drm_encoder *encoder,
 	n_line       = mode->vtotal;
 
 	ref_pix      = 3 + mode->hsync_start - mode->hdisplay;
+
+	/*
+	 * handle issue on TILCDC where it is outputing
+	 * non-VESA compliant sync signals the workaround
+	 * forces us to invert the HSYNC, so need to adjust display to
+	 * the left by hskew pixels, provided by the tilcdc driver
+	 */
+	if (adjusted_mode->flags & DRM_MODE_FLAG_HSKEW)
+		ref_pix += adjusted_mode->hskew;
+
 	de_pix_s     = mode->htotal - mode->hdisplay;
 	de_pix_e     = de_pix_s + mode->hdisplay;
 	hs_pix_s     = mode->hsync_start - mode->hdisplay;