diff options
author | Paul Collins <paul@burly.ondioline.org> | 2009-02-04 05:05:41 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-02-08 06:38:18 -0500 |
commit | 565dcd4635f4f8c0ac4dee38a5625bc325799b1e (patch) | |
tree | ecca86f11004a98829cd3eadfb23fc74865d88d8 /drivers/gpu/drm/i915/intel_lvds.c | |
parent | e2f0ba97d60e59fe5c6237851933a9c38a8f9a24 (diff) |
drm/i915: skip LVDS initialization on Apple Mac Mini
The Apple Mac Mini falsely reports LVDS. Use DMI to check whether we
are running on a Mac Mini, and skip LVDS initialization if that proves
to be the case.
Signed-off-by: Paul Collins <paul@ondioline.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index cf8da644faf2..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" |
@@ -403,6 +404,16 @@ void intel_lvds_init(struct drm_device *dev) | |||
403 | u32 lvds; | 404 | u32 lvds; |
404 | int pipe; | 405 | int pipe; |
405 | 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 | |||
406 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); | 417 | intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); |
407 | if (!intel_output) { | 418 | if (!intel_output) { |
408 | return; | 419 | return; |
@@ -456,7 +467,7 @@ void intel_lvds_init(struct drm_device *dev) | |||
456 | dev_priv->panel_fixed_mode = | 467 | dev_priv->panel_fixed_mode = |
457 | drm_mode_duplicate(dev, scan); | 468 | drm_mode_duplicate(dev, scan); |
458 | mutex_unlock(&dev->mode_config.mutex); | 469 | mutex_unlock(&dev->mode_config.mutex); |
459 | goto out; /* FIXME: check for quirks */ | 470 | goto out; |
460 | } | 471 | } |
461 | mutex_unlock(&dev->mode_config.mutex); | 472 | mutex_unlock(&dev->mode_config.mutex); |
462 | } | 473 | } |
@@ -490,7 +501,7 @@ void intel_lvds_init(struct drm_device *dev) | |||
490 | if (dev_priv->panel_fixed_mode) { | 501 | if (dev_priv->panel_fixed_mode) { |
491 | dev_priv->panel_fixed_mode->type |= | 502 | dev_priv->panel_fixed_mode->type |= |
492 | DRM_MODE_TYPE_PREFERRED; | 503 | DRM_MODE_TYPE_PREFERRED; |
493 | goto out; /* FIXME: check for quirks */ | 504 | goto out; |
494 | } | 505 | } |
495 | } | 506 | } |
496 | 507 | ||
@@ -498,38 +509,6 @@ void intel_lvds_init(struct drm_device *dev) | |||
498 | if (!dev_priv->panel_fixed_mode) | 509 | if (!dev_priv->panel_fixed_mode) |
499 | goto failed; | 510 | goto failed; |
500 | 511 | ||
501 | /* FIXME: detect aopen & mac mini type stuff automatically? */ | ||
502 | /* | ||
503 | * Blacklist machines with BIOSes that list an LVDS panel without | ||
504 | * actually having one. | ||
505 | */ | ||
506 | if (IS_I945GM(dev)) { | ||
507 | /* aopen mini pc */ | ||
508 | if (dev->pdev->subsystem_vendor == 0xa0a0) | ||
509 | goto failed; | ||
510 | |||
511 | if ((dev->pdev->subsystem_vendor == 0x8086) && | ||
512 | (dev->pdev->subsystem_device == 0x7270)) { | ||
513 | /* It's a Mac Mini or Macbook Pro. | ||
514 | * | ||
515 | * Apple hardware is out to get us. The macbook pro | ||
516 | * has a real LVDS panel, but the mac mini does not, | ||
517 | * and they have the same device IDs. We'll | ||
518 | * distinguish by panel size, on the assumption | ||
519 | * that Apple isn't about to make any machines with an | ||
520 | * 800x600 display. | ||
521 | */ | ||
522 | |||
523 | if (dev_priv->panel_fixed_mode != NULL && | ||
524 | dev_priv->panel_fixed_mode->hdisplay == 800 && | ||
525 | dev_priv->panel_fixed_mode->vdisplay == 600) { | ||
526 | DRM_DEBUG("Suspected Mac Mini, ignoring the LVDS\n"); | ||
527 | goto failed; | ||
528 | } | ||
529 | } | ||
530 | } | ||
531 | |||
532 | |||
533 | out: | 512 | out: |
534 | drm_sysfs_connector_add(connector); | 513 | drm_sysfs_connector_add(connector); |
535 | return; | 514 | return; |