drm_framebuffer_remove(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ drm_framebuffer_remove(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's a little framebuffer breakup page and honestly it's giving "we need to talk" energy πŸ’”


πŸŽ€ NAME πŸŽ€

drm_framebuffer_remove β€” remove and unreference a framebuffer object

like, it takes the framebuffer out of the picture and drops the reference. two jobs, one function, icon energy πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

void drm_framebuffer_remove (struct drm_framebuffer *fb );

no return value, it's a void, it just does the thing and leaves πŸ’…


🌸 ARGUMENTS 🌸

  • fb β€” the framebuffer to remove. that's it, that's the whole input. she's the main character here 🫢

πŸ’– DESCRIPTION πŸ’–

So here's what's happening, no cap: it scans all the CRTCs and planes in dev's mode_config. If any of them are using fb, it removes it and sets it to NULL. Then it drops the reference to the passed-in framebuffer. Not gonna lie, it might take the modeset locks 😭

⚠️ note that this function optimizes the cleanup away if the caller holds the last reference to the framebuffer. And it is also guaranteed to not take the modeset locks in this case. periodt. πŸ”₯

so basically: last ref in your hands = skip the whole cleanup arc, zero lock drama. the way that works is literally so clean ✨


🌈 SEE ALSO 🌈

go read the whole friend group, they all ate πŸ“


okay that's the page!! from <purple>./drivers/gpu/drm</purple>, dated October 2026 β€” mwah, love u, go free those framebuffers πŸ’œπŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from