fb_find_best_mode(9)
π fb_find_best_mode β kernel api manual, but make it cute
okay so real talk, this one's from the kernel api manual and it's literally fb_find_best_mode, and its whole job is find best matching videomode. that's the name, that's the mission. slay. β¨
πΈ SYNOPSIS πΈ
here's the signature bestie, copy it exactly, don't @ me:
const struct fb_videomode * fb_find_best_mode (const struct fb_var_screeninfo *var , struct list_head *head );
π ARGUMENTS π
two args, both pointers, both iconic in their own way:
- _var_ β pointer to
struct fb_var_screeninfo. yeah. that whole thing. it's a pointer, it points, that's the vibe. π«Ά - _head_ β pointer to
struct list_headof modelist. it's the list head of the modelist. your modelist's main character. π
π RETURN π
you get back a struct fb_videomode, and if nothing's found? NULL. no mode for you, bestie, sorry not sorry. π
π¦ DESCRIPTION π¦
IMPORTANT: This function assumes that all modelist entries in info->modelist are valid.
like. IMPORTANT, okay?? it assumes every single entry in info->modelist is valid. it's not out here doing vibe checks on your entries, it's trusting you completely. so if you feed it garbage, that's on you, not on her. π
β¨ NOTES β¨
so what does it actually do, you ask? it finds the best matching videomode that has a dimension equal to or greater than var->xres and var->yres. so like, big enough, never too small. π―
and if it finds more than 1 videomode that fits? it returns the one with the highest refresh rate. because obviously. more hertz, more slay, the smoothest one wins. the way that refresh rate just eats. π₯
π SEE ALSO π
go read these too, they're all in the kernel file ./drivers/video/fbdev/core/modedb.c, iykyk:
fb_try_mode(9)fb_find_mode(9)fb_var_to_videomode(9)fb_videomode_to_var(9)fb_mode_is_equal(9)fb_find_nearest_mode(9)fb_match_mode(9)fb_add_videomode(9)fb_delete_videomode(9)fb_destroy_modelist(9)fb_videomode_to_modelist(9)
that's the whole friend group, fr fr. π§π
okay that's the page!! it lives at ./drivers/video/fbdev/core, dated October 2026, and it's fb_find_best_mode(9) β mwah, periodt, go find your best mode bestie π
ππ
π¦ 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