drm_universal_plane_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_universal_plane_alloc(9) β€” the Kernel API Manual, bestie edition ✨

okay so picture this: you're deep in the drm_universal_plane_alloc(9) page of the Kernel API Manual, right, and it's giving "allocate and initialize a universal plane object" and honestly? iconic. Let's get into it πŸŽ€


🌸 NAME 🌸

drm_universal_plane_alloc β€” literally the glow-up-forge where a universal plane object gets allocated and initialized. one function, both jobs, main character energy πŸ‘‘


✨ SYNOPSIS ✨

drm_universal_plane_alloc (dev , type , member , possible_crtcs , funcs
, formats , format_count , format_modifiers , plane_type , name , ... );

yes that's a whole lot of arguments. no, we are not skipping any. they're all getting their moment πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

so like, everything this function needs to know, bestie, one by one:

  • dev β€” the DRM device. the whole vibe originates here fr.
  • type β€” the type of the struct that contains struct drm_plane. like, which struct are we living inside.
  • member β€” the name of the drm_plane within type. yes, that exact name. precision.
  • possible_crtcs β€” bitmask of possible CRTCs. bitmask era, we love to see it.
  • funcs β€” the callbacks for your new plane. all the personality goes here 🫢
  • formats β€” array of supported formats (DRM_FORMAT_...)
  • format_count β€” the number of elements in formats. like, count them. actually count.
  • format_modifiers β€” array of struct drm_format modifiers, terminated by DRM_FORMAT_MOD_INVALID. ⚠️ don't forget the terminator, that's the whole bit.
  • plane_type β€” type of plane: overlay, primary, or cursor. pick your fighter.
  • name β€” printf style format string for the plane name, or NULL for the default name. name your child or let the kernel do it, no judgement.
  • ... β€” variable arguments. the mysterious lil ellipsis. they're there, they matter πŸ’«

πŸ’– DESCRIPTION πŸ’–

So what's actually happening: it allocates and initializes a plane object of type type. that's the whole assignment and it ate πŸ”₯

⚠️ real talk though: the caller is responsible for releasing the allocated memory with kfree. that's on YOU, bestie. no cap. the memory does not clean itself up.

Drivers are encouraged to use drmm_universal_plane_alloc instead. (it's the managed version, it's giving responsible adult, we stan 🌈)

And here's a lil special case: drivers that only support the DRM_FORMAT_MOD_LINEAR modifier support may set format_modifiers to NULL. In that case the plane will advertise the linear modifier. free of charge, no extra work, slay ✨


⭐ RETURN ⭐

Pointer to the new plane, or ERR_PTR on failure. check for the error, bestie, please 😭


πŸŽ€ SEE ALSO πŸŽ€

like a whole friend group of plane functions. iykyk πŸ’œ


and that's the page!! brought to you from ./include/drm, dated October 2026, and this was drm_universal_plane_alloc(9) β€” go forth, allocate responsibly, and kfree your mess 🌸✌️

πŸ“¦ where this page comes from