Linux VGEM Driver Rewritten In Rust Sent Out For Review

Written by Michael Larabel in Linux Kernel on 21 March 2023 at 06:30 AM EDT. 46 Comments
LINUX KERNEL
Besides the ongoing work around the reverse-engineered Apple Silicon graphics driver being brought up in the Rust programming language, the other notable Rust effort within the Direct Rendering Manager (DRM) kernel subsystem is a rewrite of the basic VGEM driver in this increasingly-used programming language. That Rust VGEM driver has now been sent out on the mailing list for review as part of a request for comments.

As written about a few weeks back, the VGEM kernel driver is being rewritten in Rust. VGEM is the Virtual GEM provider that is a minimal non-hardware-backed Graphics Execution Manager (GEM) memory management service. This VGEM driver can be used with Mesa's LLVMpipe and other non-native 3D drivers for better buffer sharing and can yield better performance as a result.


Maíra Canal with Igalia has been rewriting the VGEM code in Rust and a few days ago sent out the "RFC" patch series to the mailing list. Maíra Canal explained in the series:
"This is my first take on using the DRM Rust abstractions to convert a DRM driver, written originally in C, to Rust. This patchset consists of a conversion of the vgem driver to a DRM Rust driver. This new driver has the exactly same functionalities of the original C driver, but takes advantages of all the Rust features.

These patches are based primarily on the Rust DRM abstractions, sent as a RFC to the mailing list last week. Also, it depends on some Device abstractions and on the Timer abstraction developed by Boqun Feng."

This Rust VGEM driver in its current form is roughly 500 lines of new code. We'll see when it's reviewed and when all the new Rust DRM abstractions are ready for mainlining. The RFC patches can be found here.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week