[PATCH] drm/i915/hdmi: only enable audio if there's a hdmi sink
Daniel Vetter
daniel.vetter at ffwll.ch
Thu Aug 30 00:44:36 PDT 2012
Some monitors totally don't like to receive infoframes, and naturally
don't claim to support hdmi.
But for some odd reason they've added a CEA block to their edid,
which automatically gives you basic audio. Still, we may not send
out hdmi infoframes to them, hence check whether the sink is indeed
hdmi capable.
Also kill a stale comment while at it.
References: http://www.mail-archive.com/dri-devel@lists.freedesktop.org/msg26765.html
Cc: Adam Jackson <ajax at redhat.com>
Cc: Ian Pilcher <arequipeno at gmail.com>
Cc: stable at vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index e4c37bb..7d35367 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -735,7 +735,11 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI)
intel_hdmi->has_hdmi_sink =
drm_detect_hdmi_monitor(edid);
- intel_hdmi->has_audio = drm_detect_monitor_audio(edid);
+
+ /* We are only allowed to send audio and audio related
+ * infoframes if it's an hdmi monitor. */
+ intel_hdmi->has_audio = intel_hdmi->has_hdmi_sink &&
+ drm_detect_monitor_audio(edid);
}
connector->display_info.raw_edid = NULL;
kfree(edid);
@@ -755,10 +759,6 @@ static int intel_hdmi_get_modes(struct drm_connector *connector)
struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
struct drm_i915_private *dev_priv = connector->dev->dev_private;
- /* We should parse the EDID data and find out if it's an HDMI sink so
- * we can send audio to it.
- */
-
return intel_ddc_get_modes(connector,
intel_gmbus_get_adapter(dev_priv,
intel_hdmi->ddc_bus));
@@ -783,7 +783,9 @@ intel_hdmi_detect_audio(struct drm_connector *connector)
kfree(edid);
}
- return has_audio;
+ /* We are only allowed to send audio and audio related
+ * infoframes if it's an hdmi monitor. */
+ return intel_hdmi->has_hdmi_sink && has_audio;
}
static int
--
1.7.10.4
More information about the dri-devel
mailing list