1DRM-KMS(7) Direct Rendering Manager DRM-KMS(7)
2
3
4
6 drm-kms - Kernel Mode-Setting
7
9 #include <xf86drm.h>
10
11 #include <xf86drmMode.h>
12
14 Each DRM device provides access to manage which monitors and displays
15 are currently used and what frames to be displayed. This task is called
16 Kernel Mode-Setting (KMS). Historically, this was done in user-space
17 and called User-space Mode-Setting (UMS). Almost all open-source
18 drivers now provide the KMS kernel API to do this in the kernel,
19 however, many non-open-source binary drivers from different vendors
20 still do not support this. You can use drmModeSettingSupported(3) to
21 check whether your driver supports this. To understand how KMS works,
22 we need to introduce 5 objects: CRTCs, Planes, Encoders, Connectors and
23 Framebuffers.
24
25 CRTCs
26 A CRTC short for CRT Controller is an abstraction representing a
27 part of the chip that contains a pointer to a scanout buffer.
28 Therefore, the number of CRTCs available determines how many
29 independent scanout buffers can be active at any given time. The
30 CRTC structure contains several fields to support this: a pointer
31 to some video memory (abstracted as a frame-buffer object), a list
32 of driven connectors, a display mode and an (x, y) offset into the
33 video memory to support panning or configurations where one piece
34 of video memory spans multiple CRTCs. A CRTC is the central point
35 where configuration of displays happens. You select which objects
36 to use, which modes and which parameters and then configure each
37 CRTC via drmModeCrtcSet(3) to drive the display devices.
38
39 Planes
40 A plane respresents an image source that can be blended with or
41 overlayed on top of a CRTC during the scanout process. Planes are
42 associated with a frame-buffer to crop a portion of the image
43 memory (source) and optionally scale it to a destination size. The
44 result is then blended with or overlayed on top of a CRTC. Planes
45 are not provided by all hardware and the number of available planes
46 is limited. If planes are not available or if not enough planes are
47 available, the user should fall back to normal software blending
48 (via GPU or CPU).
49
50 Encoders
51 An encoder takes pixel data from a CRTC and converts it to a format
52 suitable for any attached connectors. On some devices, it may be
53 possible to have a CRTC send data to more than one encoder. In that
54 case, both encoders would receive data from the same scanout
55 buffer, resulting in a cloned display configuration across the
56 connectors attached to each encoder.
57
58 Connectors
59 A connector is the final destination of pixel-data on a device, and
60 usually connects directly to an external display device like a
61 monitor or laptop panel. A connector can only be attached to one
62 encoder at a time. The connector is also