aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Freed <bfreed@google.com>2011-01-12 16:38:39 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-19 08:14:42 -0500
commit9a4114ffa7b6f5f4635e3745a8dc051d15d4596a (patch)
tree44e4e062ffc2b2ce9ab9daef132a4e78c15a9077
parentaa9b500ddf1a6318e7cf8b1754696edddae86db9 (diff)
drm/i915/bios: Change default clock source on PineView to use SSC
The i915 driver normally assumes the video bios has configured several of the LVDS panel registers, and it just inherits the values. If the vbios has not run, several of these will need to be setup. If these are not correct then although the panel looks ok, output from an HDMI encoder (eg, Chrontel CH7036) will be incorrect. Signed-off-by: Mark Hayter <mdhayter@chromium.org> [ickle: minor adjustments] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 0b44956c336b..4b95295ab04a 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -251,6 +251,20 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
251 return; 251 return;
252} 252}
253 253
254static int intel_bios_ssc_frequency(struct drm_device *dev,
255 bool alternate)
256{
257 switch (INTEL_INFO(dev)->gen) {
258 case 2:
259 return alternate ? 66 : 48;
260 case 3:
261 case 4:
262 return alternate ? 100 : 96;
263 default:
264 return alternate ? 100 : 120;
265 }
266}
267
254static void 268static void
255parse_general_features(struct drm_i915_private *dev_priv, 269parse_general_features(struct drm_i915_private *dev_priv,
256 struct bdb_header *bdb) 270 struct bdb_header *bdb)
@@ -263,13 +277,8 @@ parse_general_features(struct drm_i915_private *dev_priv,
263 dev_priv->int_tv_support = general->int_tv_support; 277 dev_priv->int_tv_support = general->int_tv_support;
264 dev_priv->int_crt_support = general->int_crt_support; 278 dev_priv->int_crt_support = general->int_crt_support;
265 dev_priv->lvds_use_ssc = general->enable_ssc; 279 dev_priv->lvds_use_ssc = general->enable_ssc;
266 280 dev_priv->lvds_ssc_freq =
267 if (IS_I85X(dev)) 281 intel_bios_ssc_frequency(dev, general->ssc_freq);
268 dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48;
269 else if (IS_GEN5(dev) || IS_GEN6(dev))
270 dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 120;
271 else
272 dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96;
273 } 282 }
274} 283}
275 284
@@ -553,6 +562,8 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
553static void 562static void
554init_vbt_defaults(struct drm_i915_private *dev_priv) 563init_vbt_defaults(struct drm_i915_private *dev_priv)
555{ 564{
565 struct drm_device *dev = dev_priv->dev;
566
556 dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC; 567 dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC;
557 568
558 /* LFP panel data */ 569 /* LFP panel data */
@@ -565,7 +576,11 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
565 /* general features */ 576 /* general features */
566 dev_priv->int_tv_support = 1; 577 dev_priv->int_tv_support = 1;
567 dev_priv->int_crt_support = 1; 578 dev_priv->int_crt_support = 1;
568 dev_priv->lvds_use_ssc = 0; 579
580 /* Default to using SSC */
581 dev_priv->lvds_use_ssc = 1;
582 dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);
583 DRM_DEBUG("Set default to SSC at %dMHz\n", dev_priv->lvds_ssc_freq);
569 584
570 /* eDP data */ 585 /* eDP data */
571 dev_priv->edp.bpp = 18; 586 dev_priv->edp.bpp = 18;