3

I'd like to understand how Linux detects which display devices are available (video output) and how it decides what to display on each one.

For example: if I have an embedded device with a serial line and an HDMI port, how do I make the console appear on the HDMI display instead of the serial console?

Also, if I want to use a simple OpenGL application that's linked against video drivers, what interface would OpenGL use to draw on the HDMI port?

Pointers to the proper documentation would be awesome.

1 Answer 1

2

For most systems, handling which screen device to output to is dependent on the GPU or some other video display controller. All interfacing with the video device(s) on the system is handled by the Direct Rending Manager (DRM) and the closely related Kernel Mode Setting (KMS) kernel subsystems.

From the Wikipedia page on the topic:

In computing, the Direct Rendering Manager (DRM), a subsystem of the Linux kernel, interfaces with the GPUs of modern video cards. DRM exposes an API that user-space programs can use to send commands and data to the GPU, and to perform operations such as configuring the mode setting of the display. DRM was first developed as the kernel space component of the X Server's Direct Rendering Infrastructure, but since then it has been used by other graphic stack alternatives such as Wayland.

User-space programs can use the DRM API to command the GPU to do hardware-accelerated 3D rendering and video decoding as well as GPGPU computing.

The official Linux docs can be found in the source repository under Documentation/gpu. Here is the github link, for your convenience.

Additionally, the Wikipedia article seems quite extensive. Depending on your goals, this resource alone might be sufficient, and it is certainly easier and less technical reading than the official documentation is.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .