fb.modes(5)

๐Ÿ“ฆ
version 2.1 ยท 2 versions
  • 2.1 ยท debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.1 ยท arch rolling
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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 polarity
  • vsync {low|high} โ€” the vertical sync polarity
  • csync {low|high} โ€” the composite sync polarity
  • gsync {low|high} โ€” the sync on green polarity
  • bcast {false|true} โ€” enable or disable broadcast modes. if enabled the frame buffer generates the exact timings fot several broadcast modes (e.g. PAL or NTSC). 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 mode
  • accel {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 ๐Ÿ‘‘

fbset(8), fbdev(4)


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 ๐Ÿ’–๐ŸŒˆโญ