Commit 20608731 authored by Anssi Hannula's avatar Anssi Hannula Committed by Takashi Iwai

ALSA: hda - Fix default multichannel HDMI mapping regression

Commit d45e6889 ("ALSA: hda - Provide
the proper channel mapping for generic HDMI driver") added support for
custom channel maps in the HDA HDMI driver. Due to a mistake in an
'if' condition the custom map is always used even when no such map has
been set. This causes incorrect channel mapping for multichannel audio
by default.

Pass per_pin->chmap_set to hdmi_setup_channel_mapping() as a parameter
so that it can use it for detecting if a custom map has been set instead
of checking if map is NULL (which is never the case).
Reported-by: default avatarStaffan Lindberg <pike@xbmc.org>
Signed-off-by: default avatarAnssi Hannula <anssi.hannula@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8058e142
...@@ -714,9 +714,10 @@ static void hdmi_setup_fake_chmap(unsigned char *map, int ca) ...@@ -714,9 +714,10 @@ static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
static void hdmi_setup_channel_mapping(struct hda_codec *codec, static void hdmi_setup_channel_mapping(struct hda_codec *codec,
hda_nid_t pin_nid, bool non_pcm, int ca, hda_nid_t pin_nid, bool non_pcm, int ca,
int channels, unsigned char *map) int channels, unsigned char *map,
bool chmap_set)
{ {
if (!non_pcm && map) { if (!non_pcm && chmap_set) {
hdmi_manual_setup_channel_mapping(codec, pin_nid, hdmi_manual_setup_channel_mapping(codec, pin_nid,
channels, map); channels, map);
} else { } else {
...@@ -905,7 +906,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx, ...@@ -905,7 +906,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
pin_nid, pin_nid,
channels); channels);
hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
channels, per_pin->chmap); channels, per_pin->chmap,
per_pin->chmap_set);
hdmi_stop_infoframe_trans(codec, pin_nid); hdmi_stop_infoframe_trans(codec, pin_nid);
hdmi_fill_audio_infoframe(codec, pin_nid, hdmi_fill_audio_infoframe(codec, pin_nid,
ai.bytes, sizeof(ai)); ai.bytes, sizeof(ai));
...@@ -915,7 +917,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx, ...@@ -915,7 +917,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
* accordingly */ * accordingly */
if (per_pin->non_pcm != non_pcm) if (per_pin->non_pcm != non_pcm)
hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca, hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
channels, per_pin->chmap); channels, per_pin->chmap,
per_pin->chmap_set);
} }
per_pin->non_pcm = non_pcm; per_pin->non_pcm = non_pcm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment