linux/drivers
Simon Wright a9f09b5ea0 drm/bridge: dw-hdmi-qp: use drm_hdmi_acr_get_n_cts() helper for audio N/CTS
dw_hdmi_qp_set_sample_rate() open-coded its own N and CTS lookup
tables and search/compute helpers, but it lacked the out-of-table
CTS fallback needed by strict HDMI sinks at TMDS rates not in the
table.  The original LG G3 OLED audio mute (linux-rockchip 070633)
was caused by dw_hdmi_qp_find_cts() returning 0 at 185.625 MHz,
leaving AUDPKT_ACR_CTS_OVR_EN clear and falling back to the
controller's internal CTS auto-measurement, which produces incorrect
timing on the wire at out-of-table rates.

The shared drm_hdmi_acr_get_n_cts() helper in
drivers/gpu/drm/display/drm_hdmi_helper.c already implements the
correct behaviour: it has the HDMI 1.4b spec N/CTS tables, and for
TMDS rates not in the table it computes CTS = (TMDS * N) / (128 * Fs)
inline (the canonical HDMI spec formula).  It is already used by
drivers/gpu/drm/msm/hdmi/hdmi_audio.c.

Convert dw_hdmi_qp_set_sample_rate() to call the helper.  This
removes ~200 lines of open-coded tables and search functions
(dw_hdmi_qp_find_n, _compute_n, _find_cts, _audio_math_diff,
_match_tmds_n_table, common_tmds_n_table[], common_tmds_cts_table[])
and fixes the strict-sink audio mute as a side effect of using the
helper's complete N+CTS path.

Tested on R76S (RK3576) running Linux 7.0.1, against the LG G3 OLED
(the sink that originally reported the mute in linux-rockchip
070633) at four TMDS rates spanning HDMI 1.4 and HDMI 2.0:

  TMDS         Mode              Audio with v3
  148.5 MHz    1080p60   8-bit   plays
  185.625 MHz  1080p60  10-bit   plays
  297 MHz      1080p100  8-bit   plays
  594 MHz      3840p60   8-bit   plays

Without this change, the LG G3 mutes audio at 185.625, 297, and
594 MHz (every rate outside dw-hdmi-qp's open-coded CTS table,
which contained only 148.5 MHz and below).  With this change,
drm_hdmi_acr_get_n_cts() supplies the correct CTS at every rate --
table-canonical at 148.5 / 297 / 594 MHz, and computed via the
HDMI 1.4b formula at 185.625 MHz.  The 148.5 MHz row is a
regression check confirming the in-table path is unchanged.

The Kogan KALED43XU9210STA (a permissive HDMI 2.0 sink that plays
audio at all rates with or without this change) was used as a
no-regression control: audio plays at 594 MHz with v3 loaded.

The open-coded N table in dw-hdmi-qp included optimised N values
for some TMDS rates that are not in the helper's table (e.g.
various non-CEA rates between 28-162 MHz).  For those rates the
helper's fallback returns N = 128 * Fs / 1000, which is the same
value dw_hdmi_qp_compute_n() returned when no table optimisation
was needed; no audio regression has been observed at the rates
tested above.

