drm_crtc_init_with_planes(9)
π drm_crtc_init_with_planes(9) π
okay so bestie, this is a page from the Kernel API Manual and it's literally about making a brand-new CRTC object and handing it its planes. pull up a chair π
β¨ NAME β¨
drm_crtc_init_with_planes β initialise a new CRTC object with specified primary and cursor planes. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
int drm_crtc_init_with_planes (struct drm_device *dev , struct drm_crtc
*crtc , struct drm_plane *primary , struct drm_plane *cursor , const
struct drm_crtc_funcs *funcs , const char *name , ... );
like, yes, that's a lot of arguments. we'll get through it together π«Ά
π¦ ARGUMENTS π¦
devβ the DRM device, the whole main character of this story πcrtcβ the CRTC object you're initialising. the one getting the glow-up β¨primaryβ the primary plane for this CRTC πcursorβ the cursor plane for this CRTC π±οΈfuncsβ the callbacks for your new CRTC. the behaviour handbook, iykyk πnameβ aprintfstyle format string for the CRTC name, orNULLfor the default name π·οΈ...β variable arguments, for feeding thatprintfformat string π
π DESCRIPTION π
So what this does is init a new object created as the base part of a driver crtc object. fr fr, that's the job π
Drivers should use this function instead of drm_crtc_init β and not me being dramatic, that one is only provided for backwards compatibility with drivers which do not yet support universal planes. so like, legacy energy π
The drm_crtc_funcs.destroy hook should call drm_crtc_cleanup and kfree the crtc structure. and listen β the crtc structure should not be allocated with devm_kzalloc. no cap, don't do it π
The primary and cursor planes are only relevant for legacy uAPI β see drm_crtc.primary and drm_crtc.cursor if you wanna go deeper π
π§ NOTE π§
consider usingdrmm_crtc_alloc_with_planesordrmm_crtc_init_with_planesinstead ofdrm_crtc_init_with_planesto let the DRM managed resource infrastructure take care of cleanup and deallocation. lowkey the move, honestly β let the infrastructure handle the boring parts so you don't have to π
β RETURN β
Zero on success, error code on failure. slay when it's zero, and uh. bestie when it's not π
π₯ SEE ALSO π₯
- Kernel file
./drivers/gpu/drm/drm_crtc.coverview(9) drm_crtc_from_index(9)standard CRTC properties(9)drmm_crtc_init_with_planes(9)drm_crtc_cleanup(9)drm_mode_getcrtc(9)drm_mode_set_config_internal(9)drm_crtc_check_viewport(9)drm_mode_setcrtc(9)drm_crtc_create_scaling_filter_property(9)drm_crtc_in_clone_mode(9)
go read them all, they're giving study group πβ¨
mwah π this page lives in ./drivers/gpu/drm and it was stamped October 2026 β thanks for reading the whole thing bestie, you ate and left no crumbs πππ¦
π¦ 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