diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 716409a57244..300aee3296c2 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -103,7 +103,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
103 | struct bdb_lvds_lfp_data_entry *entry; | 103 | struct bdb_lvds_lfp_data_entry *entry; |
104 | struct lvds_dvo_timing *dvo_timing; | 104 | struct lvds_dvo_timing *dvo_timing; |
105 | struct drm_display_mode *panel_fixed_mode; | 105 | struct drm_display_mode *panel_fixed_mode; |
106 | int lfp_data_size; | 106 | int lfp_data_size, dvo_timing_offset; |
107 | 107 | ||
108 | /* Defaults if we can't find VBT info */ | 108 | /* Defaults if we can't find VBT info */ |
109 | dev_priv->lvds_dither = 0; | 109 | dev_priv->lvds_dither = 0; |
@@ -132,7 +132,16 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
132 | entry = (struct bdb_lvds_lfp_data_entry *) | 132 | entry = (struct bdb_lvds_lfp_data_entry *) |
133 | ((uint8_t *)lvds_lfp_data->data + (lfp_data_size * | 133 | ((uint8_t *)lvds_lfp_data->data + (lfp_data_size * |
134 | lvds_options->panel_type)); | 134 | lvds_options->panel_type)); |
135 | dvo_timing = &entry->dvo_timing; | 135 | dvo_timing_offset = lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset - |
136 | lvds_lfp_data_ptrs->ptr[0].fp_timing_offset; | ||
137 | |||
138 | /* | ||
139 | * the size of fp_timing varies on the different platform. | ||
140 | * So calculate the DVO timing relative offset in LVDS data | ||
141 | * entry to get the DVO timing entry | ||
142 | */ | ||
143 | dvo_timing = (struct lvds_dvo_timing *) | ||
144 | ((unsigned char *)entry + dvo_timing_offset); | ||
136 | 145 | ||
137 | panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); | 146 | panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); |
138 | 147 | ||
@@ -195,10 +204,12 @@ parse_general_features(struct drm_i915_private *dev_priv, | |||
195 | dev_priv->lvds_use_ssc = general->enable_ssc; | 204 | dev_priv->lvds_use_ssc = general->enable_ssc; |
196 | 205 | ||
197 | if (dev_priv->lvds_use_ssc) { | 206 | if (dev_priv->lvds_use_ssc) { |
198 | if (IS_I855(dev_priv->dev)) | 207 | if (IS_I85X(dev_priv->dev)) |
199 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48; | 208 | dev_priv->lvds_ssc_freq = |
200 | else | 209 | general->ssc_freq ? 66 : 48; |
201 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96; | 210 | else |
211 | dev_priv->lvds_ssc_freq = | ||
212 | general->ssc_freq ? 100 : 96; | ||
202 | } | 213 | } |
203 | } | 214 | } |
204 | } | 215 | } |
@@ -285,6 +296,25 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv, | |||
285 | } | 296 | } |
286 | return; | 297 | return; |
287 | } | 298 | } |
299 | |||
300 | static void | ||
301 | parse_driver_features(struct drm_i915_private *dev_priv, | ||
302 | struct bdb_header *bdb) | ||
303 | { | ||
304 | struct drm_device *dev = dev_priv->dev; | ||
305 | struct bdb_driver_features *driver; | ||
306 | |||
307 | /* set default for chips without eDP */ | ||
308 | if (!SUPPORTS_EDP(dev)) { | ||
309 | dev_priv->edp_support = 0; | ||
310 | return; | ||
311 | } | ||
312 | |||
313 | driver = find_section(bdb, BDB_DRIVER_FEATURES); | ||
314 | if (driver && driver->lvds_config == BDB_DRIVER_FEATURE_EDP) | ||
315 | dev_priv->edp_support = 1; | ||
316 | } | ||
317 | |||
288 | /** | 318 | /** |
289 | * intel_init_bios - initialize VBIOS settings & find VBT | 319 | * intel_init_bios - initialize VBIOS settings & find VBT |
290 | * @dev: DRM device | 320 | * @dev: DRM device |
@@ -335,6 +365,8 @@ intel_init_bios(struct drm_device *dev) | |||
335 | parse_lfp_panel_data(dev_priv, bdb); | 365 | parse_lfp_panel_data(dev_priv, bdb); |
336 | parse_sdvo_panel_data(dev_priv, bdb); | 366 | parse_sdvo_panel_data(dev_priv, bdb); |
337 | parse_sdvo_device_mapping(dev_priv, bdb); | 367 | parse_sdvo_device_mapping(dev_priv, bdb); |
368 | parse_driver_features(dev_priv, bdb); | ||
369 | |||
338 | pci_unmap_rom(pdev, bios); | 370 | pci_unmap_rom(pdev, bios); |
339 | 371 | ||
340 | return 0; | 372 | return 0; |