From patchwork Thu Aug 30 07:44:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1386841 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 9A960DF215 for ; Thu, 30 Aug 2012 07:45:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EC49A0280 for ; Thu, 30 Aug 2012 00:45:59 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id A83C4A02D3 for ; Thu, 30 Aug 2012 00:44:15 -0700 (PDT) Received: by wgbds1 with SMTP id ds1so4106814wgb.0 for ; Thu, 30 Aug 2012 00:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=Sr966/rRT2RTHAnio3VTq4FmLVovGOom7fFJt7F6urE=; b=cXKgVsxmiV+8ranGP3nV9I09hBn1GLm78Zt6+tI3renrymzDgQpyttplX2M8gMnAWJ j65i4OGqs43T1DxH7yhSu/cP445K4jStG7FV7phExWtLKmfTki05Wt6KjJmpgCogATqN 3xVAt5tLAQROP/x8w4YeXnsnunQYQycEmpysI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=Sr966/rRT2RTHAnio3VTq4FmLVovGOom7fFJt7F6urE=; b=JIaVZYhe0Q3RDv6BKEGzWWv7NNR8g3gb5MG5qK9bD1+ID0MQXTw0DyOD6n0c1rQNQH CUolZ0rVg8OAt9V6MtcMznih/ojeBo+/bbHTsOzzCQohls+/XnTAeRfYvmSWa3kL2kYb 2yiTf4tXCIZ5tdtW39xEU/3+B6hc4EZ2eLlrb1/Ai+nxy0gBOh2tEPVIy0LcjqaeX/kC 5OqFDNJBk0iIEk3wD2KUTHa6IMMq22/Acvp9STga9VO3tq/W3KThbMUw6letvGmqu899 S4bzb5YswUwxBWo/asitjkM1xE7vgk9xv2caSymY4rqBUiQHi+95OvRkiOTSJynjij46 Ukjg== Received: by 10.217.3.71 with SMTP id q49mr2481980wes.33.1346312654688; Thu, 30 Aug 2012 00:44:14 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id l6sm14489178wiz.4.2012.08.30.00.44.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Aug 2012 00:44:13 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 30 Aug 2012 09:44:36 +0200 Message-Id: <1346312676-17857-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmgCNURi+51E/f/fDkTgmgZR1cQnwkmnU3kdVdnUvYH4An1km2JzzXXPxeRtatV3VixwbZt Cc: Daniel Vetter , Ian Pilcher , stable@vger.kernel.org, DRI Development Subject: [Intel-gfx] [PATCH] drm/i915/hdmi: only enable audio if there's a hdmi sink X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org 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 Cc: Ian Pilcher Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter --- 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