The latest Apple Silicon enablement code working its way from the Asahi Linux project toward the upstream Linux kernel is the AVD driver used for accelerated video playback across Apple M1 / M2 / M3 SoCs. Sofus Forstreuter posted the set of 14 patches today to the Linux kernel mailing list for review in introducing the AVD driver for the Apple Video Decoder. This reverse-engineered, open-source driver gets hardware video decoding to work on the Apple M1, M2, and M3 Macs. The Apple Video Decoder supports H.264, H.265, and VP9. For Apple M3 and newer there is also AV1 support. It is expected that the AVD Linux driver will also be extended to work on the M4, M5, M6, and Neo SoCs too eventually and some firmware development work is already underway for supporting the newer hardware. Asahi Linux hosts the necessary AVD firmware they've developed via this repository. This AVD Linux driver has been several years in the making, including reverse engineering work. The driver implements the Video 4 Linux 2 (V4L2) M2M stateless decoder API. As for the Apple Video Decoder's hardware design, Sofus remarked in the patch series cover letter: "The AVD is a bit unique both as a video decoder and an IP block on Apple Silicon SoCs. Instead of following the normal "a register for each parameter", AVD is programmed through one single register. This means the order of the writes are important, but its also important to ensure we dont write faster than the hardware can process. To solve this problem the driver writes the 'instructions' into a list of 'segments'. A shared function then submits those to the hardware while making sure to wait each time the hardware lacks behind. The block also includes Cortex-M3 co-processor that accepts unsigned code. The CM3 is not really required, but is the only way to get decode status IRQ's. For now, the CM3 only handles decode-tunable configuration and forwards all IRQ's to the AP [1]. In the future this will be extended to handle the instruction submission, this would likely result in decreased power consumption, some initial testing even suggests slightly faster decode times." The AVD patches are now out for review on the Linux kernel mailing list for possible inclusion in a future kernel version by way of the media subsystem tree.
Apple Video Decode Driver Posted For Upstream Linux Kernel Review
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.