diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-11 13:01:34 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-21 14:15:48 -0400 |
commit | 8ec22b214d76773c9d89f4040505ce10f677ed9a (patch) | |
tree | 7489b793162b248040eb4efb51d5b5933cb1cd6f /drivers/gpu/drm/i915/intel_hdmi.c | |
parent | 084b612ecf8e59973576b2f644e6949609c79375 (diff) |
drm/i915/hdmi: Query the live connector status bit for G4x
Similar to g4x_dp_detect() we should probe the PORT_HOTPLUG_STATUS as to
whether the connector is active prior to attempting to retrieve the EDID.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 2ead3bf7c21d..77f0f8fb9e35 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -452,6 +452,30 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
452 | return true; | 452 | return true; |
453 | } | 453 | } |
454 | 454 | ||
455 | static bool g4x_hdmi_connected(struct intel_hdmi *intel_hdmi) | ||
456 | { | ||
457 | struct drm_device *dev = intel_hdmi->base.base.dev; | ||
458 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
459 | uint32_t bit; | ||
460 | |||
461 | switch (intel_hdmi->sdvox_reg) { | ||
462 | case HDMIB: | ||
463 | bit = HDMIB_HOTPLUG_LIVE_STATUS; | ||
464 | break; | ||
465 | case HDMIC: | ||
466 | bit = HDMIC_HOTPLUG_LIVE_STATUS; | ||
467 | break; | ||
468 | case HDMID: | ||
469 | bit = HDMID_HOTPLUG_LIVE_STATUS; | ||
470 | break; | ||
471 | default: | ||
472 | bit = 0; | ||
473 | break; | ||
474 | } | ||
475 | |||
476 | return I915_READ(PORT_HOTPLUG_STAT) & bit; | ||
477 | } | ||
478 | |||
455 | static enum drm_connector_status | 479 | static enum drm_connector_status |
456 | intel_hdmi_detect(struct drm_connector *connector, bool force) | 480 | intel_hdmi_detect(struct drm_connector *connector, bool force) |
457 | { | 481 | { |
@@ -460,6 +484,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) | |||
460 | struct edid *edid; | 484 | struct edid *edid; |
461 | enum drm_connector_status status = connector_status_disconnected; | 485 | enum drm_connector_status status = connector_status_disconnected; |
462 | 486 | ||
487 | if (IS_G4X(connector->dev) && !g4x_hdmi_connected(intel_hdmi)) | ||
488 | return status; | ||
489 | |||
463 | intel_hdmi->has_hdmi_sink = false; | 490 | intel_hdmi->has_hdmi_sink = false; |
464 | intel_hdmi->has_audio = false; | 491 | intel_hdmi->has_audio = false; |
465 | edid = drm_get_edid(connector, | 492 | edid = drm_get_edid(connector, |