[alsa-devel] [PATCH 3/3] ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD

Anssi Hannula anssi.hannula at iki.fi
Sun Nov 10 19:56:12 CET 2013


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.

Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
---
 sound/pci/hda/hda_eld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 9b697a28cf53..cc814d02a0e4 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -793,7 +793,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
 	}
 
 	/* Baseline length */
-	buf[2] = pos - 4;
+	buf[2] = DIV_ROUND_UP(pos - 4, 4);
 
 	/* SAD count */
 	buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4;
-- 
1.8.1.5



More information about the Alsa-devel mailing list