fb_find_mode(9)
π fb_find_mode(9) π
okay so bestie, this is the Kernel API Manual entry for fb_find_mode, and it's literally the βfind me a valid video modeβ bestie of your dreams. no cap. π«Ά
π NAME π
fb_find_mode β finds a valid video mode. periodt. β¨
π¦ SYNOPSIS π¦
int fb_find_mode (struct fb_var_screeninfo *var , struct fb_info *info , const char *mode_option , const struct fb_videomode *db , unsigned int dbsize , const struct fb_videomode *default_mode , unsigned int default_bpp );
π ARGUMENTS π
okay, the cast of characters:
varβ frame buffer user defined part of display. main character energy tbh.infoβ frame buffer info structure.mode_optionβ string video mode to find.dbβ video mode database.dbsizeβ size of db. literally the size, bestie.default_modeβ default video mode to fall back to.default_bppβ default color depth in bits per pixel.
π DESCRIPTION π
It finds a suitable video mode β starting with the specified mode in mode_option, with fallback to default_mode. If default_mode fails, all modes in the video mode database will be tried. she's persistent. π
Valid mode specifiers for mode_option are:
<xres>x<yres>[M][R][-<bpp>][<refresh>][i][p][m]
or :
<name>[-<bpp>][<refresh>]
with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a string. yes bestie, decimal numbers, not vibes. π
If M is present after yres (and before refresh/bpp if present), the function will compute the timings using VESA(tm) Coordinated Video Timings (CVT). If R is present after M, will compute with reduced blanking (for flatpanels). If i or p are present, compute interlaced or progressive mode. If m is present, add margins equal to 1.8% of xres rounded down to 8 pixels, and 1.8% of yres. The char
Then the page just leaves us with βThe charβ β iconic little fragment β and hits you with this example:
1024x768MR-860m - Reduced blank with margins at 60Hz.
π NOTE π
The passed struct var is _not_ cleared! This allows you to supply values for e.g. the grayscale and accel_flags fields. okay so do not expect a clean slate, bestie β that is the whole point. π«Ά
Returns:
0β failure1β using specifiedmode_option2β using specifiedmode_optionwith an ignored refresh rate3β default mode is used4β fall back to any valid mode
π SEE ALSO π
Kernel file ./drivers/video/fbdev/core/modedb.c
fb_try_mode(9)fb_var_to_videomode(9)fb_videomode_to_var(9)fb_mode_is_equal(9)fb_find_best_mode(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)
mwah π β page sourced from ./drivers/video/fbdev/core, dated October 2026. that's the footer, bestie, and we're done. πΈ
π¦ 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