Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2492613rwb; Mon, 3 Oct 2022 01:14:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6X7Zs7TOJm2oYoKXoDO/+EJH0QjMu3u+kkzWx7o0XmlwAhc28EVvufB+I5d5tcFQVcthxu X-Received: by 2002:a17:90b:3b43:b0:202:d053:d305 with SMTP id ot3-20020a17090b3b4300b00202d053d305mr11015616pjb.229.1664784881523; Mon, 03 Oct 2022 01:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664784881; cv=none; d=google.com; s=arc-20160816; b=Mfx22oshLYuu8i+9B12rcQLA3oRZLXx0vKiXjdhpwaOuONzKD/bkz9aOF9P6bTmfvP Pb5OFYd3epdw20WpEiaXq1IwA6B9fHRgqyE1F1HrYlsywZz1jC3BKXVSctvbaEaUpZiw GLcx+vl7HQotFrww5N0Eb0dkGv6AulXEFw0WrHGWjK5e/Z7FLRS8WSrmfk1eAx5wb4bj jD2g8b0URELJCMP0BhOD/Q8CwymHsmWQ6diK195JVWFm6dFWU0taiVfLoRnPZH+Tzik8 ihaUf8hVrTSCAoiT6cqg7QuiEsuIKxHZ2K33rowk6DU9ZqEiCL8UN9de1y+mw/j2lfHQ sFGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hrOf96orT61dA2Vgwv8iZezX6n7aC3gKZ/JTXlhjtfY=; b=nWLBTymz5f3OMXCEAnQeRm+NfQhE/B0FwyXoOID8QNzIFlGrqEWktcWmTQ9o9bTeig IBsHzW+rUe5c7jt+9eY0iH55PzA6/5QiAkZ2zNBKa0NHvxt2Tw0lQkNLd9oUg1wz6WwY 1tDVtynGanuZNBREuEb2CNEU++pMICKRhFW+PtPQ7Dq9IYGe9e1ESR/AObYqqhFrrINQ iCQyTzbLOg6rsSFjEFRwzEPLXWiFN8oLfEwCzqaHdzL0F4dBeSCXmyFfc+O0QrxLclPb Np+9QkpMWw0wfnd7LR4/GIt5iLr8L8eIJABhoXVX5pt72PKMZ67UYyNKHhHCeopAB7vR ytEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n3GF7RD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020a63e74a000000b0043aebb63fc7si10260918pgk.301.2022.10.03.01.14.28; Mon, 03 Oct 2022 01:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n3GF7RD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbiJCHfc (ORCPT + 99 others); Mon, 3 Oct 2022 03:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231712AbiJCHeQ (ORCPT ); Mon, 3 Oct 2022 03:34:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 502FA52DD1; Mon, 3 Oct 2022 00:21:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7CF5AB80E97; Mon, 3 Oct 2022 07:21:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB8ECC433D6; Mon, 3 Oct 2022 07:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781694; bh=SnZkNAAap/Esf6QKxUhI0fy+mo0YZ4Nsu80pdvM0q08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3GF7RD3E4B2iz3eidxve0jvY7nt5N7YEA2wyyXAKo8K9cPSKYSSyumTFkAQ9ToyH nk7wmsXuPxojwAouzU4ZAr2g8Op5AWZVlO8RCAH54rtkuW55eDGL4lWuhlEY5cn6cp 8nF4YEs6PzfyS7nse+B/QnhLCIa4SaeXNh4/oO1E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai , Sasha Levin , Kai Vehmanen Subject: [PATCH 5.10 05/52] ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically Date: Mon, 3 Oct 2022 09:11:12 +0200 Message-Id: <20221003070718.869196074@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070718.687440096@linuxfoundation.org> References: <20221003070718.687440096@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang [ Upstream commit 13046370c4d143b629adc1a51659a8a6497fbbe6 ] 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 Suggested-and-reviewed-by: Takashi Iwai Suggested-and-reviewed-by: Kai Vehmanen Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20210301111202.2684-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai Stable-dep-of: f89e409402e2 ("ALSA: hda: Fix Nvidia dp infoframe") Signed-off-by: Sasha Levin --- sound/pci/hda/patch_hdmi.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 7551cdf3b452..6110370f874d 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 dyn_pcm_no_legacy; bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ /* * Non-generic VIA/NVIDIA specific @@ -1348,6 +1349,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 (legacy way) anymore. + */ + if (spec->dyn_pcm_no_legacy) + goto last_try; + /* * generic_hdmi_build_pcms() may allocate extra PCMs on some * platforms (with maximum of 'num_nids + dev_num - 1') @@ -1377,6 +1384,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)) @@ -3010,8 +3018,16 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec) * the index indicate the port number. */ static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; + int ret; - return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + if (!ret) { + struct hdmi_spec *spec = codec->spec; + + spec->dyn_pcm_no_legacy = true; + } + + return ret; } /* Intel Baytrail and Braswell; with eld notifier */ -- 2.35.1