Commit 5f408339 authored by Adam Jackson's avatar Adam Jackson Committed by Greg Kroah-Hartman

drm/i915: Fix LVDS presence check

Combined patches from 2.6.33 for fixing LVDS detection.
7cf4f69d
    drm/i915: Don't set up the LVDS if it isn't in the BIOS device table.
38b3037e
    drm/i915: Fix LVDS presence check
6e36595a
    drm/i915: Declare the new VBT parsing functions as static
11ba1592
    drm/i915: Don't check for lid presence when detecting LVDS
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9c55fad2
...@@ -901,64 +901,45 @@ static const struct dmi_system_id intel_no_lvds[] = { ...@@ -901,64 +901,45 @@ static const struct dmi_system_id intel_no_lvds[] = {
{ } /* terminating entry */ { } /* terminating entry */
}; };
#ifdef CONFIG_ACPI
/* /*
* check_lid_device -- check whether @handle is an ACPI LID device. * Enumerate the child dev array parsed from VBT to check whether
* @handle: ACPI device handle * the LVDS is present.
* @level : depth in the ACPI namespace tree * If it is present, return 1.
* @context: the number of LID device when we find the device * If it is not present, return false.
* @rv: a return value to fill if desired (Not use) * If no child dev is parsed from VBT, it assumes that the LVDS is present.
* Note: The addin_offset should also be checked for LVDS panel.
* Only when it is non-zero, it is assumed that it is present.
*/ */
static acpi_status static int lvds_is_present_in_vbt(struct drm_device *dev)
check_lid_device(acpi_handle handle, u32 level, void *context,
void **return_value)
{ {
struct acpi_device *acpi_dev; struct drm_i915_private *dev_priv = dev->dev_private;
int *lid_present = context; struct child_device_config *p_child;
int i, ret;
acpi_dev = NULL;
/* Get the acpi device for device handle */
if (acpi_bus_get_device(handle, &acpi_dev) || !acpi_dev) {
/* If there is no ACPI device for handle, return */
return AE_OK;
}
if (!strncmp(acpi_device_hid(acpi_dev), "PNP0C0D", 7))
*lid_present = 1;
return AE_OK; if (!dev_priv->child_dev_num)
} return 1;
/** ret = 0;
* check whether there exists the ACPI LID device by enumerating the ACPI for (i = 0; i < dev_priv->child_dev_num; i++) {
* device tree. p_child = dev_priv->child_dev + i;
*/ /*
static int intel_lid_present(void) * If the device type is not LFP, continue.
{ * If the device type is 0x22, it is also regarded as LFP.
int lid_present = 0; */
if (p_child->device_type != DEVICE_TYPE_INT_LFP &&
p_child->device_type != DEVICE_TYPE_LFP)
continue;
if (acpi_disabled) { /* The addin_offset should be checked. Only when it is
/* If ACPI is disabled, there is no ACPI device tree to * non-zero, it is regarded as present.
* check, so assume the LID device would have been present.
*/ */
return 1; if (p_child->addin_offset) {
ret = 1;
break;
}
} }
return ret;
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
check_lid_device, &lid_present, NULL);
return lid_present;
}
#else
static int intel_lid_present(void)
{
/* In the absence of ACPI built in, assume that the LID device would
* have been present.
*/
return 1;
} }
#endif
/** /**
* intel_lvds_init - setup LVDS connectors on this device * intel_lvds_init - setup LVDS connectors on this device
...@@ -983,15 +964,10 @@ void intel_lvds_init(struct drm_device *dev) ...@@ -983,15 +964,10 @@ void intel_lvds_init(struct drm_device *dev)
if (dmi_check_system(intel_no_lvds)) if (dmi_check_system(intel_no_lvds))
return; return;
/* Assume that any device without an ACPI LID device also doesn't if (!lvds_is_present_in_vbt(dev)) {
* have an integrated LVDS. We would be better off parsing the BIOS DRM_DEBUG_KMS("LVDS is not present in VBT\n");
* to get a reliable indicator, but that code isn't written yet.
*
* In the case of all-in-one desktops using LVDS that we've seen,
* they're using SDVO LVDS.
*/
if (!intel_lid_present())
return; return;
}
if (IS_IGDNG(dev)) { if (IS_IGDNG(dev)) {
if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment