drm_universal_plane_alloc(9)
π 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 containsstruct drm_plane. like, which struct are we living inside.memberβ the name of thedrm_planewithintype. 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 informats. like, count them. actually count.format_modifiersβ array ofstruct drm_formatmodifiers, terminated byDRM_FORMAT_MOD_INVALID. β οΈ don't forget the terminator, that's the whole bit.plane_typeβ type of plane:overlay,primary, orcursor. pick your fighter.nameβ printf style format string for the plane name, orNULLfor 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 π
- Kernel file
./include/drm/drm_plane.h struct drm_plane_state(9)struct drm_plane_funcs(9)enum drm_plane_type(9)struct drm_plane(9)drmm_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)
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
- 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