From f0674cbd19cb79bf4b8025a2b9122b22518c0f34 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Tue, 1 Dec 2026 22:29:49 +0100 Subject: [PATCH] arm64: dts: apple: t8103: mark the video decoder dma-coherent The T8103 AVD is IO-coherent in both directions. Measured on an M1 MacBook Air (J313) with every cache operation skipped (V4L2_MEMORY_FLAG_NON_COHERENT plus V4L2_BUF_FLAG_NO_CACHE_CLEAN and V4L2_BUF_FLAG_NO_CACHE_INVALIDATE): - CPU-dirtied CAPTURE buffers (poisoned with 0xA5 before QBUF) decode bit-exact against software decode on both H.264 1080p60 and HEVC 1080p60, so AVD writes snoop/invalidate CPU cache lines; - CPU-cached CAPTURE buffers read back bit-exact after DQBUF without cache invalidation; - Bitstream OUTPUT buffers written through cacheable mappings and queued without cache clean decode bit-exact on H.264 1080p60, H.264 4K60, and HEVC 1080p60, so AVD reads see dirty CPU cache lines. Because the M1 generation does not report CLIDR_EL1.LoC == 0, omitting dma-coherent maps every AVD buffer uncached. On J313 P-cores, CPU frame readback drops to ~116-119 MiB/s (228.6 ms/frame at 4K, 52.5 ms/frame at 1080p), capping ffmpeg -hwaccel v4l2request decode+readback to ~19 fps on 4K60 H.264. Marking the shared t8103.dtsi avd node dma-coherent lifts CPU readback to ~19.2 GiB/s (~162-166x faster) across all T8103 Macs (J274, J293, J313, J456, J457) with zero DART faults and bit-exact output. Signed-off-by: Thomas Glanzmann --- arch/arm64/boot/dts/apple/t8103.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi index a9cf60bbb0740..064d071f8134d 100644 --- a/arch/arm64/boot/dts/apple/t8103.dtsi +++ b/arch/arm64/boot/dts/apple/t8103.dtsi @@ -1563,6 +1563,7 @@ <0x2 0x69100000 0x0 0x10000>; reg-names = "code", "sram", "mbox", "ctrl"; iommus = <&avd_dart 0>; + dma-coherent; }; avd_dart: iommu@269010000 {