DRM User-Space API For Apple Silicon Graphics Posted For Review

While the Asahi AGX Gallium3D and Honeykrisp Vulkan drivers continue to be developed within mainline Mesa for supporting OpenGL and Vulkan with Apple Silicon M1/M2 SoCs, the necessary Direct Rendering Manager (DRM) kernel driver has yet to be upstreamed. But hitting the mailing list today is a patch getting the user-space API (UAPI) with more eyes on as the precursor to the actual kernel driver that is currently held up by waiting on Rust kernel abstractions to be upstreamed.

Alyssa Rosenzweig posted the patch today to the mailing list for the proposed user-space API for the Asahi kernel driver:

“This adds the UAPI for the Asahi driver targeting the GPU in the Apple M1 and M2 series systems on chip. The UAPI design is based on other modern Vulkan-capable drivers, including Xe and Panthor. Memory management is based on explicit VM management. Synchronization is exclusively explicit sync.

This UAPI is validated against our open source Mesa stack, which is fully conformant to the OpenGL 4.6, OpenGL ES 3.2, OpenCL 3.0, and Vulkan 1.4 standards. The Vulkan driver supports sparse, exercising the VM_BIND mechanism.”

Today is just the header file for the user-space API to be used by their Rust-written DRM kernel driver. The actual driver isn’t yet posted for review due to a number of Rust abstractions still taking a while to be upstreamed:

“This patch adds the standalone UAPI header. It is implemented by an open source DRM driver written in Rust. We fully intend to upstream this driver when possible. However, as a production graphics driver, it depends on a significant number of Rust abstractions that will take a long time to upstream. In the mean time, our userspace is upstream in Mesa but is not allowed to probe with upstream Mesa as the UAPI is not yet reviewed and merged in the upstream kernel. Although we ship a patched Mesa in Fedora Asahi Remix, any containers shipping upstream Mesa builds are broken for our users, including upstream Flatpak and Waydroid runtimes. Additionally, it forces us to maintain forks of Mesa and virglrenderer, which complicates bisects.

The intention in sending out this patch is for this UAPI to be thoroughly reviewed. Once we as the DRM community are satisfied with the UAPI, this header lands signifying that the UAPI is stable and must only be evolved in backwards-compatible ways; it will be the UAPI implemented in the DRM driver that eventually lands upstream. That promise lets us enable upstream Mesa, solving all these issues while the upstream Rust abstractions are developed.”

This Asahi DRM user-space API can be found via this mailing list thread.