diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 6b1148fc2cbe..6d4f91265354 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -27,6 +27,7 @@ | |||
27 | * Jesse Barnes <jesse.barnes@intel.com> | 27 | * Jesse Barnes <jesse.barnes@intel.com> |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/dmi.h> | ||
30 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
31 | #include "drmP.h" | 32 | #include "drmP.h" |
32 | #include "drm.h" | 33 | #include "drm.h" |
@@ -311,10 +312,8 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
311 | if (dev_priv->panel_fixed_mode != NULL) { | 312 | if (dev_priv->panel_fixed_mode != NULL) { |
312 | struct drm_display_mode *mode; | 313 | struct drm_display_mode *mode; |
313 | 314 | ||
314 | mutex_unlock(&dev->mode_config.mutex); | ||
315 | mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode); | 315 | mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode); |
316 | drm_mode_probed_add(connector, mode); | 316 | drm_mode_probed_add(connector, mode); |
317 | mutex_unlock(&dev->mode_config.mutex); | ||
318 | 317 | ||
319 | return 1; | 318 | return 1; |
320 | } | 319 | } |
@@ -405,6 +404,16 @@ void intel_lvds_init(struct drm_device *dev) | |||
405 | u32 lvds; | 404 | u32 lvds; |
406 | int pipe; | 405 | int pipe; |
407 | 406 | ||
407 | /* Blacklist machines that we know falsely report LVDS. */ | ||
408 | /* FIXME: add a check for the Aopen Mini PC */ | ||
409 | |||
410 | /* Apple Mac Mini Core Duo and Mac Mini Core 2 Duo */ | ||
411 | if(dmi_match(DMI_PRODUCT_NAME, "Macmini1,1") || | ||
412 | dmi_match(DMI_PRODUCT_NAME, "Macmini2,1")) { | ||
413 | DRM_DEBUG("Skipping LVDS initialization for Apple Mac Mini\n"); | ||
414 | return; | ||
415 | } | ||
416 | |||
408 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); | 417 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); |
409 | if (!intel_output) { | 418 | if (!intel_output) { |
410 | return; | 419 | return; |
@@ -458,7 +467,7 @@ void intel_lvds_init(struct drm_device *dev) | |||
458 | dev_priv->panel_fixed_mode = | 467 | dev_priv->panel_fixed_mode = |
459 | drm_mode_duplicate(dev, scan); | 468 | drm_mode_duplicate(dev, scan); |
460 | mutex_unlock(&dev->mode_config.mutex); | 469 | mutex_unlock(&dev->mode_config.mutex); |
461 | goto out; /* FIXME: check for quirks */ | 470 | goto out; |
462 | } | 471 | } |
463 | mutex_unlock(&dev->mode_config.mutex); | 472 | mutex_unlock(&dev->mode_config.mutex); |
464 | } | 473 | } |
@@ -492,7 +501,7 @@ void intel_lvds_init(struct drm_device *dev) | |||
492 | if (dev_priv->panel_fixed_mode) { | 501 | if (dev_priv->panel_fixed_mode) { |
493 | dev_priv->panel_fixed_mode->type |= | 502 | dev_priv->panel_fixed_mode->type |= |
494 | DRM_MODE_TYPE_PREFERRED; | 503 | DRM_MODE_TYPE_PREFERRED; |
495 | goto out; /* FIXME: check for quirks */ | 504 | goto out; |
496 | } | 505 | } |
497 | } | 506 | } |
498 | 507 | ||
@@ -500,38 +509,6 @@ void intel_lvds_init(struct drm_device *dev) | |||
500 | if (!dev_priv->panel_fixed_mode) | 509 | if (!dev_priv->panel_fixed_mode) |
501 | goto failed; | 510 | goto failed; |
502 | 511 | ||
503 | /* FIXME: detect aopen & mac mini type stuff automatically? */ | ||
504 | /* | ||
505 | * Blacklist machines with BIOSes that list an LVDS panel without | ||
506 | * actually having one. | ||
507 | */ | ||
508 | if (IS_I945GM(dev)) { | ||
509 | /* aopen mini pc */ | ||
510 | if (dev->pdev->subsystem_vendor == 0xa0a0) | ||
511 | goto failed; | ||
512 | |||
513 | if ((dev->pdev->subsystem_vendor == 0x8086) && | ||
514 | (dev->pdev->subsystem_device == 0x7270)) { | ||
515 | /* It's a Mac Mini or Macbook Pro. | ||
516 | * | ||
517 | * Apple hardware is out to get us. The macbook pro | ||
518 | * has a real LVDS panel, but the mac mini does not, | ||
519 | * and they have the same device IDs. We'll | ||
520 | * distinguish by panel size, on the assumption | ||
521 | * that Apple isn't about to make any machines with an | ||
522 | * 800x600 display. | ||
523 | */ | ||
524 | |||
525 | if (dev_priv->panel_fixed_mode != NULL && | ||
526 | dev_priv->panel_fixed_mode->hdisplay == 800 && | ||
527 | dev_priv->panel_fixed_mode->vdisplay == 600) { | ||
528 | DRM_DEBUG("Suspected Mac Mini, ignoring the LVDS\n"); | ||
529 | goto failed; | ||
530 | } | ||
531 | } | ||
532 | } | ||
533 | |||
534 | |||
535 | out: | 512 | out: |
536 | drm_sysfs_connector_add(connector); | 513 | drm_sysfs_connector_add(connector); |
537 | return; | 514 | return; |