'\" t .\" Title: fb_find_mode .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Frame Buffer Library .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "FB_FIND_MODE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Frame Buffer Library" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" fb_find_mode \- finds a valid video mode .SH "SYNOPSIS" .HP \w'int\ fb_find_mode('u .BI "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" ");" .SH "ARGUMENTS" .PP \fIvar\fR .RS 4 frame buffer user defined part of display .RE .PP \fIinfo\fR .RS 4 frame buffer info structure .RE .PP \fImode_option\fR .RS 4 string video mode to find .RE .PP \fIdb\fR .RS 4 video mode database .RE .PP \fIdbsize\fR .RS 4 size of \fIdb\fR .RE .PP \fIdefault_mode\fR .RS 4 default video mode to fall back to .RE .PP \fIdefault_bpp\fR .RS 4 default color depth in bits per pixel .RE .SH "DESCRIPTION" .PP Finds a suitable video mode, starting with the specified mode in \fImode_option\fR with fallback to \fIdefault_mode\fR\&. If \fIdefault_mode\fR fails, all modes in the video mode database will be tried\&. .PP Valid mode specifiers for \fImode_option\fR: .PP x[M][R][\-][@][i][m] or [\-][@] .PP with , , and decimal numbers and a string\&. .PP If \*(AqM\*(Aq is present after yres (and before refresh/bpp if present), the function will compute the timings using VESA(tm) Coordinated Video Timings (CVT)\&. If \*(AqR\*(Aq is present after \*(AqM\*(Aq, will compute with reduced blanking (for flatpanels)\&. If \*(Aqi\*(Aq is present, compute interlaced mode\&. If \*(Aqm\*(Aq is present, add margins equal to 1\&.8% of xres rounded down to 8 pixels, and 1\&.8% of yres\&. The char \*(Aqi\*(Aq and \*(Aqm\*(Aq must be after \*(AqM\*(Aq and \*(AqR\*(Aq\&. Example: .PP 1024x768MR\-8\fI60m\fR \- Reduced blank with margins at 60Hz\&. .SH "NOTE" .PP The passed struct \fIvar\fR is _not_ cleared! This allows you to supply values for e\&.g\&. the grayscale and accel_flags fields\&. .PP Returns zero for failure, 1 if using specified \fImode_option\fR, 2 if using specified \fImode_option\fR with an ignored refresh rate, 3 if default mode is used, 4 if fall back to any valid mode\&. .SH "COPYRIGHT" .br