This morning I wrote the Open-Source NVIDIA Driver Approaches Stable State looking at the open-source reverse-engineered NVIDIA driver leaving the Linux kernel staging area with the forthcoming stable release. I also recapped the current state of the Nouveau driver and a bit of its history. That article also provided a look at the performance of the Nouveau driver versus the official NVIDIA closed-source Linux driver for ten different graphics cards.
In that article I made several references to "a new libdrm" for Nouveau that should offer up impressive performance improvements, reduced CPU usage, and other benefits. Fortunately, that code push happened today. The entire Nouveau DRM library interface has been reworked.
The libdrm commit calls it the "major libdrm rewrite" and affects around 2,000 lines of code in this library. The commit description says, "Redesigned primarily to allow us to better take advantage of BO's [buffer objects] having fixed GPU virtual addresses on GeForce 8 and up, and to reduce the overhead of handling relocations on earlier chipsets."
With the libdrm interface breaking for Nouveau, updates to the xf86-video-nouveau DDX and Mesa Gallium3D Nouveau drivers are required and now found in their respective Git repositories. As said in today's earlier article, in some benchmarks the Nouveau performance may be up by 100% thanks to this libdrm rewrite for Nouveau. Besides the frame rates jumping higher, the CPU usage should be lower at the same time as well. I've already been busy benchmarking this new code, hence why I didn't write about this libdrm the moment this Git commit happened. I should have up a preview of new Nouveau benchmarks on Saturday and a more thorough benchmark analysis a few days later.
Besides the libdrm overhaul and the Nouveau Mesa code switching to this 2.0 interface, there were other important Nouveau commits today too. The Nouveau NVFX Gallium3D driver was completely removed (commit), but that's because a few commits later it was replaced by a new Gallium3D driver. The NVFX-replacement 3D driver is being called "NV30" and it's designed to be much better.
From the commit, "The primary motivation for this rewrite was to have a maintainable driver going forward, as nvfx was quite horrible in a lot of ways. The driver is heavily based on the design of the nv50/nvc0 3d drivers we already have, and uses the same common buffer/fence code. It also passes a HEAP more piglit tests than nvfx did, supports a couple more features, and a few more to come still probably. The CPU footprint of this driver is far far less than nvfx, and translates into far greater framerates in a lot of applications (unless you're using a CPU that's way way newer than the GPUs of these generations....) Basically, we once again have a maintained driver for these chipsets \o/ Feel free to report bugs now!"
This NV30 driver is 13,725 lines of code long and was authored primarily by Ben Skeggs of Red Hat. The NV30 driver supports the GeForce 5 (FX), 6, and 7 series graphics cards.
So at the end of the day we have a radically new libdrm interface for Nouveau that should offer up significant graphics performance benefits while for owners still running the vintage GeForce 5/6/7 graphics cards there's also a brand new driver that is also much better than its predecessor. This will all be great for Mesa 8.1, among the other improvements that are forthcoming. Stay tuned for another round of Nouveau Linux driver benchmarks!
P.S. As a bonus I'm told that the NV50 OpenGL 3.0 near-full-compliance is hours away from being pushed... The only missing item after this push should be the transformed feedback support for NV50. The Nouveau NVC0 (Fermi) driver already advertises GL3.0.