Daniel Almeida, who is involved in video codec development at Collabora, has published an initial implementation of the Tyr driver for ARM Mali GPUs, utilizing CSF (Command Stream Frontend) technology for models such as Mali G310, G510, and G710, in the Linux kernel developers' mailing list. The driver code is written in Rust and consists of just over 600 lines. Development of the Tyr driver is a collaboration between employees of Collabora, Arm, and Google.
The framework for creating the new driver is based on components from the abstract rust_platform_driver and the Nova driver developed for NVIDIA GPUs, which is written in Rust and partially added to kernel 6.15. Functionality for interacting with Mali GPUs has been ported from the existing DRM driver Panthor (Direct Rendering Manager), which is written in C. The uAPI of the Tyr driver is identical to that of the Panthor driver, allowing it to utilize existing user space components.
The CSF technology, used starting with the 10th generation of Mali GPUs, is notable for offloading certain driver functions to firmware and employing a new model for organizing work execution on the GPU. In GPUs with a CSF interface, instead of a job chaining model, a command stream model is used, with command stream queue scheduling handled by the firmware. A separate Cortex-M7 microcontroller is built into the GPU to manage the scheduler, and a specialized Command Execution Unit is provided for executing CSF instructions.
Tyr's functionality still lags behind Panthor's, but developers plan to gradually close the gap until parity in driver capabilities is achieved. Missing features require the integration of additional abstractions into the kernel for creating Rust drivers, so the development of Tyr will be synchronized with the addition of these abstractions to the kernel. For instance, the kernel currently lacks memory mapping capabilities in Rust drivers for GPUs that are being developed in a yet-to-be-accepted set of GPUVM patches.
Source: opennet.ru
