First Phase Of X.Org GPU Hot-Plugging Works

Written by Michael Larabel in X.Org on 22 October 2011 at 07:26 PM EDT. 9 Comments
X.ORG
David Airlie has demonstrated success in the first phase of his X.Org GPU/driver hot-plugging work, which eventually may lead to proper dynamic GPU switching under X.

On David Airlie's blog he has written briefly about his X.Org hot-plug work that he's been doing on and off for the past year. He's also included a video (embedded at the end of this post) that demonstrates this video hot-plugging work.

What's going on is using the xf86-video-modesetting driver with his custom X.Org Server work and xterm and GNOME Metacity. When he plugs in a USB-based DisplayLink adapter that's using his custom Linux kernel DRM driver, the USB-driven display lights up and is functional.

What goes on is that his custom X.Org Server code is started up with the respective drivers and David's major X.Org video driver ABI re-work comes into play here. One X protocol screen is exported and then when the GPU hot-plug happens, the xorg-server initializes another screen for the new device and plugs it into the single protocol screen. The driver-level pixmaps/pictures/GCs are copied to the new driver. The single protocol screen is then multi-plexed across the plugged in driver screens. David explains it as being "like Xinerama pushed down a lot further in the stack, so instead of doing iterations at the protocol level, we do it down at the acceleration level. Also I have randr code hooked up so all the outputs appear no matter what GPU they are from."

This demonstration is from a DisplayLink USB adapter, which doesn't have 3D hardware acceleration abilities. What Airlie eventually wants to get to is getting the main GPU to do the rendering and then only send the scan-out buffer to the USB device. This rendering-on-one-GPU-and-send-to-another could also be used for multi-GPU desktop systems to offload rendering work for one intensive OpenGL application/game to a secondary GPU and then piping the contents back to the primary graphics processor, among other possibilities.

While good progress has been made, David has been dabbling with this code for a year and there's still much more work ahead before we might see the code merged into mainline and deployed. "The real solution is a still a long ways off, but this is just a small light in a long tunnel, I've been hacking on this on/off for over a year now, so its nice to see something visible for the first time."

In terms of dynamic GPU switching for multi-GPU setups (such as NVIDIA Optimus and other notebooks with dual graphics processors), David says in a comment on his blog that the KMS drivers would need to be modified to work with the new X.Org Server for switching and such. Sharing of more kernel-level objects via PRIME or dmabuf is also needed.

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