drm_mode_getfb(9)
π drm_mode_getfb β get FB info β¨
okay so bestie, you found it β drm_mode_getfb(9), straight out of the Linux Kernel API Manual. this is the one that goes "hey kernel, what's the deal with this framebuffer?" and the kernel actually tells you. iconic behaviour honestly π
β¨ SYNOPSIS β¨
int drm_mode_getfb (struct drm_device *dev , void *data , struct
drm_file *file_priv );
that's the whole vibe. three args, one int coming back at you. no cap. π¦
πΈ ARGUMENTS πΈ
devβ the drm device for the ioctl, like, the whole graphics device this call is happening on. main character energy fr fr πdataβ the data pointer for the ioctl. yes it's avoid *, yes that's on purpose, it's just carrying your struct through πfile_privβ the drm file for the ioctl call. this is which open file / client is doing the asking, so the kernel knows who's talking π
π¦ DESCRIPTION π¦
so what does it actually do? simple: lookup the FB given its ID and return info about it. that's it, that's the whole thing. you hand over a framebuffer ID, it finds the matching FB and hands back the info about it. slay. β¨
and it's called by the user via ioctl β so like, userspace pokes the ioctl, the kernel path wakes up, and this is what runs. periodt. π
π₯ RETURN π₯
- Zero on success π (zero is the good one here, don't panic)
- negative errno on failure π β so if it goes wrong you get a negative errno number back, that's your sign something didn't land
π SEE ALSO π
like a little friend group, and you should lowkey meet all of them:
- Kernel file
./drivers/gpu/drm/drm_framebuffer.cβ that's the home base for all this overview(9)drm_mode_addfb(9)drm_mode_addfb2(9)drm_mode_rmfb(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)drm_framebuffer_remove(9)
iykyk, these are the whole framebuffer saga β add it, add it again but v2, remove it, get it, get it v2, dirty it, release it, init it, look it up, unregister the private one, clean it up, remove it. literally the entire lifecycle bestie π§π
ngl this page is short but that's a good thing β short manpage, fast lookup, no scrolling. obsessed. π
and that's the whole page, bestie!! π«Ά this one lives under ./drivers/gpu/drm and the version stamp says October 2026 β so like, future-dated and still flawless. go get your framebuffer info, you got this πβπΈ
π¦ 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