Sorry, bad patch email.<div><br></div><div>Working on it...</div><div><br></div><div>bryan.<br><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 11:23 AM, <span dir="ltr"><<a href="mailto:bfreed@chromium.org">bfreed@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">intel_display.c: ensures the sync polarity to the panel is correct<br>
and issues a message if the driver changes it.<br>
<br>
If these are not correct then although the panel looks ok, output from an HDMI<br>
encoder (eg, Chrontel CH7036) will be incorrect.<br>
<br>
Signed-off-by: Mark Hayter <<a href="mailto:mdhayter@chromium.org">mdhayter@chromium.org</a>><br>
<br>
Index: drivers/gpu/drm/i915/i915_reg.h<br>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h<br>
index b463a0baa924ff1dee74ca8473b458927cfa0901..e325eaea4bfb289c76a093c5cada026eab6c3983 100644<br>
--- a/drivers/gpu/drm/i915/i915_reg.h<br>
+++ b/drivers/gpu/drm/i915/i915_reg.h<br>
@@ -1056,6 +1056,10 @@<br>
#define LVDS_PIPEB_SELECT (1 << 30)<br>
/* LVDS dithering flag on 965/g4x platform */<br>
#define LVDS_ENABLE_DITHER (1 << 25)<br>
+/* LVDS sync polarity flags. Set to invert (i.e. negative) */<br>
+#define LVDS_VSYNC_POLARITY (1 << 21)<br>
+#define LVDS_HSYNC_POLARITY (1 << 20)<br>
+<br>
/* Enable border for unscaled (or aspect-scaled) display */<br>
#define LVDS_BORDER_ENABLE (1 << 15)<br>
/*<br>
Index: drivers/gpu/drm/i915/intel_display.c<br>
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c<br>
index 787e6da01984a2c2296295359250cd436e0cf5fe..9893e53e394cc9140167b9884c05efd62c4f139c 100644<br>
--- a/drivers/gpu/drm/i915/intel_display.c<br>
+++ b/drivers/gpu/drm/i915/intel_display.c<br>
@@ -3334,6 +3334,29 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,<br>
lvds &= ~LVDS_ENABLE_DITHER;<br>
}<br>
}<br>
+ /* Only tested on pineview, should work on IS_9XX */<br>
+ if (IS_PINEVIEW(dev)) {<br>
+ /* Set sync polarity for case when vbios did not */<br>
+ char curhs, curvs, newhs, newvs;<br>
+ curhs = (lvds & LVDS_HSYNC_POLARITY) ? '-' : '+';<br>
+ curvs = (lvds & LVDS_VSYNC_POLARITY) ? '-' : '+';<br>
+ newhs = (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ?<br>
+ '-' : '+';<br>
+ newvs = (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) ?<br>
+ '-' : '+';<br>
+ if ((newhs != curhs) || (newvs != curvs)) {<br>
+ DRM_INFO("Change lvds panel from %chsync "<br>
+ "%cvsync to %chsync %cvsync\n",<br>
+ curhs, curvs, newhs, newvs);<br>
+ /* Clear to both + polarity */<br>
+ lvds &= ~(LVDS_HSYNC_POLARITY |<br>
+ LVDS_VSYNC_POLARITY);<br>
+ if (newhs == '-')<br>
+ lvds |= LVDS_HSYNC_POLARITY;<br>
+ if (newvs == '-')<br>
+ lvds |= LVDS_VSYNC_POLARITY;<br>
+ }<br>
+ }<br>
I915_WRITE(lvds_reg, lvds);<br>
I915_READ(lvds_reg);<br>
}<br>
</blockquote></div><br></div>