Direct Rendering Manager

DRM (Direct Rendering Manager) allows frame buffers to be mapped into user space so that applications can write directly to the buffers. This is a critical piece of the software that allows Wayland to replace X.

The material in this chapter is not used elsewhere in this book, so may be skipped. I included it because I want to know what is happening.

Resources

DRM

To display graphics, and application needs to write to a framebuffer. This is a portion of video memory, and what is written there is displayed on a monitor. For many years, there was very little information about frame buffers or even how to access them. Early versions of X had complex configuration files to specify this information.

DRM (and an associated X driver) allow applications to directly access the framebuffers, and to find information about them. Over the years this has led to a progressive simplification of X configuration, and this may also be used by Wayland compositors, login screens, OpenGL, etc.

The Wayland route is: an application uses EGL to write content to a framebuffer, and the framebuffer is managed by DRM. Wayland has calls to talk to EGL, and EGL in turn uses the DRM API to manipulate the buffers.

Example

The DRM HowTo contains superbly documented programs, and there is no point trying to rewrite their explanation. The simplest program modeset.c is simply included here