drm_framebuffer_cleanup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the fb from active usage. if it's still used anywhere, hilarity can ensue 😭 β€” literally, because userspace could call getfb on 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 rmfb ioctl
  • 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 🌈


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