drm_framebuffer_cleanup(9)
π drm_framebuffer_cleanup β like, the kernel API manual page, bestie β¨
okay so you found the drm_framebuffer_cleanup(9) page in the Kernel API Manual and you're like "what does this even do" β don't worry, I got you. this is the whole thing, no cap π«Ά
β¨ NAME β¨
drm_framebuffer_cleanup β remove a framebuffer object π
β¨ SYNOPSIS β¨
void drm_framebuffer_cleanup (struct drm_framebuffer *fb );
that's it. one function, one arg, iconic signature energy π
β¨ ARGUMENTS β¨
fbβ the framebuffer to remove. that's your girly. she's getting cleaned up π
β¨ DESCRIPTION β¨
so basically: cleanup framebuffer. πΈ
this function is intended to be used from the driver's drm_framebuffer_funcs.destroy callback. it can also be used to clean up driver private framebuffers that are embedded into a larger structure β yes bestie, nested-struct cleanup is a thing and this handles it π¦
β οΈ okay listen, important part: this function does not remove thefbfrom active usage. if it's still used anywhere, hilarity can ensue π β literally, because userspace could callgetfbon the id and get back-EINVAL. obviously no concern at driver unload time, though. like at that point who cares π
also β and this is the part people forget β the framebuffer will not be removed from the lookup idr. π
- for user-created framebuffers, that happens in the
rmfbioctl - for driver-private objects (e.g. for fbdev), drivers need to explicitly call
drm_framebuffer_unregister_private
so likeβ¦ do that. don't skip it. it's giving "I forgot the second step" energy and nobody wants that π
β¨ SEE ALSO β¨
go read these too, iykyk π
- Kernel file
./drivers/gpu/drm/drm_framebuffer.coverview(9) drm_mode_addfb(9)drm_mode_addfb2(9)drm_mode_rmfb(9)drm_mode_getfb(9)drm_mode_getfb2_ioctl(9)drm_mode_dirtyfb_ioctl(9)drm_fb_release(9)drm_framebuffer_init(9)drm_framebuffer_lookup(9)drm_framebuffer_unregister_private(9)drm_framebuffer_remove(9)
anyway bestie that's the whole page β this one came out of ./drivers/gpu/drm in the Kernel API Manual, dated October 2026 β go clean up those framebuffers responsibly, and remember: drm_framebuffer_cleanup does not unregister your private fb for you, no matter how much you want it to ππ
π¦ 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