From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RFC PATCH 5/7] ALSA: hda/hdmi - implement mst_no_extra_pcms flag Date: Thu, 29 Aug 2019 16:09:49 +0200 Message-ID: References: <20190829135348.23569-1-kai.vehmanen@linux.intel.com> <20190829135348.23569-6-kai.vehmanen@linux.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7AD56F898AA for ; Thu, 29 Aug 2019 16:09:50 +0200 (CEST) In-Reply-To: <20190829135348.23569-6-kai.vehmanen@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Kai Vehmanen Cc: libin.yang@intel.com, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com List-Id: alsa-devel@alsa-project.org On Thu, 29 Aug 2019 15:53:46 +0200, Kai Vehmanen wrote: > > When mst_no_exxtra_pcms flag is set, the codec should not > use backup PCMs to handle DP-MST scenarios. Instead a simple > 1:1 mapping is assumed between PCMs and converters. > > Signed-off-by: Kai Vehmanen > --- > sound/pci/hda/patch_hdmi.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c > index f2022f75afb6..4372c87c48f0 100644 > --- a/sound/pci/hda/patch_hdmi.c > +++ b/sound/pci/hda/patch_hdmi.c > @@ -2072,15 +2072,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; Instead of changing this, we can simply take dev_num=1 like below. thanks, Takashi --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1706,7 +1706,11 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) * To simplify the implementation, malloc all * the virtual pins in the initialization statically */ - if (is_haswell_plus(codec)) { + if (codec->mst_no_extra_pcms) { + /* for SOF/SST, no backup PCM streams can be assigned */ + dev_num = 1; + spec->dev_num = 1; + } else if (is_haswell_plus(codec)) { /* * On Intel platforms, device entries number is * changed dynamically. If there is a DP MST