Linux Graphics Subsystem | Hands On Projects For The

The Linux graphics subsystem is often viewed as a terrifyingly complex beast—a swirling vortex of DRM (Direct Rendering Manager), KMS (Kernel Mode Setting), GEM (Graphics Execution Manager), and a dozen userspace APIs. And yes, it is complex. But the best way to demystify it isn't to read another LWN article; it's to get your hands dirty.

# List all resources modetest -M amdgpu # or i915, or vc4 Run from a VT (Ctrl+Alt+F3) and kill your display manager first. sudo modetest -M i915 -s 42@33:1920x1080 -P 79@33:1920x1080@XR24 Hands On Projects For The Linux Graphics Subsystem

That the kernel sees your display as a set of resources (CRTC = scanout engine, Connector = HDMI/DP port). You'll also realize that the framebuffer is just a chunk of memory. Project 2: Mode-Setting with modetest modetest is a Swiss Army knife from the libdrm tests. Use it to take control. The Linux graphics subsystem is often viewed as

#include <fcntl.h> #include <xf86drm.h> #include <xf86drmMode.h> int main() PROT_WRITE, MAP_SHARED, fd, offset); // Fill map with colors drmModeSetCrtc(fd, crtc_id, fb_id, 0, 0, &conn_id, 1, mode); sleep(5); // Admire your work # List all resources modetest -M amdgpu #