|
| 1 | +# Tyr GPU Driver |
| 2 | + |
| 3 | +## What is Tyr? |
| 4 | + |
| 5 | +Tyr is a new Rust-based DRM driver for CSF-based Arm Mali GPUs. It is a port of |
| 6 | +Panthor — a driver written in C for the same hardware — and written as a joint |
| 7 | +effort between Collabora, Arm and Google engineers. |
| 8 | + |
| 9 | +Tyr aims to eventually implement the same userspace API offered by Panthor for |
| 10 | +compatibility reasons, so that it can be used as a drop-in replacement in our |
| 11 | +Vulkan driver, called |
| 12 | +[PanVK](https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/panfrost/vulkan?ref_type=heads). |
| 13 | +In any case, we foresee Panthor being used — and of course supported — for a |
| 14 | +relatively long time, as it is a mature driver with a large adoption in the |
| 15 | +ecosystem. It will probably take a couple of years for Tyr to fully pick up. |
| 16 | + |
| 17 | +## Where is Tyr developed? |
| 18 | + |
| 19 | +The development of Tyr takes place both upstream, through our [latest |
| 20 | +submission ](https://lore.kernel.org/rust-for-linux/[email protected]/) |
| 21 | +— and downstream, on the `tyr-next` branch at the [Panfrost Gitlab repository](https://gitlab.freedesktop.org/panfrost/linux). |
| 22 | + |
| 23 | +This split is unfortunately necessary as we do not have the required |
| 24 | +infrastructure in upstream yet, although our plan is to eventually migrate to |
| 25 | +an upstream-only development model once this changes. |
| 26 | + |
| 27 | +We go into more details about why we chose to develop Tyr this way on our |
| 28 | +series of [blog |
| 29 | +posts](https://www.collabora.com/news-and-blog/news-and-events/introducing-tyr-a-new-rust-drm-driver.html) |
| 30 | +at [Collabora's blog](https://www.collabora.com/news-and-blog/). Anyone willing |
| 31 | +to get acquainted with Mali's open source stack should refer to that, as we |
| 32 | +will be covering the whole infrastructure from a simple Vulkan application to |
| 33 | +the actual GPU hardware in Mali's CSF architecture. We will also cover the |
| 34 | +various components needed to write a driver, as well as the status of the |
| 35 | +abstractions needed to interact with them from Rust code. |
| 36 | + |
| 37 | +As it currently stands, our downstream branch can be used to test the |
| 38 | +abstractions that are still being developed. It makes sure that we can write a |
| 39 | +functional driver with the abstractions that are currently being proposed. |
| 40 | + |
| 41 | +## What is the current status of the driver? |
| 42 | + |
| 43 | +The current upstream submission can power up the GPU and probe the device on an |
| 44 | +RK3588 system-on-chip. This lets us read a few sections of ROM in the GPU, |
| 45 | +which in turn lets us provide this information to userspace by means of a |
| 46 | +`DRM_IOCTL_PANTHOR_DEV_QUERY` call. |
| 47 | + |
| 48 | +This is all that can be done for now in upstream code, at least until the Micro |
| 49 | +Controller Unit can be made to work. |
| 50 | + |
| 51 | +Our downstream branch (`tyr-next`) can submit small parcels of work to the GPU, |
| 52 | +and we will soon be able to submit more elaborate workflows. We hope to see |
| 53 | +[VkCube](https://github.com/KhronosGroup/Vulkan-Tools) running on Tyr soon. |
| 54 | + |
| 55 | +In any case, there is no power management and little error recovery. We will be |
| 56 | +working on that in the coming months. |
| 57 | + |
| 58 | +## Can I try it out? |
| 59 | + |
| 60 | +Anyone with a RK3588 SoC can test Tyr, but the driver is not capable of |
| 61 | +replacing Panthor yet. A good candidate device is Radxa's |
| 62 | +[ROCK 5B](https://radxa.com/products/rock5/5b/) Single Board Computer. |
| 63 | + |
| 64 | +A good starting point is to run our [IGT |
| 65 | +tests](https://gitlab.freedesktop.org/dwlsalmeida/igt-gpu-tools/-/tree/panthor?ref_type=heads). |
| 66 | +While only a subset of the tests pass on the upstream code for the reasons |
| 67 | +highlighted above, they should all pass if run on `tyr-next`. |
| 68 | + |
| 69 | +Note that Mali GPUs are found in a vast array of devices, and that we will |
| 70 | +support more hardware as we progress in the implementation. |
| 71 | + |
| 72 | +## Contributing |
| 73 | + |
| 74 | +Tyr is open-source software, and as such, anyone interested in its development |
| 75 | +can check our [issue |
| 76 | +board](https://gitlab.freedesktop.org/panfrost/linux/-/issues/?label_name%5B%5D=tyr). |
| 77 | +We will be posting good starting tasks at a future point. |
| 78 | + |
| 79 | +To work on any given task, assign it to yourself and follow up with a merge |
| 80 | +request against `tyr-next`. Please also write the IGT tests needed to ensure that |
| 81 | +your code works. |
| 82 | + |
| 83 | +Happy hacking! |
0 commit comments