A CRTC (CRT Controller) is the core scanout engine in DRM. It reads pixel data from a primary plane, applies display timing (theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Smithay/drm-rs/llms.txt
Use this file to discover all available pages before exploring further.
Mode), and drives the signal through an encoder to a connector. Without an active CRTC the display goes dark — enabling one performs what the kernel calls a “modeset”.
Each CRTC has at least one associated primary plane. Additional overlay and cursor planes can be layered on top for hardware compositing. The CRTC also owns a gamma lookup table for colour correction.
CRTCs are enumerated through Device::resource_handles() and inspected with Device::get_crtc().
crtc::Handle
An opaque, copy-cheap handle to a CRTC resource. Internally a NonZeroU32 wrapped with repr(transparent). Implements ResourceHandle with FFI_TYPE = DRM_MODE_OBJECT_CRTC.
crtc::Info
Returned by Device::get_crtc(). Describes the current hardware state of a CRTC.
| Method | Return type | Description |
|---|---|---|
handle() | Handle | The CRTC’s own handle |
position() | (u32, u32) | (x, y) pixel offset within the display plane (used for multi-monitor positioning) |
mode() | Option<Mode> | The active display timing mode, or None if the CRTC is disabled |
framebuffer() | Option<framebuffer::Handle> | The framebuffer currently being scanned out, or None if disabled |
gamma_length() | u32 | Number of entries in the gamma lookup table (use with get_gamma / set_gamma) |
Info also implements Display, formatting as "CRTC <id>".
Mode
Mode is a display timing structure (repr(transparent) over the kernel’s drm_mode_modeinfo). It is returned by connector::Info::modes() and stored in crtc::Info.
| Method | Return type | Description |
|---|---|---|
name() | &CStr | Mode name string (e.g. "1920x1080") |
clock() | u32 | Pixel clock in kHz |
size() | (u16, u16) | Active resolution (width, height) in pixels |
hsync() | (u16, u16, u16) | Horizontal sync start, end, and total |
vsync() | (u16, u16, u16) | Vertical sync start, end, and total |
hskew() | u16 | Horizontal skew |
vscan() | u16 | Vertical scan multiplier |
vrefresh() | u32 | Vertical refresh rate in Hz |
mode_type() | ModeTypeFlags | Whether the mode is preferred, user-defined, or driver-reported |
flags() | ModeFlags | Sync polarity, interlace, doublescan, stereo, and other flags |
CrtcListFilter
A bitmask returned by encoder::Info::possible_crtcs() and plane::Info::possible_crtcs(). Use with ResourceHandles::filter_crtcs to obtain the subset of CRTCs compatible with a given encoder or plane.