drm_gem_fb_c...e_with_dirty(9)
π drm_gem_fb_c...e_with_dirty(9) β Kernel API Manual β¨
okay bestie, sit down, because this one is from the Kernel API Manual and it's genuinely so useful π«Ά
πΈ NAME πΈ
drm_gem_fb_create_with_dirty β the helper function for the &drm_mode_config_funcs.fb_create callback π
π¦ SYNOPSIS π¦
struct drm_framebuffer * drm_gem_fb_create_with_dirty (struct drm_device
*dev , struct drm_file *file , const struct drm_format_info *info ,
const struct drm_mode_fb_cmd2 *mode_cmd );
likeβ¦ look at that signature. main character energy fr fr π
π ARGUMENTS π
devβ the DRM device, obvs π₯οΈfileβ the DRM file that's holding the GEM handle(s) backing the framebuffer, iykykinfoβ pixel format information β¨mode_cmdβ the metadata straight from the userspace framebuffer creation request π¨
π₯ DESCRIPTION π₯
so this function creates a brand-new framebuffer object, described by drm_mode_fb_cmd2. and that description? it includes handles for the buffer(s) backing the framebuffer, no cap π―
drm_atomic_helper_dirtyfb gets used as the dirty callback, which gives you framebuffer flushing through the atomic machinery βοΈ. lowkey if you don't need the dirty callback, just use drm_gem_fb_create instead β periodt.
also the function does buffer size validation, so it's looking out for you π«Ά
drivers should also call drm_plane_enable_fb_damage_clips on all planes so userspace can use damage clips with the ATOMIC IOCTL too π don't skip this one bestie.
drivers can use this as their drm_mode_config_funcs.fb_create callback β and the ADDFB2 IOCTL is what calls into this callback π
β RETURN β
a pointer to a drm_framebuffer on success π or an error pointer on failure π (the classic duality of man)
π§ SEE ALSO π§
kernel file ./drivers/gpu/drm/drm_gem_framebuffer_helper.c plus the whole friend group:
overview(9)drm_gem_fb_get_obj(9)drm_gem_fb_destroy(9)drm_gem_fb_create_handle(9)drm_gem_fb_init_with_funcs(9)drm_gem_fb_create_with_funcs(9)drm_gem_fb_create(9)drm_gem_fb_vmap(9)drm_gem_fb_vunmap(9)drm_gem_fb_begin_cpu_access(9)drm_gem_fb_end_cpu_access(9)drm_gem_fb_afbc_init(9)
and that's the page, bestie π this little icon lives in ./drivers/gpu/drm and the version's dated October 2026 β go slay some framebuffers, ily πβ¨
π¦ 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