Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2962903pxj; Mon, 17 May 2021 14:14:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaOgsGhSTY1dFO4RY24AWaAEZPwxZx8+UQFgcSbWlMy6q2b0FChy3TEXkw/v2CzNh7BVOy X-Received: by 2002:a17:906:26d3:: with SMTP id u19mr1990574ejc.128.1621286093521; Mon, 17 May 2021 14:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621286093; cv=none; d=google.com; s=arc-20160816; b=qTcL3bSPma7R+LK/Wx8NVBA4VoMgsOW5zJkcPqiaAZZdyz2Kfy0tb4B/KtWoYwHrXb PT5Q/jV4KVBZ3eVj1+QvFyxMyVyw9lEaAG9S5xeBaW9D1qvmhU2nR6lBGLmTn0ZWbu8T WG3jZuHbzTt78ucPs/450x1MkndQX4984ZhdciyztSlbjs6Kt/tkhH365KF1rKyeQ5iK JnSVkhc9+qieXF4rrL3nZ+kMA980wsBTPnP2lsM1/hLTfq30sT0J1XYgZ3LeuFAFCah+ 7rFsiIUeAjtKkgyN//98RINqBzWfvj5gX+k9/CKRUk/WqpvwSd1oJQFIi1NWDyYsxGtJ jrjw== 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=hviEb8PyqNHRbepUk/7d5mSnB4ZxpPu7szdaKE7WnU8=; b=UgbPaFUZBfsvJMRVAaqc8X8T7LJIQ+VhPa0BoE/4lJ2oFcEnOrYWmDGrHLersNP/UV kKf0kdX7uDrPJQMlvAOfLSG0TnMzigKZ7qnCaivRItz/MeMCDzxxSQLIymSkCy4T9g9G /fIr8HYK0rSswHfucpQjVyQtywCkFiKzVGsgU8RZcI2szXgU6NKxVkeJp4H/DANPiZGR nE9V/zv+JqfNYd9d4IaceubNnK0mmIuySPdnvzFQrjtcqazj3/0eSgtGYnkUMcZ8YVgj FhQ3Cb7btpnHQku9XaDD7b6jTQG8TnjVtC9xdnDIkeD7mMh044Vc1V7dgagHa1Nv26s4 P4oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k39anp4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf11si323653ejb.582.2021.05.17.14.14.29; Mon, 17 May 2021 14:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k39anp4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238043AbhEQOJ0 (ORCPT + 99 others); Mon, 17 May 2021 10:09:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:58902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237903AbhEQOHA (ORCPT ); Mon, 17 May 2021 10:07:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57636611EE; Mon, 17 May 2021 14:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260343; bh=U8rsntay85eppEKTFN+l4F5otujEXnDUOLfZdQ9xdp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k39anp4r/gdLye6UtBYak5TpBeMRcCPB3LF4GFRDQCiRkK/i/3TlB/jLOqgfQXdfC y860y2Bb2+/Cl81gUht9kTJ9nwbkEzlcLJm6d1hZFSJfJWe3zw/IX/S9eaM5Vx0Q/t CnsIOnKj59RX/oyiOh8vOIHPPooL9GdXiY/4GFhU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai Vehmanen , Ranjani Sridharan , Guennadi Liakhovetski , Takashi Iwai , Sasha Levin Subject: [PATCH 5.12 039/363] ALSA: hda/hdmi: fix max DP-MST dev_num for Intel TGL+ platforms Date: Mon, 17 May 2021 15:58:25 +0200 Message-Id: <20210517140303.915074176@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai Vehmanen [ Upstream commit e839fbed26e8b8713803b8ac73da92fd2b0c7594 ] Increase the device select range to 4 on platforms supporting 4 concurrent displays. This fixes a problem in scenario where total of 4 displays are active, and 3 of these are audio capable DP receivers and connected to a DP-MST hub. Due to incorrect range for device select, audio could not be played to the 3rd monitor in DP-MST hub. BugLink: https://github.com/thesofproject/linux/issues/2798 Signed-off-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Link: https://lore.kernel.org/r/20210324172337.51730-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_hdmi.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 45ae845e82df..5de3666a7101 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1848,16 +1848,12 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) */ if (spec->intel_hsw_fixup) { /* - * On Intel platforms, device entries number is - * changed dynamically. If there is a DP MST - * hub connected, the device entries number is 3. - * Otherwise, it is 1. - * Here we manually set dev_num to 3, so that - * we can initialize all the device entries when - * bootup statically. + * On Intel platforms, device entries count returned + * by AC_PAR_DEVLIST_LEN is dynamic, and depends on + * the type of receiver that is connected. Allocate pin + * structures based on worst case. */ - dev_num = 3; - spec->dev_num = 3; + dev_num = spec->dev_num; } else if (spec->dyn_pcm_assign && codec->dp_mst) { dev_num = snd_hda_get_num_devices(codec, pin_nid) + 1; /* @@ -2942,7 +2938,7 @@ static int parse_intel_hdmi(struct hda_codec *codec) /* Intel Haswell and onwards; audio component with eld notifier */ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, - const int *port_map, int port_num) + const int *port_map, int port_num, int dev_num) { struct hdmi_spec *spec; int err; @@ -2957,6 +2953,7 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, spec->port_map = port_map; spec->port_num = port_num; spec->intel_hsw_fixup = true; + spec->dev_num = dev_num; intel_haswell_enable_all_pins(codec, true); intel_haswell_fixup_enable_dp12(codec); @@ -2982,12 +2979,12 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, static int patch_i915_hsw_hdmi(struct hda_codec *codec) { - return intel_hsw_common_init(codec, 0x08, NULL, 0); + return intel_hsw_common_init(codec, 0x08, NULL, 0, 3); } static int patch_i915_glk_hdmi(struct hda_codec *codec) { - return intel_hsw_common_init(codec, 0x0b, NULL, 0); + return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3); } static int patch_i915_icl_hdmi(struct hda_codec *codec) @@ -2998,7 +2995,7 @@ static int patch_i915_icl_hdmi(struct hda_codec *codec) */ static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb}; - return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3); } static int patch_i915_tgl_hdmi(struct hda_codec *codec) @@ -3010,7 +3007,7 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec) static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; int ret; - ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); + ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4); if (!ret) { struct hdmi_spec *spec = codec->spec; -- 2.30.2