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: 1386831 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 77B2D3FDF5 for ; Thu, 30 Aug 2012 07:45:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37D429F6F6 for ; Thu, 30 Aug 2012 00:45:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 92ABFA02C8 for ; Thu, 30 Aug 2012 00:44:15 -0700 (PDT) Received: by wgbdr1 with SMTP id dr1so944377wgb.12 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=K9oyE/VciB/ao+a+g7PUplDutwu3pGHpw+abIDhKPFMYnNv7RcEERxYwyfapaTsBPw HranQef0wkI6GxY8xvhhfJj4eFXrkfC2QgnQu8fmBrS0QkyM1+AwyvlhDFr8uAExM5Mx YpABbH5wuhLJ9aYzi7fKgcS+hcdeaWf4wlMcho69D0WcKnNY/u1fk1s5EBcZap3pfrI3 Ys0jvoXDFbDUlgJmiJGmFqtT6d5uvas1npU+hJb/9jM2fOmpVNG8WwNVhUid6Zpvl9Lx 4+73e5w7JKD+T/BYn//u6k2dPKDAGo8mj2KSEpRess1jXuWfqga0IcYbVVDBm20vFyym nx6w== 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 Subject: [PATCH] drm/i915/hdmi: only enable audio if there's a hdmi sink 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: ALoCoQkMFFUzcLMXGeGKdqGPYa9BMC1ze6GgNYdRthK9wQ/mjtKTWuZ64NPHx2sg3G/50RxL3Ewx Cc: Daniel Vetter , Ian Pilcher , stable@vger.kernel.org, DRI Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=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