12

Can someone explain why two sets of drivers are needed, one in the Linux kernel and one in X?

I understand that the device drivers are in the kernel, but what is the role of those in the xserver?

Does wayland require such drivers to run?

1 Answer 1

15

Linux graphics support has been a heavily mutating thing for most of the life of the kernel. Initially, the kernel only talked to the graphics card for text mode purposes. Back then, X used its drivers to do everything, so it worked as a huge kernel-outside-the-kernel.

Later, with Direct Rendering Infrastructure (DRI), some of the code for accelerated graphics features moved kernel-side (called Direct Rendering Manager, DRM — nothing to do with digital rights management) to provide a consistent, abstracted interface to 3D acceleration features.

Currently, you don't need to have a kernel-side DRM module loaded. But if you don't have one, chances are your X session will fall back to software-rendered 3D which is considerably slower and power-hungrier than hardware 3D. Running glxinfo will show info on this.

Wayland is a slightly different story. It sits between the kernel and client applications. With Wayland, the X server is another client application, displaying its root window as just another thing. Wayland takes on the duties of talking to the hardware (X talking to Wayland instead). Since the project is still heavily in development, there's no way to know where it'll end up, but the way I understand it is it still needs kernel support for 3D rendering.

It's obvious from the Wayland architecture diagrams, too: left is the current state of affairs for a modern X desktop, right is the proposed Wayland architecute. The Wayland compositor replaces the X Server as the thing that talks to the hardware, but it doesn't replace the kernel infrastructure — so you'd still need appropriate kernel support. In fact, given the aims of the project, more stuff should move to the kernel for even better abstraction. Wayland, like the X server, are still graphics hardware-dependent.

enter image description here

3
  • Off-topic: What software are you using for the diagram?. It's very nice. Jun 18, 2012 at 2:44
  • 1
    I took the two diagrams from The Wayland Page and joined them with the GIMP. There's a number of tools that can produce diagrams this nice. Graphviz for the fully automated solution, *TeX and PGF/TikZ for the highest quality, and Inkscape if you want to go the manual way. It could even be done in the GIMP, but a vector package is far easier.
    – Alexios
    Jun 18, 2012 at 8:27
  • I used pnginfo on the source file: the tEXt chunk suggests it was done with Inkscape.
    – Alexios
    Jun 18, 2012 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.