Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AD26C433DB for ; Tue, 23 Feb 2021 13:10:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E2A964E62 for ; Tue, 23 Feb 2021 13:10:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E2A964E62 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4A5841668; Tue, 23 Feb 2021 14:09:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A5841668 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614085836; bh=n6hySn0cNJ4Nw9Qk2kSDq1ubNsYotmy0Qt8rr8Tjuuc=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fqHywX+s/iGlFVtmov94N35DtLhxfk6WzmElK0XJg+JskE+2YsfoKe7toXAIFf0JC 1Uulp9+x7aHq1hUlag8C98WGm/WeAO0quBfc71MhPkvkheavSm61Ik6CYaw0yq2E3k Llt6bCUaF4Oce9D3ZkJiXlhRY7b5dx1bnMvm5a8M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C7B6BF80169; Tue, 23 Feb 2021 14:09:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C0C1BF8016A; Tue, 23 Feb 2021 14:09:44 +0100 (CET) Received: from mx2.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 98188F800B4 for ; Tue, 23 Feb 2021 14:09:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98188F800B4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CD4D5AE7F; Tue, 23 Feb 2021 13:09:37 +0000 (UTC) Date: Tue, 23 Feb 2021 14:09:37 +0100 Message-ID: From: Takashi Iwai To: Hui Wang Subject: Re: [PATCH] ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically In-Reply-To: <20210223122205.233701-1-hui.wang@canonical.com> References: <20210223122205.233701-1-hui.wang@canonical.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/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 23 Feb 2021 13:22:05 +0100, Hui Wang wrote: > > If the platform set the dyn_pcm_assign to true, it will call > hdmi_find_pcm_slot() to find a pcm slot when hdmi/dp monitor is > connected and need to create a pcm. > > So far only intel_hsw_common_init() and patch_nvhdmi() set the > dyn_pcm_assign to true, here we let tgl platforms assign the pcm slot > dynamically first, if the driver runs for a period of time and there > is no regression reported, we could set no_fixed_assgin to true in > the intel_hsw_common_init(), and then set it to true in the > patch_nvhdmi(). > > This change comes from the discussion between Takashi and > Kai Vehmanen. Please refer to: > https://github.com/alsa-project/alsa-lib/pull/118 > > Signed-off-by: Hui Wang As this would "fix" actual use cases, I'd love to merge this for 5.12, but of course it needs to be verified beforehand. So this was actually tested in your side, right? thanks, Takashi > --- > sound/pci/hda/patch_hdmi.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c > index e405be7929e3..379a4d786b3b 100644 > --- a/sound/pci/hda/patch_hdmi.c > +++ b/sound/pci/hda/patch_hdmi.c > @@ -157,6 +157,7 @@ struct hdmi_spec { > > bool dyn_pin_out; > bool dyn_pcm_assign; > + bool no_fixed_assign; > bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ > /* > * Non-generic VIA/NVIDIA specific > @@ -1345,6 +1346,12 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec, > { > int i; > > + /* on the new machines, try to assign the pcm slot dynamically, > + * not use the preferred fixed map anymore. > + */ > + if (spec->no_fixed_assign) > + goto last_try; > + > /* > * generic_hdmi_build_pcms() may allocate extra PCMs on some > * platforms (with maximum of 'num_nids + dev_num - 1') > @@ -1374,6 +1381,7 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec, > return i; > } > > + last_try: > /* the last try; check the empty slots in pins */ > for (i = 0; i < spec->num_nids; i++) { > if (!test_bit(i, &spec->pcm_bitmap)) > @@ -2937,6 +2945,9 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, > spec->port_num = port_num; > spec->intel_hsw_fixup = true; > > + if (port_num > 6) > + spec->no_fixed_assign = true; > + > intel_haswell_enable_all_pins(codec, true); > intel_haswell_fixup_enable_dp12(codec); > > -- > 2.25.1 >