Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13335980ybl; Sun, 29 Dec 2019 09:33:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzOgwuvHcJ9RTWgFYk7TyAFDVcBgxG3t6KZ9q0Y76Lagai51c55+p2n2Kzqax+gTujKJMG9 X-Received: by 2002:a9d:1e4:: with SMTP id e91mr65358634ote.324.1577640834733; Sun, 29 Dec 2019 09:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640834; cv=none; d=google.com; s=arc-20160816; b=oePUmQzS65vMeKGmkwm4c0KSGM2uhoHWBzSRUwXuARATlSzGRYSR3Ub63ag8aZpN2e l6SupULTUpGt3D+Avagzgo54PXQMgeFCjMKZrN6dmM1t/cQVMFc5Jr1lZw1pfrkO+kfm SlyTgDjMuerVtclMsTaNh27YdaXO/RAwicyGbC/2U7FSuM0rjL+PvkRZNhfcYrkot8PD VqOmz175CVTHOUUf9JUwPd7dpZCqpOzMvI7hqvh2vN/j3KTY97CbEu8jmGm45z1otDg/ f1WZVoPC2fHkhER0IYz9wRk+vWx+SCtlsPuw//2WGxXu65dGNzWIUgjfuEtPH6CVebVz Os/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RoWUJAo5GiMS4Y5C8gRGEPWKFDu6yENROBYGXKPh7YA=; b=qTweMtFgWvejO2lGvJ8idH4pMT8Cbqiy9SgkD2/lOuTed1p4UcD49F67ev1nOb0C/F 6x05PnTMe6oNyPZmXghiOeN/aC8njcc0Kn1/YZwKaoRTBB5pDfDUlZucYV9ldH0h4fF7 bTXOundQCdz+iAPEGLGql+P4snQbDa1CNUkj2v5GHmSLGLziWJpop7mYSxFjRaH5QMeT q0Z1qIA/eL2BO/meb62y1eddsSMaewLEVC+Ga82sOVsqwOBQlQrRc6JrdFF+aIJqHZKK pHjO7mpKKmyZXVfd0y33B7hNA8YJLDV+EFDW6tylnVvcechLvA604cHLuZ8pO6bJi35y S+Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pLR9sN51; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y65si20859899oia.162.2019.12.29.09.33.42; Sun, 29 Dec 2019 09:33:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pLR9sN51; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729195AbfL2Rbj (ORCPT + 99 others); Sun, 29 Dec 2019 12:31:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:59122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729191AbfL2Rbh (ORCPT ); Sun, 29 Dec 2019 12:31:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51BC6207FD; Sun, 29 Dec 2019 17:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640696; bh=kf5GFZb2jr/iYcT1559dfHi72Y59J6biQZV9IkhsRyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLR9sN51Hr0aEFNiUiFcMjAwLmZJS3mGUMcAYhKrhWir8lHQrD0JguUU4F0++I+lp rUYdCLwqK4OU55wSTVFkdZ7XbfIdoUA9YwTMj2GAay2AZwy5rI0HD6UQFM5cr8Kcc0 32IlOXuRjR4mDDhthYovJ6i73agIE7xlfiFiIRx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai Vehmanen , Takashi Iwai , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.19 102/219] ALSA: hda/hdmi - implement mst_no_extra_pcms flag Date: Sun, 29 Dec 2019 18:18:24 +0100 Message-Id: <20191229162523.844585380@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai Vehmanen [ Upstream commit 2a2edfbbfee47947dd05f5860c66c0e80ee5e09d ] To support the DP-MST multiple streams via single connector feature, the HDMI driver was extended with the concept of backup PCMs. See commit 9152085defb6 ("ALSA: hda - add DP MST audio support"). This implementation works fine with snd_hda_intel.c as PCM topology is fully managed within the single driver. When the HDA codec driver is used from ASoC components, the concept of backup PCMs no longer fits. For ASoC topologies, the physical HDMI converters are presented as backend DAIs and these should match with hardware capabilities. The ASoC topology may define arbitrary PCMs (i.e. frontend DAIs) and have processing elements before eventual routing to the HDMI BE DAIs. With backup PCMs, the link between FE and BE DAIs would become dynamic and change when monitors are (un)plugged. This would lead to modifying the topology every time hotplug events happen, which is not currently possible in ASoC and there does not seem to be any obvious benefits from this design. To overcome above problems and enable the HDMI driver to be used from ASoC, this patch adds a new mode (mst_no_extra_pcms flags) to patch_hdmi.c. In this mode, the codec driver does not assume the backup PCMs to be created. Signed-off-by: Kai Vehmanen Reviewed-by: Takashi Iwai Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20191029134017.18901-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/pci/hda/hda_codec.h | 1 + sound/pci/hda/patch_hdmi.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 2003403ce1c8..199927694aef 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -262,6 +262,7 @@ struct hda_codec { unsigned int force_pin_prefix:1; /* Add location prefix */ unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ + unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */ #ifdef CONFIG_PM unsigned long power_on_acct; diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index c827a2a89cc3..9d5e3c8d62b9 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -2063,15 +2063,24 @@ static bool is_hdmi_pcm_attached(struct hdac_device *hdac, int pcm_idx) static int generic_hdmi_build_pcms(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; - int idx; + int idx, pcm_num; /* * for non-mst mode, pcm number is the same as before - * for DP MST mode, pcm number is (nid number + dev_num - 1) - * dev_num is the device entry number in a pin - * + * for DP MST mode without extra PCM, pcm number is same + * for DP MST mode with extra PCMs, pcm number is + * (nid number + dev_num - 1) + * dev_num is the device entry number in a pin */ - for (idx = 0; idx < spec->num_nids + spec->dev_num - 1; idx++) { + + if (codec->mst_no_extra_pcms) + pcm_num = spec->num_nids; + else + pcm_num = spec->num_nids + spec->dev_num - 1; + + codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); + + for (idx = 0; idx < pcm_num; idx++) { struct hda_pcm *info; struct hda_pcm_stream *pstr; -- 2.20.1