All of lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms
@ 2019-12-03 15:41 Takashi Iwai
  2019-12-03 15:50 ` Kai Vehmanen
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2019-12-03 15:41 UTC (permalink / raw)
  To: alsa-devel; +Cc: Nikhil Mahale, Kai Vehmanen

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, even on non-MST, a positive
pipe id is passed, which is equivalent with dev_id on Intel.

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")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_hdmi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index ed4e98a1057a..78647ee02339 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1348,21 +1348,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 || spec->intel_hsw_fixup) {
 		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 (spec->intel_hsw_fixup)
-			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 */
-- 
2.16.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [alsa-devel] [PATCH] ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms
  2019-12-03 15:41 [alsa-devel] [PATCH] ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms Takashi Iwai
@ 2019-12-03 15:50 ` Kai Vehmanen
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Vehmanen @ 2019-12-03 15:50 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Nikhil Mahale, Kai Vehmanen

Hey,

thanks Takashi. A small correction still:

On Tue, 3 Dec 2019, Takashi Iwai wrote:

> 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, even on non-MST, a positive
> pipe id is passed, which is equivalent with dev_id on Intel.

Small correction still:

""As found in the later discussion, a positive pipe id 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.

This applies. So if you have a DP-MST case with a single monitor
and dev_id>0, this patch assure compatible behaviour with past versions.

Br, Kai

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-03 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 15:41 [alsa-devel] [PATCH] ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms Takashi Iwai
2019-12-03 15:50 ` Kai Vehmanen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.