Skip to content

Commit c741937

Browse files
kv2019itiwai
authored andcommitted
ALSA: hda/hdmi: fix warning about PCM count when used with SOF
With commit 1304637 ("ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically"), old behaviour to consider the HDA pin number, when choosing PCM to assign, was dropped. Build on this change and limit the number of PCMs created to number of converters (= maximum number of concurrent display/receivers) when "mst_no_extra_pcms" and "dyn_pcm_no_legacy" quirks are both set. Fix the check in hdmi_find_pcm_slot() to ensure only spec->pcm_used entries are considered in the search. Elsewhere in the driver spec->pcm_used is already checked properly. Doing this avoids following warning at SOF driver probe for multiple machine drivers: [ 112.425297] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4 [ 112.425298] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5 [ 112.425299] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 6 Fixes: 1304637 ("ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically") BugLink: thesofproject#2573 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20220414150516.3638283-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 357ad4d commit c741937

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sound/pci/hda/patch_hdmi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static int hdmi_find_pcm_slot(struct hdmi_spec *spec,
13951395

13961396
last_try:
13971397
/* the last try; check the empty slots in pins */
1398-
for (i = 0; i < spec->num_nids; i++) {
1398+
for (i = 0; i < spec->pcm_used; i++) {
13991399
if (!test_bit(i, &spec->pcm_bitmap))
14001400
return i;
14011401
}
@@ -2325,7 +2325,9 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
23252325
* dev_num is the device entry number in a pin
23262326
*/
23272327

2328-
if (codec->mst_no_extra_pcms)
2328+
if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
2329+
pcm_num = spec->num_cvts;
2330+
else if (codec->mst_no_extra_pcms)
23292331
pcm_num = spec->num_nids;
23302332
else
23312333
pcm_num = spec->num_nids + spec->dev_num - 1;

0 commit comments

Comments
 (0)