summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorChris Wilson2011-01-16 20:37:30 +0100
committerChris Wilson2011-01-19 13:32:21 +0100
commit01fe9dbde19a1a27b8ee63e2d964562962e1eb78 (patch)
treecede652e37a3e96acbbe04efe14be23bcc6ff8ea /drivers/gpu/drm/i915/intel_lvds.c
parentLinux 2.6.38-rc1 (diff)
downloadkernel-qcow2-linux-01fe9dbde19a1a27b8ee63e2d964562962e1eb78.tar.gz
kernel-qcow2-linux-01fe9dbde19a1a27b8ee63e2d964562962e1eb78.tar.xz
kernel-qcow2-linux-01fe9dbde19a1a27b8ee63e2d964562962e1eb78.zip
drm/i915: Use ACPI OpRegion to determine lid status
Admittedly, trusting ACPI or the BIOS at all to be correct is littered with numerous examples where it is wrong. Maybe, just maybe, we will have better luck using the ACPI OpRegion lid status... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index ace8d5d30dd2..fc6a0a9297c7 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -472,8 +472,15 @@ static enum drm_connector_status
intel_lvds_detect(struct drm_connector *connector, bool force)
{
struct drm_device *dev = connector->dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
enum drm_connector_status status = connector_status_connected;
+ /* Assume that the BIOS does not lie through the OpRegion... */
+ if (dev_priv->opregion.lid_state)
+ return ioread32(dev_priv->opregion.lid_state) & 0x1 ?
+ connector_status_connected :
+ connector_status_disconnected;
+
/* ACPI lid methods were generally unreliable in this generation, so
* don't even bother.
*/