Daniel Almeida, who works on video codec development at Collabora, posted on the developer mailing list Linux- the initial implementation of the Tyr driver for ARM Mali GPUs that utilize Command Stream Frontend (CSF) technology, such as the Mali G310, G510, and G710. The driver code is written in Rust and comprises just over 600 lines of code. Work on the Tyr driver is being conducted jointly by Collabora, Arm, and Google.
The framework for creating the new driver uses components of the abstract rust_platform_driver driver and the Nova driver, developed for NVIDIA GPUs, written in Rust and partially added to the 6.15 kernel. The functionality for interacting with the Mali GPU is ported from the existing Panthor (Direct Rendering Manager) DRM driver, written in C. The Tyr driver's uAPI is identical to the Panthor driver's uAPI, which allows using existing user space components with it.
The CSF technology, used since the 10th generation of Mali GPUs, is notable for moving some driver functions to the firmware side and using a new model for organizing work execution on the GPU. In GPUs with a CSF interface, instead of a model based on sending a chain of works, a model based on a command flow is used with scheduling of the command flow queue on the firmware side. To organize the work of the scheduler, a separate Cortex-M7 microcontroller is built into the GPU, and a special command execution unit (Command Execution Unit) is provided to execute CSF instructions.
Tyr's functionality still lags behind the Panthor driver, but the developers intend to gradually reduce the gap until parity in driver capabilities is achieved. The missing features require additional abstractions to be integrated into the kernel to create drivers in Rust, so the development of the Tyr driver will be synchronized with the addition of these abstractions to the kernel. For example, the kernel does not yet have the capabilities for memory mapping in Rust drivers for GPUs, which are being developed in the GPUVM patch set, which has not yet been adopted.
Source: opennet.ru
