Skip to content

Commit

Permalink
ALSA: hda/hdmi: fix max DP-MST dev_num for Intel TGL+ platforms
Browse files Browse the repository at this point in the history
[ Upstream commit e839fbe ]

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: thesofproject/linux#2798
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210324172337.51730-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kv2019i authored and gregkh committed May 19, 2021
1 parent 86e4106 commit 392a016
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/*
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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;

Expand Down

0 comments on commit 392a016

Please sign in to comment.