diff options
author | Alan Cox <alan@linux.intel.com> | 2011-11-29 17:27:57 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-06 04:55:42 -0500 |
commit | 1b22edfd6efd02b6cb9cfe3389ed54731abb3a45 (patch) | |
tree | 1c3fddcf3e7fbf086e857884113a748d9b9d17e7 /drivers | |
parent | aa0c45fdca0cff3d1ba06578a84c9bc7f29a0960 (diff) |
gma500: Oaktrail BIOS handling
Now that we pull the right BIOS data out of the hat we need to use it when
doing our panel setup.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_device.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_lvds.c | 37 |
2 files changed, 36 insertions, 12 deletions
diff --git a/drivers/gpu/drm/gma500/oaktrail_device.c b/drivers/gpu/drm/gma500/oaktrail_device.c index c1ffb113958b..63aea2f010d9 100644 --- a/drivers/gpu/drm/gma500/oaktrail_device.c +++ b/drivers/gpu/drm/gma500/oaktrail_device.c | |||
@@ -457,9 +457,13 @@ static int oaktrail_power_up(struct drm_device *dev) | |||
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
460 | static void oaktrail_chip_setup(struct drm_device *dev) | 460 | static int oaktrail_chip_setup(struct drm_device *dev) |
461 | { | 461 | { |
462 | int ret = mid_chip_setup(dev); | 462 | struct drm_psb_private *dev_priv = dev->dev_private; |
463 | struct oaktrail_vbt *vbt = &dev_priv->vbt_data; | ||
464 | int ret; | ||
465 | |||
466 | ret = mid_chip_setup(dev); | ||
463 | if (ret < 0) | 467 | if (ret < 0) |
464 | return ret; | 468 | return ret; |
465 | if (vbt->size == 0) { | 469 | if (vbt->size == 0) { |
@@ -472,6 +476,9 @@ static void oaktrail_chip_setup(struct drm_device *dev) | |||
472 | 476 | ||
473 | static void oaktrail_teardown(struct drm_device *dev) | 477 | static void oaktrail_teardown(struct drm_device *dev) |
474 | { | 478 | { |
479 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
480 | struct oaktrail_vbt *vbt = &dev_priv->vbt_data; | ||
481 | |||
475 | oaktrail_hdmi_teardown(dev); | 482 | oaktrail_hdmi_teardown(dev); |
476 | if (vbt->size == 0) | 483 | if (vbt->size == 0) |
477 | psb_intel_destroy_bios(dev); | 484 | psb_intel_destroy_bios(dev); |
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c index a552226a08ff..69659cad6778 100644 --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c | |||
@@ -228,17 +228,20 @@ static struct drm_display_mode lvds_configuration_modes[] = { | |||
228 | 228 | ||
229 | /* Returns the panel fixed mode from configuration. */ | 229 | /* Returns the panel fixed mode from configuration. */ |
230 | 230 | ||
231 | static struct drm_display_mode * | 231 | static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev, |
232 | oaktrail_lvds_get_configuration_mode(struct drm_device *dev) | 232 | struct psb_intel_mode_device *mode_dev) |
233 | { | 233 | { |
234 | struct drm_display_mode *mode = NULL; | 234 | struct drm_display_mode *mode = NULL; |
235 | struct drm_psb_private *dev_priv = dev->dev_private; | 235 | struct drm_psb_private *dev_priv = dev->dev_private; |
236 | struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD; | 236 | struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD; |
237 | 237 | ||
238 | mode_dev->panel_fixed_mode = NULL; | ||
239 | |||
240 | /* Use the firmware provided data on Moorestown */ | ||
238 | if (dev_priv->vbt_data.size != 0x00) { /*if non-zero, then use vbt*/ | 241 | if (dev_priv->vbt_data.size != 0x00) { /*if non-zero, then use vbt*/ |
239 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); | 242 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); |
240 | if (!mode) | 243 | if (!mode) |
241 | return NULL; | 244 | return; |
242 | 245 | ||
243 | mode->hdisplay = (ti->hactive_hi << 8) | ti->hactive_lo; | 246 | mode->hdisplay = (ti->hactive_hi << 8) | ti->hactive_lo; |
244 | mode->vdisplay = (ti->vactive_hi << 8) | ti->vactive_lo; | 247 | mode->vdisplay = (ti->vactive_hi << 8) | ti->vactive_lo; |
@@ -270,13 +273,27 @@ oaktrail_lvds_get_configuration_mode(struct drm_device *dev) | |||
270 | printk(KERN_INFO "vtotal is %d\n", mode->vtotal); | 273 | printk(KERN_INFO "vtotal is %d\n", mode->vtotal); |
271 | printk(KERN_INFO "clock is %d\n", mode->clock); | 274 | printk(KERN_INFO "clock is %d\n", mode->clock); |
272 | #endif | 275 | #endif |
273 | } else | 276 | mode_dev->panel_fixed_mode = mode; |
274 | mode = drm_mode_duplicate(dev, &lvds_configuration_modes[2]); | 277 | } |
275 | |||
276 | drm_mode_set_name(mode); | ||
277 | drm_mode_set_crtcinfo(mode, 0); | ||
278 | 278 | ||
279 | return mode; | 279 | /* Use the BIOS VBT mode if available */ |
280 | if (mode_dev->panel_fixed_mode == NULL && mode_dev->vbt_mode) | ||
281 | mode_dev->panel_fixed_mode = drm_mode_duplicate(dev, | ||
282 | mode_dev->vbt_mode); | ||
283 | |||
284 | /* Then try the LVDS VBT mode */ | ||
285 | if (mode_dev->panel_fixed_mode == NULL) | ||
286 | if (dev_priv->lfp_lvds_vbt_mode) | ||
287 | mode_dev->panel_fixed_mode = | ||
288 | drm_mode_duplicate(dev, | ||
289 | dev_priv->lfp_lvds_vbt_mode); | ||
290 | /* Then guess */ | ||
291 | if (mode_dev->panel_fixed_mode == NULL) | ||
292 | mode_dev->panel_fixed_mode | ||
293 | = drm_mode_duplicate(dev, &lvds_configuration_modes[2]); | ||
294 | |||
295 | drm_mode_set_name(mode_dev->panel_fixed_mode); | ||
296 | drm_mode_set_crtcinfo(mode_dev->panel_fixed_mode, 0); | ||
280 | } | 297 | } |
281 | 298 | ||
282 | /** | 299 | /** |
@@ -375,7 +392,7 @@ void oaktrail_lvds_init(struct drm_device *dev, | |||
375 | * If we didn't get EDID, try geting panel timing | 392 | * If we didn't get EDID, try geting panel timing |
376 | * from configuration data | 393 | * from configuration data |
377 | */ | 394 | */ |
378 | mode_dev->panel_fixed_mode = oaktrail_lvds_get_configuration_mode(dev); | 395 | oaktrail_lvds_get_configuration_mode(dev, mode_dev); |
379 | 396 | ||
380 | if (mode_dev->panel_fixed_mode) { | 397 | if (mode_dev->panel_fixed_mode) { |
381 | mode_dev->panel_fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; | 398 | mode_dev->panel_fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; |