This one is maybe a bit theoretical, but... How the heck can X11 touch the video hardware? As I understand it, X11 is an unprivileged user-mode program. But only kernel-mode software can access the hardware. So... how?

(It's a simple enough question, but I haven't been able to find any documentation that explains this simple point. There's a lot of documentation about how to set up X11, or how the X11 client/server arrangement works, but not much about how it drives the hardware...)

Basically I'm interested in knowing how much of the work is X11, and how much of it is the kernel, and where the two meet.


In the simplest scenario, the so-called DDX (Device Dependent X) part of the X server will identify your video driver and use ioctl calls to initialize it, configure the video adapter and (usually) get the framebuffer address. The framebuffer will then be used for rendering. Here is a much more detailed description of the process.

Things will get more complicated if some of the applications decide to use XV or GLX, but in the end all hardware-level rendering will be done by your video adapter drivers, and X server will never attempt to access the hardware directly.

  • Some very interesting information in the linked article. It still doesn't really explain how a X11 driver, in user mode, is doing stuff like adjusting PCI memory mappings and so forth. I thought only the kernel can do that... – MathematicalOrchid Apr 1 '15 at 14:13
  • X11 is not a driver. It uses the driver, which runs in kernel mode. – Joe Sewell Apr 1 '15 at 16:46
  • The X11 device-dependent part, e.g. xf86-video-ati.so will use ioctl() calls to talk to the kernel driver, e.g. fglrx.ko. So, X11 "driver" is actually a user-mode library. – Dmitry Grigoryev Apr 1 '15 at 18:48

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.