STRUCT DRM_FB_HELPER(9)
β¨ struct drm_fb_helper(9) β¨
okay so bestie, this is from the Kernel API Manual and it's literally the whole personality of fbdev emulation on top of KMS π
π NAME π
struct drm_fb_helper β the main structure to emulate fbdev on top of KMS. that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
struct drm_fb_helper {
struct drm_client_dev client;
struct drm_client_buffer *buffer;
struct drm_framebuffer *fb;
struct drm_device *dev;
const struct drm_fb_helper_funcs *funcs;
struct fb_info *info;
u32 pseudo_palette[17];
struct drm_clip_rect damage_clip;
spinlock_t damage_lock;
struct work_struct damage_work;
struct work_struct resume_work;
struct mutex lock;
bool delayed_hotplug;
bool deferred_setup;
int preferred_bpp;
#ifdef CONFIG_FB_DEFERRED_IO;
struct fb_deferred_io fbdefio;
#endif;
};
like yes, it's a struct, but it's the struct π«Ά
π§ Members π§
clientβ the DRM client that the generic fbdev emulation rolls with π«bufferβ the framebuffer the generic fbdev emulation is using, no capfbβ scanout framebuffer object, she's the main character of the actual screen πdevβ the DRM device, iykykfuncsβ driver callbacks for the fb helper, so the driver gets to have opinionsinfoβ the emulated fbdev device info struct πpseudo_paletteβ a fake palette of 16 colors. fake it till you make it πdamage_clipβ clip rectangle used withdeferred_ioto accumulate damage to the screen bufferdamage_lockβ spinlock protectingdamage_clip. gotta keep her safe πdamage_workβ worker used to flush the framebufferresume_workβ worker used during resume if the console lock is already takenlockβ the top-level FBDEV helper lock. this protects all internal data structures and lists, such asconnector_infoandcrtc_info.
FIXME: fbdev emulation locking is a mess and long term we want to protect all helper internal state with this lock as well as reduce core KMS locking as much as possible. π (the kernel devs said it, not me)
delayed_hotplugβ a hotplug was received while fbdev wasn't in control of the DRM device, i.e. another KMS master was active. the output configuration needs to be reprobe when fbdev is in control again. she was on a break, ok πdeferred_setupβ if no outputs are connected (disconnected or unknown) the FB helper code will defer setup until at least one of the outputs shows up. this field keeps track of the status so that setup can be retried at every hotplug event until it succeeds eventually. Resilient queen behavior π
Protected by lock.
preferred_bppβ temporary storage for the driver's preferred BPP setting passed to FB helper initialization. this needs to be tracked so that deferred FB helper setup can pass this on.
See also: deferred_setup
fbdefioβ temporary storage for the driver's FB deferred I/O handler. if the driver uses the DRM fbdev emulation layer, this is set by the core to a generic deferred I/O handler if a driver is preferring to use a shadow buffer. shadow buffer era π¦
π DESCRIPTION π
This is the main structure used by the fbdev helpers π drivers supporting fbdev emulation should embedded this into their overall driver structure. drivers must also fill out a struct drm_fb_helper_funcs with a few operations. like, a few, you got this π«Ά
β SEE ALSO β
Kernel file ./include/drm/drm_fb_helper.h struct drm_fb_helper_surface_size(9), struct drm_fb_helper_funcs(9), DRM_FB_HELPER_DEFAULT_OPS(9)
okay that's the page bestie π it lives in ./include/drm, it's the October 2026 edition of the Kernel API Manual, and the whole thing is filed under struct drm_fb_helper(9) β slay, go read it again, periodt π₯π
π¦ 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