drm/i915: Move the lvds OpRegion lid detection code to panel and reuse for eDP

Share the lid detection code for the all panels for consistent behaviour
and a single place to add the eventual quirks for crap hardware.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2011-02-12 10:29:38 +00:00
parent 47a05eca72
commit fe16d949b4
4 changed files with 25 additions and 9 deletions

View File

@@ -473,14 +473,11 @@ 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;
status = intel_panel_detect(dev);
if (status != connector_status_unknown)
return status;
/* ACPI lid methods were generally unreliable in this generation, so
* don't even bother.