aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorSimon Que <sque@chromium.org>2010-09-30 04:36:39 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-30 04:46:58 -0400
commit6a04002bea137d2c6359228316d9c827806e475f (patch)
treed6bcaa07ed37b90ad9dad9cdf0e0c94d74cb3ccc /drivers/gpu/drm/i915/intel_bios.c
parentf394940b8d275064f080a59dac636688dae3531a (diff)
i915: Added function to initialize VBT settings
Added a function that sets the LVDS values to default settings. This will be called by intel_init_bios before checking for the VBT (video BIOS table). The default values are thus loaded regardless of whether a VBT is found. The default settings in each parse function have been moved to the new function. This consolidates all the default settings into one place. The default dither bit value has been changed from 0 to 1. We can assume that display devices will want dithering enabled. Signed-off-by: Simon Que <sque@chromium.org> Acked-by: Olof Johansson <olof@lixom.net> [ickle: fixup for -next] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 7e868d228c7..b1f73ac0f3f 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -129,10 +129,6 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
129 int i, temp_downclock; 129 int i, temp_downclock;
130 struct drm_display_mode *temp_mode; 130 struct drm_display_mode *temp_mode;
131 131
132 /* Defaults if we can't find VBT info */
133 dev_priv->lvds_dither = 0;
134 dev_priv->lvds_vbt = 0;
135
136 lvds_options = find_section(bdb, BDB_LVDS_OPTIONS); 132 lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
137 if (!lvds_options) 133 if (!lvds_options)
138 return; 134 return;
@@ -140,6 +136,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
140 dev_priv->lvds_dither = lvds_options->pixel_dither; 136 dev_priv->lvds_dither = lvds_options->pixel_dither;
141 if (lvds_options->panel_type == 0xff) 137 if (lvds_options->panel_type == 0xff)
142 return; 138 return;
139
143 panel_type = lvds_options->panel_type; 140 panel_type = lvds_options->panel_type;
144 141
145 lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); 142 lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
@@ -232,8 +229,6 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
232 struct lvds_dvo_timing *dvo_timing; 229 struct lvds_dvo_timing *dvo_timing;
233 struct drm_display_mode *panel_fixed_mode; 230 struct drm_display_mode *panel_fixed_mode;
234 231
235 dev_priv->sdvo_lvds_vbt_mode = NULL;
236
237 sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS); 232 sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
238 if (!sdvo_lvds_options) 233 if (!sdvo_lvds_options)
239 return; 234 return;
@@ -262,10 +257,6 @@ parse_general_features(struct drm_i915_private *dev_priv,
262 struct drm_device *dev = dev_priv->dev; 257 struct drm_device *dev = dev_priv->dev;
263 struct bdb_general_features *general; 258 struct bdb_general_features *general;
264 259
265 /* Set sensible defaults in case we can't find the general block */
266 dev_priv->int_tv_support = 1;
267 dev_priv->int_crt_support = 1;
268
269 general = find_section(bdb, BDB_GENERAL_FEATURES); 260 general = find_section(bdb, BDB_GENERAL_FEATURES);
270 if (general) { 261 if (general) {
271 dev_priv->int_tv_support = general->int_tv_support; 262 dev_priv->int_tv_support = general->int_tv_support;
@@ -423,8 +414,6 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
423{ 414{
424 struct bdb_edp *edp; 415 struct bdb_edp *edp;
425 416
426 dev_priv->edp.bpp = 18;
427
428 edp = find_section(bdb, BDB_EDP); 417 edp = find_section(bdb, BDB_EDP);
429 if (!edp) { 418 if (!edp) {
430 if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) { 419 if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) {
@@ -528,6 +517,27 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
528 return; 517 return;
529} 518}
530 519
520static void
521init_vbt_defaults(struct drm_i915_private *dev_priv)
522{
523 dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC;
524
525 /* LFP panel data */
526 dev_priv->lvds_dither = 1;
527 dev_priv->lvds_vbt = 0;
528
529 /* SDVO panel data */
530 dev_priv->sdvo_lvds_vbt_mode = NULL;
531
532 /* general features */
533 dev_priv->int_tv_support = 1;
534 dev_priv->int_crt_support = 1;
535 dev_priv->lvds_use_ssc = 0;
536
537 /* eDP data */
538 dev_priv->edp.bpp = 18;
539}
540
531/** 541/**
532 * intel_init_bios - initialize VBIOS settings & find VBT 542 * intel_init_bios - initialize VBIOS settings & find VBT
533 * @dev: DRM device 543 * @dev: DRM device
@@ -545,7 +555,7 @@ intel_init_bios(struct drm_device *dev)
545 struct bdb_header *bdb = NULL; 555 struct bdb_header *bdb = NULL;
546 u8 __iomem *bios = NULL; 556 u8 __iomem *bios = NULL;
547 557
548 dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC; 558 init_vbt_defaults(dev_priv);
549 559
550 /* XXX Should this validation be moved to intel_opregion.c? */ 560 /* XXX Should this validation be moved to intel_opregion.c? */
551 if (dev_priv->opregion.vbt) { 561 if (dev_priv->opregion.vbt) {