]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms
authorTakashi Iwai <tiwai@suse.de>
Wed, 12 Aug 2020 05:58:21 +0000 (13:58 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:30:13 +0000 (16:30 -0300)
BugLink: https://bugs.launchpad.net/bugs/1867704
The commit 609f5485344b ("ALSA: hda: hdmi - preserve non-MST PCM
routing for Intel platforms") tried to restore the old behavior wrt
assignment of the PCM slot for Intel platforms, but this didn't do it
right.  As found in the later discussion, a positive pipe id on Intel
platforms can be passed for single monitor attachment case.

This patch reverts the previous attempt and applies a simpler
workaround instead.  Actually, for Intel platforms, we can handle as
if per_pin->dev_id=0, assign the primary slot at the first try.  This
assures the compatible behavior with the previous versions regarding
the slot assignment.

Fixes: 609f5485344b ("ALSA: hda: hdmi - preserve non-MST PCM routing for Intel platforms")
Link: https://lore.kernel.org/r/20191203154105.30414-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backported from commit 643a2cc99b53c13d90c02dc344f780ba9a89e012)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-By: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
sound/pci/hda/patch_hdmi.c

index a544dff55b7943cada356f7b4d1149b5ef103d7b..f364e02a0f1e7c9cfc75d705ea93eb19d90490db 100644 (file)
@@ -1371,21 +1371,18 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec,
         * with the legacy static per_pin-pcm assignment that existed in the
         * days before DP-MST.
         *
+        * Intel DP-MST prefers this legacy behavior for compatibility, too.
+        *
         * per_pin of m!=0 prefers to get pcm=(num_nids + (m - 1)).
         */
 
-       if (per_pin->dev_id == 0) {
+       if (per_pin->dev_id == 0 || is_haswell_plus(per_pin->codec)) {
                if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))
                        return per_pin->pin_nid_idx;
        } else {
                i = spec->num_nids + (per_pin->dev_id - 1);
                if (i < spec->pcm_used && !(test_bit(i, &spec->pcm_bitmap)))
                        return i;
-
-               /* keep legacy assignment for dev_id>0 on Intel platforms */
-               if (is_haswell_plus(per_pin->codec))
-                       if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))
-                               return per_pin->pin_nid_idx;
        }
 
        /* have a second try; check the area over num_nids */