fbset -h
Linux Frame Buffer Device Configuration Version 2.1 (23/06/1999)
(C) Copyright 1995-1999 by Geert Uytterhoeven
Usage: fbset [options] [mode]
Valid options:
General options:
-h, --help : display this usage information
--test : don't change, just test whether the mode is valid
-s, --show : display video mode settings
-i, --info : display all frame buffer information
-v, --verbose : verbose mode
-V, --version : print version information
-x, --xfree86 : XFree86 compatibility mode
-a, --all : change all virtual consoles on this device
Frame buffer special device nodes:
-fb <device> : processed frame buffer device
(default is /dev/fb0)
Video mode database:
-db <file> : video mode database file
(default is /etc/fb.modes)
Display geometry:
-xres <value> : horizontal resolution (in pixels)
-yres <value> : vertical resolution (in pixels)
-vxres <value> : virtual horizontal resolution (in pixels)
-vyres <value> : virtual vertical resolution (in pixels)
-depth <value> : display depth (in bits per pixel)
-nonstd <value> : select nonstandard video mode
-g, --geometry ... : set all geometry parameters at once
-match : set virtual vertical resolution by virtual resolution
Display timings:
-pixclock <value> : pixel clock (in picoseconds)
-left <value> : left margin (in pixels)
-right <value> : right margin (in pixels)
-upper <value> : upper margin (in pixel lines)
-lower <value> : lower margin (in pixel lines)
-hslen <value> : horizontal sync length (in pixels)
-vslen <value> : vertical sync length (in pixel lines)
-t, --timings ... : set all timing parameters at once
Display flags:
-accel <value> : hardware text acceleration enable (false or true)
-hsync <value> : horizontal sync polarity (low or high)
-vsync <value> : vertical sync polarity (low or high)
-csync <value> : composite sync polarity (low or high)
-gsync <value> : synch on green (false or true)
-extsync <value> : external sync enable (false or true)
-bcast <value> : broadcast enable (false or true)
-laced <value> : interlace enable (false or true)
-double <value> : doublescan enable (false or true)
-rgba <r,g,b,a> : recommended length of color entries
-grayscale <value> : grayscale enable (false or true)
Display positioning:
-move <direction> : move the visible part (left, right, up or down)
-step <value> : step increment (in pixels or pixel lines)
(default is 8 horizontal, 2 vertical)
1.设置geometry
fbset -g 800 600 800 600 32
画面分辨率为800 *600,桌面分辨率为800*600 32表示位深,32bpp
2.设置timing
[0] = { /* support LCD 800X600 */
.name = "QY_LCD",
.xres = 800,
.yres = 600,
.left_margin = 61,
.right_margin = 53,
.hsync_len = 120,
.lower_margin= 21,
.upper_margin = 35,
.vsync_len = 6,
// .pxl_clk = 9000000,
.pixclock = KHZ2PICOS(24),
.sync = FB_SYNC_CLK_INVERT | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
},
设置之前先解释下pixclock,屏的Clock Period是24ns
-pixclock <value> : pixel clock (in picoseconds) pixclock是1ps 的clock值,即24x1000
fbset -t 24000 61 53 21 35 120 6
设备树里面同理
display-timings {
800x600p62 {
clock-frequency = <41600000>;
hactive = <800>;
vactive = <600>;
hfront-porch = <61>;
hback-porch = <53>;
hsync-len = <120>;
vback-porch = <21>;
vfront-porch = <35>;
vsync-len = <6>;
hsync-active = <1>;
vsync-active = <1>;
};
};