drm/i915/hdmi: only enable audio if there's a hdmi sink
diff mbox

Message ID 1346312676-17857-1-git-send-email-daniel.vetter@ffwll.ch
State New, archived
Headers show

Commit Message

Daniel Vetter Aug. 30, 2012, 7:44 a.m. UTC
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@redhat.com>
Cc: Ian Pilcher <arequipeno@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_hdmi.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Adam Jackson Aug. 30, 2012, 3:32 p.m. UTC | #1
On 8/30/12 3:44 AM, Daniel Vetter wrote:
> 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.

Does an incomplete version of what it says on the box, you need to hit 
the HDMI code in intel_sdvo.c too.

At which point, should do the obvious bool drm_monitor_has_hdmi_audio() 
in drm_edid.c.

- ajax

Patch
diff mbox

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