1FB_FIND_MODE(9) Frame Buffer Library FB_FIND_MODE(9)
2
3
4
6 fb_find_mode - finds a valid video mode
7
9 int fb_find_mode(struct fb_var_screeninfo * var, struct fb_info * info,
10 const char * mode_option,
11 const struct fb_videomode * db, unsigned int dbsize,
12 const struct fb_videomode * default_mode,
13 unsigned int default_bpp);
14
16 var
17 frame buffer user defined part of display
18
19 info
20 frame buffer info structure
21
22 mode_option
23 string video mode to find
24
25 db
26 video mode database
27
28 dbsize
29 size of db
30
31 default_mode
32 default video mode to fall back to
33
34 default_bpp
35 default color depth in bits per pixel
36
38 Finds a suitable video mode, starting with the specified mode in
39 mode_option with fallback to default_mode. If default_mode fails, all
40 modes in the video mode database will be tried.
41
42 Valid mode specifiers for mode_option:
43
44 <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m] or
45 <name>[-<bpp>][@<refresh>]
46
47 with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a
48 string.
49
50 If 'M' is present after yres (and before refresh/bpp if present), the
51 function will compute the timings using VESA(tm) Coordinated Video
52 Timings (CVT). If 'R' is present after 'M', will compute with reduced
53 blanking (for flatpanels). If 'i' is present, compute interlaced mode.
54 If 'm' is present, add margins equal to 1.8% of xres rounded down to 8
55 pixels, and 1.8% of yres. The char 'i' and 'm' must be after 'M' and
56 'R'. Example:
57
58 1024x768MR-860m - Reduced blank with margins at 60Hz.
59
61 The passed struct var is _not_ cleared! This allows you to supply
62 values for e.g. the grayscale and accel_flags fields.
63
64 Returns zero for failure, 1 if using specified mode_option, 2 if using
65 specified mode_option with an ignored refresh rate, 3 if default mode
66 is used, 4 if fall back to any valid mode.
67
69Kernel Hackers Manual 3.10 June 2019 FB_FIND_MODE(9)