fb.modes(5)
๐ fb.modes โ the frame buffer modes file, bestie ๐
okay so this is fb.modes(5) from the Linux frame buffer utils, and it's literally the glow-up guide for your screen. no cap.
โจ NAME โจ
fb.modes โ the frame buffer modes file. that's it, that's the whole name, she's simple and she slays ๐
๐ธ DESCRIPTION ๐ธ
/etc/fb.modes holds an unlimited number of video mode descriptions. yes bestie, unlimited, go off ๐
the general format of a video mode is giving:
mode
geometry <xres> <yres> <vxres> <vyres> <depth>
timings <pixclock> <left> <right> <upper> <lower> <hslen> <vslen>
options <value>
rgba <red,green,blue,alpha>
endmode
so you open with mode, you close with endmode, and everything cute happens in between. main character energy fr fr ๐ฆ
๐ OPTIONS ๐
geometry options โ the size of the vibe
xresโ visible horizontal resolution (in pixels). the width your eyes actually get to see โจyresโ visible vertical resolution (in pixels). the height, same deal ๐vxresโ virtual horizontal resolution (in pixels). the horizontal virtual situation ๐vyresโ virtual vertical resolution (in pixels). vertical virtual, you get it ๐depthโ display depth (in bits per pixel). how many bits per pixel, periodt ๐
timing options โ the rhythm section ๐ต
pixclockโ length of one pixel (in picoseconds). one singular pixel's whole lifespan ๐ญleftโ left margin (in pixels)rightโ right margin (in pixels)upperโ upper margin (in pixel lines)lowerโ lower margin (in pixel lines)hslenโ horizontal sync length (in pixels)vslenโ vertical sync length (in pixel lines)
rgba options โ only valid with truecolor ๐
redโ red color bitfields (in length or length/offset)greenโ green color bitfields (in length or length/offset)blueโ blue color bitfields (in length or length/offset)alphaโ alpha color bitfields (in length or length/offset)
heads up bestie: these are only valid with truecolor. don't try it otherwise, it's not the moment ๐
other options โ the rest of the squad ๐ซถ
okay so the first value of these options is the default. noted ๐
hsync {low|high}โ the horizontal sync polarityvsync {low|high}โ the vertical sync polaritycsync {low|high}โ the composite sync polaritygsync {low|high}โ the sync on green polaritybcast {false|true}โ enable or disable broadcast modes. if enabled the frame buffer generates the exact timings fot several broadcast modes (e.g.PALorNTSC). note that this option may not be supported by every frame buffer โ ๏ธextsync {false|true}โ enable or disable external resync. if enabled the sync timings are not generated by the frame buffer device and must be provided externally instead. note that this option may not be supported by every frame buffer device โ ๏ธsync <number>โ custom sync flags (frame buffer driver dependent)laced {false|true}โ enable or disable interlace. if enabled the display will be split in two frames, each frame contains only even and odd lines respectively. these two frames will be displayed alternating, this way twice the lines can be displayed and the vertical frequency for monitor stays the same, but the visible vertical frequency gets halved ๐ต๐ซdouble {false|true}โ enable or disable doublescan. if enabled every line will be displayed twice and this way the horizontal frequency can easily be doubled, so that the same resolution can be displayed on different monitors, even if the horizontal frequency specification differs. note that this option may not be supported by every frame buffer device โ ๏ธnostd <number>โ select nonstandard video modeaccel {false|true}โ enable or disable hardware text acceleration ๐ฅgrayscale {false|true}โ enable or disable graylevels instead of colors ๐ฉถ
๐ง INTERNALS ๐ง
ngl this is the part where it gets kinda iconic. generally a frame buffer display is organized as follows:
+---+---------------+---+---+
| | ^ | | |
| | | 5 | | |
| | v | | |
+---#################---+---+
| # ^ # | |
| # | # | |
| # | # | |
| 1 # | 2 # 3 | 4 |
|<->#<------+------>#<->|<->|
| # | # | |
| # | 6 # | |
| # | # | |
| # v # | |
+---#################---+---+
| | ^ | | |
| | | 7 | | |
| | v | | |
+---+---------------+---+---+
| | ^ | | |
| | | 8 | | |
| | v | | |
+---+---------------+---+---+
and the numbers mean:
- 1 โ left margin
- 2 โ
xres - 3 โ right margin
- 4 โ horizontal sync len
- 5 โ upper margin
- 6 โ
yres - 7 โ lower margin
- 8 โ vertical sync len
the area bordered with # is the visible display area. look at her ๐
horizontal and vertical frequencies can now easily be calculated โ for this, the sum of horizontal or vertical values are important:
htotal = left + xres + right + hslen
vtotal = upper + yres + lower + vslen
the length of one line can now be calculated with pixclock:
line = pixclock * htotal
and we have the horizontal frequency:
hfreq = 1E12 / line = 1E12 / (pixclock * htotal)
to get the vertical frequency vtotal must eventually be adjusted. if the display is laced, vtotal must be halved, or if the display is a doublescan one, vtotal must be doubled. now we can calculate the length of one frame:
if (lace) vtotal /= 2
if (double) vtotal *= 2
frame = vtotal * line
and we get also the vertical frequency:
vfreq = 1E12 / frame = hfreq / vtotal
math ate that honestly ๐งฎโจ
๐ SEE ALSO ๐
go read your sisters, they're iconic too ๐ซถ
k bye bestie, this page is from version 2.1, dated 2003-08-07 โ an elder but a legend, fr fr. Linux frame buffer utils forever ๐๐โญ
๐ฆ where this page comes from
- debian bookworm: fbset 2.1-33
- debian trixie: fbset 2.1-34
- nixos 26.05: fbset 2.1
- nixpkgs unstable: fbset 2.1
- ubuntu jammy: fbset 2.1-32build3
- ubuntu noble: fbset 2.1-33build1
- ubuntu questing: fbset 2.1-34
- ubuntu resolute: fbset 2.1-35
- ubuntu stonking: fbset 2.1-35
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms