STRUCT DRM_PLANE_STATE(9)
π struct drm_plane_state(9) β mutable plane state
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for struct drm_plane_state, aka the mutable plane state. think of it as the lil living, breathing snapshot of a plane that atomic commits push around π¦ it's giving "everything you can change about a plane, in one struct." obsessed.
πΈ SYNOPSIS πΈ
struct drm_plane_state {
struct drm_plane *plane;
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
struct dma_fence *fence;
int32_t crtc_x;
int32_t crtc_y;
uint32_t crtc_w, crtc_h;
uint32_t src_x;
uint32_t src_y;
uint32_t src_h, src_w;
int32_t hotspot_x, hotspot_y;
u16 alpha;
uint16_t pixel_blend_mode;
unsigned int rotation;
unsigned int zpos;
unsigned int normalized_zpos;
enum drm_color_encoding color_encoding;
enum drm_color_range color_range;
struct drm_property_blob *fb_damage_clips;
bool ignore_damage_clips;
struct drm_rect src, dst;
bool visible;
enum drm_scaling_filter scaling_filter;
struct drm_colorop *color_pipeline;
struct drm_crtc_commit *commit;
struct drm_atomic_commit *state;
bool color_mgmt_changed : 1;
};
no cap, that's the whole squad π«Ά let's meet them one by one.
π Members π
planeβ backpointer to the plane π«crtcβ currently bound CRTC, orNULLif it's disabled. β οΈ do not write this directly, bestie β usedrm_atomic_set_crtc_for_planeinstead, iykyk.fbβ the currently bound framebuffer. β οΈ also a hands-off field, do not write it directly, usedrm_atomic_set_fb_for_plane.fenceβ optional fence to wait for before scanning outfb. the core atomic code sets this when userspace is using explicit fencing π₯ and listen: do not write this field directly for a driver's implicit fence.
drivers should store any implicit fence in this from their drm_plane_helper_funcs.prepare_fb callback. see drm_gem_plane_helper_prepare_fb for a suitable helper π§
crtc_xβ left position of the visible portion of the plane on the crtc. it's a signed dest location, which is the whole reason it can sit partially off screen πcrtc_yβ upper position of the visible portion of the plane on the crtc. also signed, so yeah, partially off screen is legal πcrtc_wβ width of the visible portion of the plane on the crtc.crtc_hβ height of the visible portion of the plane on the crtc.src_xβ left position of the visible portion of the plane within the plane (in 16.16 fixed point).src_yβ upper position of the visible portion of the plane within the plane (in 16.16 fixed point).src_hβ height of the visible portion of the plane (in 16.16).src_wβ width of the visible portion of the plane (in 16.16).hotspot_xβ x offset to the mouse cursor hotspot π±οΈhotspot_yβ y offset to the mouse cursor hotspot π±οΈalphaβ opacity of the plane, where0is completely transparent and0xffffis completely opaque. seedrm_plane_create_alpha_propertyfor more details β¨pixel_blend_modeβ the alpha blending equation selection, describing how the pixels from the current plane get composited with the background. value can be one ofDRM_MODE_BLEND_*πrotationβ rotation of the plane. seedrm_plane_create_rotation_propertyfor more details πzposβ priority of the given plane on the crtc (optional).
user-space may set mutable zpos properties so that multiple active planes on the same CRTC have identical zpos values. this is a user-space bug π but drivers can solve the conflict by comparing the plane object IDs; the plane with a higher ID is stacked on top of a plane with a lower ID.
see drm_plane_create_zpos_property and drm_plane_create_zpos_immutable_property for more details.
normalized_zposβ normalized value ofzpos: unique, range from0toN-1whereNis the number of active planes for the given crtc. π note that the driver must setdrm_mode_config.normalize_zposor calldrm_atomic_normalize_zposto update this before it can be trusted β like, don't trust it before that, fr fr.color_encodingβ color encoding for non RGB formats.color_rangeβ color range for non RGB formats.fb_damage_clipsβ blob representing damage (the area in the plane framebuffer that changed since the last plane update) as an array ofdrm_mode_rectin framebuffer coodinates of the attached framebuffer. π©Ή note that unlike planesrc, damage clips are not in 16.16 fixed point.
see drm_plane_get_damage_clips and drm_plane_get_damage_clips_count for accessing these.
ignore_damage_clipsβ set by drivers to indicate to thedrm_atomic_helper_damage_iter_inithelper that thefb_damage_clipsblob property should be ignored π
see :ref:damage_tracking_properties`` for more information.
srcβ source coordinates of the plane (in 16.16).
when using drm_atomic_helper_check_plane_state, the coordinates are clipped, but the driver may choose to use unclipped coordinates instead when the hardware performs the clipping automatically π«
dstβ clipped destination coordinates of the plane.
when using drm_atomic_helper_check_plane_state, the coordinates are clipped, but the driver may choose to use unclipped coordinates instead when the hardware performs the clipping automatically π«
visibleβ visibility of the plane. this can befalseeven iffb!=NULLandcrtc!=NULL, due to clipping π so like, don't assume.scaling_filterβ scaling filter to be applied.color_pipelineβ the first colorop of the active color pipeline, orNULLif no color pipeline is active. π¨commitβ tracks the pending commit to prevent use-after-free conditions, and for async plane updates.
may be NULL.
stateβ backpointer to the globaldrm_atomic_commit.color_mgmt_changedβ color management properties have changed. used by the atomic helpers and drivers to steer the atomic commit control flow π
π¦ Description π¦
please note π that the destination coordinates crtc_x, crtc_y, crtc_h and crtc_w and the source coordinates src_x, src_y, src_h and src_w are the raw coordinates provided by userspace. drivers should use drm_atomic_helper_check_plane_state and only use the derived rectangles in src and dst to program the hardware. periodt β no raw-coordinate shenanigans π
π SEE ALSO π
kernel file ./include/drm/drm_plane.h β plus struct drm_plane_funcs(9), enum drm_plane_type(9), struct drm_plane(9), drmm_universal_plane_alloc(9), drm_universal_plane_alloc(9), drm_plane_index(9), drm_plane_mask(9), drm_plane_find(9), drm_for_each_plane_mask(9), drm_for_each_legacy_plane(9), drm_for_each_plane(9) β go read them, bestie, they're iconic π«Ά
that's the whole page, mwah π brought to you from ./include/drm in the October 2026 edition of the Kernel API Manual β slay, go commit some atoms π₯π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms