提交 679605c7 编写于 作者: A Anssi Hannula 提交者: Takashi Iwai

ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD

According to the HDA specification the baseline ELD length is counted in
DW of 4 bytes instead of in bytes.

Fix the code accordingly.

Baseline length is not used by the kernel so only the ELD exported to
userspace was affected. No issues have been reported.

v2: Fixed so that eld_size is adjusted upwards accordingly as well.
Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 a5666824
......@@ -792,12 +792,15 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
/* else unknown/invalid or 0ms or video ahead of audio, so use zero */
}
/* Baseline length */
buf[2] = pos - 4;
/* SAD count */
buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4;
/* Baseline ELD block length is 4-byte aligned */
pos = round_up(pos, 4);
/* Baseline ELD length (4-byte header is not counted in) */
buf[2] = (pos - 4) / 4;
*eld_size = pos;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册