drm_crtc_init_with_planes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” a printf style format string for the CRTC name, or NULL for the default name 🏷️
  • ... β€” variable arguments, for feeding that printf format 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 using drmm_crtc_alloc_with_planes or drmm_crtc_init_with_planes instead of drm_crtc_init_with_planes to 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 πŸ”₯

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