mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: dw-hdmi-qp: fix multi-channel audio output
@ 2025-12-06  7:27 Christian Hewitt
  2026-01-20 12:52 ` Cristian Ciocaltea
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Hewitt @ 2025-12-06  7:27 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Dmitry Baryshkov,
	Cristian Ciocaltea, Detlev Casanova, Douglas Anderson, Andy Yan,
	Sugar Zhang, Luca Ceresoli, Heiko Stuebner, dri-devel,
	linux-kernel

From: Jonas Karlman <jonas@kwiboo.se>

Channel Allocation (PB4) and Level Shift Information (PB5) are
configured with values from PB1 and PB2 due to the wrong offset
being used. This results in missing audio channels or incorrect
speaker placement when playing multi-channel audio.

Use the correct offset to fix multi-channel audio output.

Fixes: fd0141d1a8a2 ("drm/bridge: synopsys: Add audio support for dw-hdmi-qp")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

---
buffer is a pointer to u8 while data written to PKT_AUDI_CONTENTS
is u32, so buffer contains audio infoframe header (buffer[0:2]) +
checksum (buffer[3]) + payload byte 1-10 (buffer[4:13]), e.g.

regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS1, &buffer[3], 1)
.. will write PB0-PB3 to AUDI_CONTENTS1

regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS2, &buffer[4], 1)
.. will write PB1-PB4 to AUDI_CONTENTS2, but should be PB4-PB7

&buffer[4] will point to payload byte 4 not payload byte 1, due
to u8/u32 and not considering the size of header+checksum (3+1).
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index f3a13da488e6..7b8a69383dc4 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -845,7 +845,7 @@ static int dw_hdmi_qp_config_audio_infoframe(struct dw_hdmi_qp *hdmi,
 
 	regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS0, &header_bytes, 1);
 	regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS1, &buffer[3], 1);
-	regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS2, &buffer[4], 1);
+	regmap_bulk_write(hdmi->regm, PKT_AUDI_CONTENTS2, &buffer[7], 1);
 
 	/* Enable ACR, AUDI, AMD */
 	dw_hdmi_qp_mod(hdmi,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-20 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-06  7:27 [PATCH] drm/bridge: dw-hdmi-qp: fix multi-channel audio output Christian Hewitt
2026-01-20 12:52 ` Cristian Ciocaltea
2026-01-20 13:31   ` Christian Hewitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®