drm_framebuffer_remove(9)
β¨ 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 π
- 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_cleanup(9)
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
- 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