A Linux driver for the Apple AGX GPU, written in Rust, is proposed for review.

A preliminary implementation of the drm-asahi driver for the Apple AGX G13 and G14 series GPUs used in the Apple M1 and M2 chips has been proposed on the Linux kernel developer mailing list. The driver is written in Rust and additionally includes a set of universal bindings over the DRM (Direct Rendering Manager) subsystem that can be used to develop other graphics drivers in Rust. The published set of patches has so far been proposed only for discussion by core developers (RFC), but can be accepted into the main team after reviewing is completed and the identified shortcomings are eliminated.

Since December, the driver has been included in the package with the kernel for the Asahi Linux distribution and has been tested by users of this project. The driver can be used in Linux distributions to organize the graphical environment on Apple devices with SoC M1, M1 Pro, M1 Max, M1 Ultra and M2. When developing the driver, an attempt was made not only to increase security by minimizing errors when working with memory in the code executed on the CPU side, but also to partially protect against problems that arise when interacting with the firmware. In particular, the driver provides certain bindings for unsafe shared memory structures with complex chains of pointers used in the firmware to interact with the driver.

The proposed driver is used in conjunction with the asahi Mesa driver, which provides user-space OpenGL support and passes OpenGL ES 2 compatibility tests and is almost ready to support OpenGL ES 3.0. At the same time, the driver working at the kernel level is initially developed taking into account future support for the Vulkan API, and the programming interface for interacting with user space is designed with an eye on the UAPI provided by the new Intel Xe driver.

Source: opennet.ru

Add a comment