diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2009-11-23 20:48:47 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-11-30 19:54:35 -0500 |
commit | 7cf4f69d3f4511f443473954456cb91d5514756d (patch) | |
tree | ee6792f00c1926bd4368aded316181d8ec118387 /drivers/gpu/drm/i915/intel_lvds.c | |
parent | ae266c98f580a9ba5e0bfdb1d1f0f70ab3cd807f (diff) |
drm/i915: Don't set up the LVDS if it isn't in the BIOS device table.
We not only check the device type, but also check the addin_offset. If the
addin_offset is zero, it won't be initialized.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
[anholt: hand-applied due to conflicts]
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index ab48edde4c9f..7fec70145a3d 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -968,6 +968,46 @@ static void intel_find_lvds_downclock(struct drm_device *dev, | |||
968 | return; | 968 | return; |
969 | } | 969 | } |
970 | 970 | ||
971 | /* | ||
972 | * Enumerate the child dev array parsed from VBT to check whether | ||
973 | * the LVDS is present. | ||
974 | * If it is present, return 1. | ||
975 | * If it is not present, return false. | ||
976 | * If no child dev is parsed from VBT, it assumes that the LVDS is present. | ||
977 | * Note: The addin_offset should also be checked for LVDS panel. | ||
978 | * Only when it is non-zero, it is assumed that it is present. | ||
979 | */ | ||
980 | int lvds_is_present_in_vbt(struct drm_device *dev) | ||
981 | { | ||
982 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
983 | struct child_device_config *p_child; | ||
984 | int i, ret; | ||
985 | |||
986 | if (!dev_priv->child_dev_num) | ||
987 | return 1; | ||
988 | |||
989 | ret = 0; | ||
990 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
991 | p_child = dev_priv->child_dev + i; | ||
992 | /* | ||
993 | * If the device type is not LFP, continue. | ||
994 | * If the device type is 0x22, it is also regarded as LFP. | ||
995 | */ | ||
996 | if (p_child->device_type != DEVICE_TYPE_INT_LFP && | ||
997 | p_child->device_type != DEVICE_TYPE_LFP) | ||
998 | continue; | ||
999 | |||
1000 | /* The addin_offset should be checked. Only when it is | ||
1001 | * non-zero, it is regarded as present. | ||
1002 | */ | ||
1003 | if (p_child->addin_offset) { | ||
1004 | ret = 1; | ||
1005 | break; | ||
1006 | } | ||
1007 | } | ||
1008 | return ret; | ||
1009 | } | ||
1010 | |||
971 | /** | 1011 | /** |
972 | * intel_lvds_init - setup LVDS connectors on this device | 1012 | * intel_lvds_init - setup LVDS connectors on this device |
973 | * @dev: drm device | 1013 | * @dev: drm device |
@@ -991,6 +1031,10 @@ void intel_lvds_init(struct drm_device *dev) | |||
991 | if (dmi_check_system(intel_no_lvds)) | 1031 | if (dmi_check_system(intel_no_lvds)) |
992 | return; | 1032 | return; |
993 | 1033 | ||
1034 | if (!lvds_is_present_in_vbt(dev)) { | ||
1035 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); | ||
1036 | return; | ||
1037 | } | ||
994 | /* Assume that any device without an ACPI LID device also doesn't | 1038 | /* Assume that any device without an ACPI LID device also doesn't |
995 | * have an integrated LVDS. We would be better off parsing the BIOS | 1039 | * have an integrated LVDS. We would be better off parsing the BIOS |
996 | * to get a reliable indicator, but that code isn't written yet. | 1040 | * to get a reliable indicator, but that code isn't written yet. |