Tyr – A Rust GPU driver for Arm Mali GPUs

One interesting addition to the just-released Linux 6.18 kernel is the Tyr Rust GPU driver for CSF-based Arm Mali GPUs, which is a port of the mature Panthor C GPU driver merged into Linux 6.10. It was developed by Collabora in collaboration with Arm and Google.

Tyr aims to implement the same userspace API offered by Panthor, so that it can eventually be used as a drop-in replacement in the company’s PanVK Vulkan driver. After several years, the Tyr Rust driver might replace the Panthor C driver, but in the meantime, Panthor will keep being used since it is more mature and conformant with OpenGL ES 3.1 since July 2024.

Debian Gnome on Tyr
GNOME on Tyr

The work on Tyr is fairly advanced, and Collabora provided an update at the end of November. The key takeaway is that the Tyr (prototype) driver works with  GNOME, Weston, and even full-screen 3D games like SuperTuxKart while matching the performance of the C-driver (Panthor), at least for the downstream prototype, since more work is needed for upstream (aka mainline Linux), as explained in Linux 6.18 changelog:

Initial Rust driver skeleton for ARM Mali GPUs.
– It can power up the GPU, query for GPU metatdata through MMIO and provide the metadata to userspace via DRM device IOCTL (struct drm_panthor_dev_query).
….

This first patch, however, only implements a subset of the current features available downstream, as the rest is not implementable without pulling in even more abstractions. In particular, a lot of things depend on properly mapping memory on a given VA range, which itself depends on the GPUVM abstraction that is currently work-in-progress. For this reason, we still cannot boot the MCU and thus, cannot do much for the moment.

The downstream Tyr prototype was tested on a Radxa ROCK 5B single board computer, but it might also work on other Rockchip RK3588 platforms, too. Here are a few of the things that work right now.

  • Drawing a 3D cube, a typical 3D graphics acceleration test. In this case, vkcube on Weston. Note: 4K (4096×2160 resolution screenshot)

vkcube on Weston on Tyr

  • GNOME with Firefox and watching YouTube videos from there.

GNOME on Tyr Firefox YouTube

  • Playing the SuperTuxKart 3D racing game

Supertuxkart Tyr Rust driver

Collabora explains that the game is rendered correctly and is perfectly playable in full-screen mode, as showcased by the video embedded at the end of this post, but there are some glitches in windowed mode, so it’s something they’ll need to work on.

Tyr is not ready to be used as a daily driver, and upstreaming will take additional time, but the progress shown here is encouraging. If you want to try it out on your own ROCK 5B board, you’ll find the demo code on Freedesktop’s GitLab server. You’ll need to enable CONFIG_TYR_DRM_DEPS and CONFIG_DRM_TYR in your kernel config.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress. We also use affiliate links in articles to earn commissions if you make a purchase after clicking on those links.

Radxa Orion O6 Armv9 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
1 Comment
oldest
newest
Boardcon MINI1126B-P AI vision system-on-module wit Rockchip RV1126B-P SoC