dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Darren Etheridge <detheridge@ti.com>,
	David Airlie <airlied@linux.ie>, Rob Clark <robdclark@gmail.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/8] drm/i2c: tda998x: prepare for broken sync workaround
Date: Tue,  6 Aug 2013 00:20:17 +0200	[thread overview]
Message-ID: <1375741218-10225-8-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1375741218-10225-1-git-send-email-sebastian.hesselbarth@gmail.com>

From: Darren Etheridge <detheridge@ti.com>

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>
---
Changelog:
for v1:
- reword comment

Cc: David Airlie <airlied@linux.ie>
Cc: Darren Etheridge <detheridge@ti.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/gpu/drm/i2c/tda998x_drv.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 7bf227a..7dc5650 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -784,6 +784,15 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder,
 	n_line       = mode->vtotal;
 
 	ref_pix      = 3 + mode->hsync_start - mode->hdisplay;
+
+	/*
+	 * 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;
+
 	de_pix_s     = mode->htotal - mode->hdisplay;
 	de_pix_e     = de_pix_s + mode->hdisplay;
 	hs_pix_s     = mode->hsync_start - mode->hdisplay;
-- 
1.7.10.4

  parent reply	other threads:[~2013-08-05 22:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 22:20 [PATCH 0/8] Several NXP TDA998x patches Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 1/8] drm/i2c: tda998x: fix EDID reading on TDA19988 devices Sebastian Hesselbarth
2013-08-14 12:16   ` Russell King - ARM Linux
2013-08-14 12:32     ` Rob Clark
2013-08-05 22:20 ` [PATCH 2/8] drm/i2c: tda998x: ensure VIP output mux is properly set Sebastian Hesselbarth
2013-08-14 12:15   ` Russell King - ARM Linux
2013-08-05 22:20 ` [PATCH 3/8] drm/i2c: tda998x: fix npix/nline programming Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 4/8] drm/i2c: tda998x: prepare for video input configuration Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 5/8] drm/i2c: tda998x: add video and audio " Sebastian Hesselbarth
2013-08-14 12:20   ` Russell King - ARM Linux
2013-08-14 14:12   ` Russell King - ARM Linux
2013-08-14 14:34     ` Sebastian Hesselbarth
2013-08-05 22:20 ` [PATCH 6/8] drm/i2c: tda998x: fix sync generation and calculation Sebastian Hesselbarth
2013-08-14 12:41   ` Russell King - ARM Linux
2013-08-14 14:14     ` Sebastian Hesselbarth
2013-08-14 14:35   ` Russell King - ARM Linux
2013-08-05 22:20 ` Sebastian Hesselbarth [this message]
2013-08-05 22:20 ` [PATCH 8/8] drm/tilcdc fixup mode to workaound sync for tda998x Sebastian Hesselbarth
2013-08-06 16:26 ` [PATCH 0/8] Several NXP TDA998x patches Etheridge, Darren
2013-08-08 22:08 ` Darren Etheridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375741218-10225-8-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=detheridge@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).