Reported-by: Simon Wright <simon@symple.nz>
Closes: https://lore.kernel.org/linux-rockchip/ME3P282MB21960D9D68BFF520316BDFCEA83E2@ME3P282MB2196.AUSP282.PROD.OUTLOOK.COM/
Suggested-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Simon Wright <simon@symple.nz>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, both HDMI controllers
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tested-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/86fcf349-0a7a-4618-9001-612371b0f71b@symple.nz
2026-09-03 17:48:54 +02:00
..
accel accel/amdxdna: Fix possible use-after-free when freeing device BO 2026-09-01 10:42:22 -07:00
accessibility
acpi Revert "ACPI: scan: Defer device power initialization" 2026-08-27 16:03:20 +02:00
amba
android Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
ata pci-v7.3-changes 2026-08-23 12:44:10 -07:00
atm
auxdisplay auxdisplay for v7.3-1 2026-08-24 08:15:59 -07:00
base mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
bcma
block mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
bluetooth Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
bus Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cache
cdrom
cdx
char ipmi: Fix some minor issues, add async init 2026-08-28 16:32:12 -07:00
clk MFD for v7.3 2026-08-27 10:45:08 -07:00
clocksource hyperv-next for v7.3-rc1 2026-08-26 16:47:40 -07:00
comedi
connector
counter Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cpufreq More power management updates for 7.3-rc1 2026-08-26 14:13:26 -07:00
cpuidle MFD for v7.3 2026-08-27 10:45:08 -07:00
crypto dmaengine updates for v7.3 2026-08-24 12:21:15 -07:00
cxl
dax mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
dca
devfreq
dibs net/dibs: Correct freeing of dmb_clientid_arr 2026-08-12 17:08:05 -07:00
dio
dma dmaengine updates for v7.3 2026-08-24 12:21:15 -07:00
dma-buf dma-buf: fix comment in dma_buf_llseek to match implementation 2026-09-02 10:04:55 +02:00
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
edac x86/msr updates for v7.3: 2026-08-18 14:02:15 -07:00
eisa
extcon
firewire firewire updates for v7.3 2026-08-22 08:41:28 -07:00
firmware remoteproc updates for v7.3 2026-08-25 14:03:31 -07:00
fpga Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
fsi
fwctl rust: introduce abstractions for fwctl 2026-08-14 19:21:17 -03:00
gnss
gpib Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
gpio gpio updates for v7.3-rc1 2026-08-19 09:10:07 -07:00
gpu drm/bridge: dw-hdmi-qp: use drm_hdmi_acr_get_n_cts() helper for audio N/CTS 2026-09-03 17:48:54 +02:00
greybus
hid platform-drivers-x86 for v7.3-1 2026-08-24 10:16:35 -07:00
hsi HSI changes for the 7.3 series 2026-08-21 12:01:23 -07:00
hte
hv hyperv-next for v7.3-rc1 2026-08-26 16:47:40 -07:00
hwmon Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
hwspinlock
hwtracing Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
i2c i2c-fixes for v7.3-rc1 2026-08-30 10:53:24 -07:00
i3c i3c: dw: reduce do_daa time if there's no client 2026-08-19 09:28:33 +02:00
idle
iio More thermal control updates for 7.3-rc1 2026-08-26 14:21:30 -07:00
infiniband Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
input Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
interconnect This pull request contains the following interconnect updates for 2026-08-19 09:55:37 +02:00
iommu dma-mapping updates for Linux 7.3: 2026-08-24 11:35:46 -07:00
ipack Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
irqchip pci-v7.3-changes 2026-08-23 12:44:10 -07:00
leds LEDs for v7.3 2026-08-27 11:05:51 -07:00
macintosh
mailbox mailbox: add Axiado AX3005 mailbox driver 2026-08-23 15:41:13 -05:00
mcb
md for-7.3/block-20260819 2026-08-20 13:55:16 -07:00
media USB / Thunderbolt changes for 7.3-rc1 2026-08-25 10:44:46 -07:00
memory * Raw NAND changes 2026-08-23 09:11:21 -07:00
memstick
message
mfd MFD for v7.3 2026-08-27 10:45:08 -07:00
misc Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
mmc MMC core: 2026-08-21 11:58:08 -07:00
most
mtd This pull request contains updates for UBI and UBIFS: 2026-08-28 10:59:07 -07:00
mux
net Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
ntb NTB: ntb_transport: Reject oversized TX buffers 2026-08-20 13:43:24 -07:00
nubus
nvdimm vhost,vdpa,virtio: fixes, features 2026-08-20 17:07:50 -07:00
nvme dmaengine updates for v7.3 2026-08-24 12:21:15 -07:00
nvmem Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
of Devicetree fixes for v7.3, part 1: 2026-08-27 12:53:43 -07:00
opp
parisc parisc: eisa: Fix infinite loop when parsing invalid IRQ value 2026-08-18 11:43:05 +02:00
parport
pci hyperv-next for v7.3-rc1 2026-08-26 16:47:40 -07:00
pcmcia
peci
perf RISC-V updates for v7.3 2026-08-20 14:53:54 -07:00
phy Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
pinctrl Pin control bulk changes for kernel v7.3 2026-08-24 08:46:03 -07:00
platform MFD for v7.3 2026-08-27 10:45:08 -07:00
pmdomain Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
pnp
power power sequencing updates for v7.3-rc1 2026-08-26 08:45:09 -07:00
powercap More power management updates for 7.3-rc1 2026-08-26 14:13:26 -07:00
pps
ps3
ptp ptp: netc: fix period truncation and potential divide-by-zero in PEROUT 2026-08-22 12:34:39 -07:00
pwm Driver core changes for 7.3-rc1 2026-08-19 10:42:18 -07:00
rapidio
ras
regulator regulator: Fix for v7.3 2026-08-27 12:21:56 -07:00
remoteproc
resctrl arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
reset Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
rpmsg
rtc RTC for 7.3 2026-08-28 09:53:43 -07:00
s390 Arm: 2026-08-25 11:48:04 -07:00
sbus
scsi SCSI updates for 7.3 2026-08-29 11:55:36 -07:00
sh
siox
slimbus
soc remoteproc updates for v7.3 2026-08-25 14:03:31 -07:00
soundwire soundwire updates for 7.3 2026-08-24 12:16:16 -07:00
spi spi: Fixes for v7.3 2026-08-27 12:38:05 -07:00
spmi
ssb
staging Staging driver updates for 7.3-rc1 2026-08-25 10:16:19 -07:00
target USB / Thunderbolt changes for 7.3-rc1 2026-08-25 10:44:46 -07:00
tc
tee soc: drivers for 7.3 2026-08-18 19:40:29 -07:00
thermal MFD for v7.3 2026-08-27 10:45:08 -07:00
thunderbolt thunderbolt: Changes for v7.3 merge window 2026-08-19 10:01:59 +02:00
tty TTY / Serial driver updates for 7.3-rc1 2026-08-25 10:59:12 -07:00
ufs SCSI updates for 7.3 2026-08-29 11:55:36 -07:00
uio
usb Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
vdpa vduse: Add suspend 2026-08-19 06:38:48 -04:00
vfio mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
vhost vhost,vdpa,virtio: fixes, features 2026-08-20 17:07:50 -07:00
video Backlight for v7.3 2026-08-27 11:16:39 -07:00
virt arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
virtio virtio_ring: fix infinite loop in virtnet_poll_cleantx when device is broken 2026-08-19 06:38:47 -04:00
w1
watchdog MFD for v7.3 2026-08-27 10:45:08 -07:00
xen dma-mapping updates for Linux 7.3: 2026-08-24 11:35:46 -07:00
zorro
Kconfig
Makefile