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=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 C97D3C433E9 for ; Wed, 24 Feb 2021 02:33:12 +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 3284564E02 for ; Wed, 24 Feb 2021 02:33:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3284564E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 9A6E0850; Wed, 24 Feb 2021 03:32:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9A6E0850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614133990; bh=zjvslhGmlW2V7066YQiwNh+l8ipIkPA79ShXQ79bMs0=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ak80otIXAKnWS7pDUU55Fry9AzX50YfKPScdFlh5rCCkWHiixTwlnoA+cnltXUHj1 6vdZV5fdtVWNcezgKmNErCCtpFjeZsrPziChLtWLCbQf48WH60oM6HEYvcBEZ5RlZP A9XvpO0P2Pa7UIXFJXwGBqiqmAIZMiFd0dYZUTVc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2AE95F80169; Wed, 24 Feb 2021 03:32:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DECAEF8016A; Wed, 24 Feb 2021 03:32:17 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1FD1EF800B4 for ; Wed, 24 Feb 2021 03:32:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1FD1EF800B4 Received: from [123.112.65.229] (helo=[192.168.0.106]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lEjyH-0003XE-Nr; Wed, 24 Feb 2021 02:32:14 +0000 Subject: Re: [PATCH] ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically To: Kai Vehmanen References: <20210223122205.233701-1-hui.wang@canonical.com> From: Hui Wang Message-ID: <3e125642-e94d-fb46-01d3-5b4f7e3cc8b7@canonical.com> Date: Wed, 24 Feb 2021 10:32:09 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Cc: Takashi Iwai , alsa-devel@alsa-project.org 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 2/23/21 10:14 PM, Kai Vehmanen wrote: > Hi, > > thanks for the patch! > > On Tue, 23 Feb 2021, 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. > [...] >> This change comes from the discussion between Takashi and >> Kai Vehmanen. Please refer to: >> https://github.com/alsa-project/alsa-lib/pull/118 > I did propose to merge the alsa-lib change to give us a bit more time to > think about how this should be handled in kernel. That is not merged yet, and my PM was pushing me to find a solution, then I wrote this patch. > > While this patch certainly solves the problem of kernel picking ALSA PCMs, > which current alsa-lib cannot handle, it leaves us a bit halfway. We'd > create many PCMs that will never be used. And this change is a bit more > involved. > >> 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(). > Staged plan sounds good here, although I'd be fairly cautious with this. > People using Pulseaudio/Pipewire+UCM won't notice a thing, but I'm sure > there are people out there assuming a fixed "physical connector -> ALSA > PCM" mapping and not using UCM. Probably at least some way to opt-out > would be needed for older platforms. > >> + if (port_num > 6) >> + spec->no_fixed_assign = true; > I think this is magic enough of a number to be defined separately along > with some documentation. So basicly user-space has a max limit of 8 now > and two PCMs are reserved for DP-MST, so that brings us to six, right? Yes, and also before the TGL, the max number of physical pins is 6 (icl). > > This is somewhat arbitrary still. If we simply want to enable the mode for > TGL only, easier and cleaned would be to set this flag in > patch_i915_tgl_hdmi() directly. OK, will consider it. Thanks, Hui. > Br, Kai