From patchwork Fri Dec 11 14:05:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 7830141 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E378F9F54F for ; Fri, 11 Dec 2015 14:05:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 178062058E for ; Fri, 11 Dec 2015 14:05:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3D4F620524 for ; Fri, 11 Dec 2015 14:05:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 721926F06E; Fri, 11 Dec 2015 06:05:11 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 49A556F06E for ; Fri, 11 Dec 2015 06:05:10 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4E042AC5F; Fri, 11 Dec 2015 14:05:08 +0000 (UTC) Date: Fri, 11 Dec 2015 15:05:08 +0100 Message-ID: From: Takashi Iwai To: Libin Yang In-Reply-To: <566A6839.3010304@linux.intel.com> References: <1449036584-105393-1-git-send-email-libin.yang@linux.intel.com> <1449036584-105393-2-git-send-email-libin.yang@linux.intel.com> <56668E50.8050806@linux.intel.com> <20151210090204.GD20822@phenom.ffwll.local> <566A6839.3010304@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, intel-gfx@lists.freedesktop.org, Dave Airlie , daniel.vetter@intel.com Subject: Re: [Intel-gfx] [PATCH V4 2/2] drm/i915: start adding dp mst audio X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 11 Dec 2015 07:07:53 +0100, Libin Yang wrote: > > Add Takashi and ALSA mail list. > > On 12/10/2015 05:02 PM, Daniel Vetter wrote: > > On Tue, Dec 08, 2015 at 04:01:20PM +0800, Libin Yang wrote: > >> Hi all, > >> > >> Any comments on the patches? > > > > Sorry, simply fell through the cracks since Ander is on vacation. Takashi > > is working on some cleanup patches to have a port->encoder mapping for the > > audio side of i915. His patch cleans up all the existing audio code in > > i915, but please work together with him to align mst code with the new > > style. > > > > Both patches queued for next. > > Yes, I have seen Takashi's patches. I will check the patches. The patch like below should work; it sets/clears the reverse mapping dynamically for the MST encoder. At least, now I could get a proper ELD from a docking station. But the audio itself doesn't seem working yet, missing something... FWIW, the fixed patches are found in my test/hdmi-jack branch. It contains my previous get_eld patchset, HD-audio side changes, Libin's this patchset, plus Libin's HD-audio MST patchset and some fixes. Takashi diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 8b608c2cd070..87dad62fd10b 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -108,6 +108,7 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder) struct drm_i915_private *dev_priv = dev->dev_private; struct drm_crtc *crtc = encoder->base.crtc; struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + enum port port = intel_dig_port->port; int ret; @@ -122,6 +123,9 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder) if (intel_crtc->config->has_audio) { intel_audio_codec_disable(encoder); intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); + mutex_lock(&dev_priv->av_mutex); + dev_priv->dig_port_map[port] = NULL; + mutex_unlock(&dev_priv->av_mutex); } } @@ -236,6 +240,9 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder) if (crtc->config->has_audio) { DRM_DEBUG_DRIVER("Enabling DP audio on pipe %c\n", pipe_name(crtc->pipe)); + mutex_lock(&dev_priv->av_mutex); + dev_priv->dig_port_map[port] = encoder; + mutex_unlock(&dev_priv->av_mutex); intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); intel_audio_codec_enable(encoder); }