<div>The i915 driver normally assumes the video bios has configured several </div><div>of the LVDS panel registers, and it just inherits the values. If the </div><div>vbios has not run, several of these will need to be setup. </div>
<div><br></div><div>intel_bios.c: default clock source selection on pineview to use the SSC source </div><div>intel_display.c: ensures the sync polarity to the panel is correct. </div><div><br></div><div>If these are not correct then although the panel looks ok, output from an HDMI</div>
<div>encoder (eg, Chrontel CH7036) will be incorrect. </div><div><br></div><div>Signed-off-by: Mark Hayter <<a href="mailto:mdhayter@chromium.org">mdhayter@chromium.org</a>></div><div><br></div><div><div>Index: drivers/gpu/drm/i915/i915_reg.h</div>
<div>diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h</div><div>index b463a0baa924ff1dee74ca8473b458927cfa0901..e325eaea4bfb289c76a093c5cada026eab6c3983 100644</div><div>--- a/drivers/gpu/drm/i915/i915_reg.h</div>
<div>+++ b/drivers/gpu/drm/i915/i915_reg.h</div><div>@@ -1056,6 +1056,10 @@</div><div> #define LVDS_PIPEB_SELECT<span class="Apple-tab-span" style="white-space:pre"> </span>(1 << 30)</div><div> /* LVDS dithering flag on 965/g4x platform */</div>
<div> #define LVDS_ENABLE_DITHER<span class="Apple-tab-span" style="white-space:pre"> </span>(1 << 25)</div><div>+/* LVDS sync polarity flags. Set to invert (i.e. negative) */</div><div>+#define LVDS_VSYNC_POLARITY<span class="Apple-tab-span" style="white-space:pre"> </span>(1 << 21)</div>
<div>+#define LVDS_HSYNC_POLARITY<span class="Apple-tab-span" style="white-space:pre"> </span>(1 << 20)</div><div>+</div><div> /* Enable border for unscaled (or aspect-scaled) display */</div><div> #define LVDS_BORDER_ENABLE<span class="Apple-tab-span" style="white-space:pre"> </span>(1 << 15)</div>
<div> /*</div><div>Index: drivers/gpu/drm/i915/intel_bios.c</div><div>diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c</div><div>index 943bbad066af79d6fc62891014f15479213aa34e..e2f3629b46a028077aee214bbc323a1b3ca9ca8f 100644</div>
<div>--- a/drivers/gpu/drm/i915/intel_bios.c</div><div>+++ b/drivers/gpu/drm/i915/intel_bios.c</div><div>@@ -506,6 +506,14 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>dev_priv->int_tv_support = 1;</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>dev_priv->int_crt_support = 1;</div><div> </div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (IS_PINEVIEW(dev_priv->dev)) {</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>/* On Pineview flip default to use SSC (VBT can override) */</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>dev_priv->lvds_use_ssc = 1;</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>/* The ssc pin gets 100MHz downspread from timing gen */</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>dev_priv->lvds_ssc_freq = 100;</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>} else {</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>dev_priv->lvds_use_ssc = 0;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>/* Set the Panel Power On/Off timings if uninitialized. */</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>if ((I915_READ(PP_ON_DELAYS) == 0) && (I915_READ(PP_OFF_DELAYS) == 0)) {</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>/* Set T2 to 40ms and T5 to 200ms */</div><div>Index: drivers/gpu/drm/i915/intel_display.c</div><div>diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c</div>
<div>index 787e6da01984a2c2296295359250cd436e0cf5fe..48d5994ade661d3213a712512f3e6c96c87dbd1f 100644</div><div>--- a/drivers/gpu/drm/i915/intel_display.c</div><div>+++ b/drivers/gpu/drm/i915/intel_display.c</div><div>@@ -3334,6 +3334,18 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>lvds &= ~LVDS_ENABLE_DITHER;</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>/* Only tested on pineview, should work on IS_9XX */</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (IS_PINEVIEW(dev)) {</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>/* Set sync polarity for case when vbios did not */</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>lvds |= LVDS_HSYNC_POLARITY;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>lvds &= ~LVDS_HSYNC_POLARITY;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>lvds |= LVDS_VSYNC_POLARITY;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)</div>
<div>+<span class="Apple-tab-span" style="white-space:pre"> </span>lvds &= ~LVDS_VSYNC_POLARITY;</div><div>+<span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>I915_WRITE(lvds_reg, lvds);</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>I915_READ(lvds_reg);</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>}</div></div><div><br></div>