1ab42b818SMauro Carvalho Chehab=============== 2ab42b818SMauro Carvalho ChehabWhat is vesafb? 3ab42b818SMauro Carvalho Chehab=============== 4ab42b818SMauro Carvalho Chehab 5ab42b818SMauro Carvalho ChehabThis is a generic driver for a graphic framebuffer on intel boxes. 6ab42b818SMauro Carvalho Chehab 7ab42b818SMauro Carvalho ChehabThe idea is simple: Turn on graphics mode at boot time with the help 8ab42b818SMauro Carvalho Chehabof the BIOS, and use this as framebuffer device /dev/fb0, like the m68k 9ab42b818SMauro Carvalho Chehab(and other) ports do. 10ab42b818SMauro Carvalho Chehab 11ab42b818SMauro Carvalho ChehabThis means we decide at boot time whenever we want to run in text or 12ab42b818SMauro Carvalho Chehabgraphics mode. Switching mode later on (in protected mode) is 13ab42b818SMauro Carvalho Chehabimpossible; BIOS calls work in real mode only. VESA BIOS Extensions 14ab42b818SMauro Carvalho ChehabVersion 2.0 are required, because we need a linear frame buffer. 15ab42b818SMauro Carvalho Chehab 16ab42b818SMauro Carvalho ChehabAdvantages: 17ab42b818SMauro Carvalho Chehab 18ab42b818SMauro Carvalho Chehab * It provides a nice large console (128 cols + 48 lines with 1024x768) 19ab42b818SMauro Carvalho Chehab without using tiny, unreadable fonts. 20ab42b818SMauro Carvalho Chehab * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11 21ab42b818SMauro Carvalho Chehab support for every VBE 2.0 compliant graphics board). 22ab42b818SMauro Carvalho Chehab * Most important: boot logo :-) 23ab42b818SMauro Carvalho Chehab 24ab42b818SMauro Carvalho ChehabDisadvantages: 25ab42b818SMauro Carvalho Chehab 26ab42b818SMauro Carvalho Chehab * graphic mode is slower than text mode... 27ab42b818SMauro Carvalho Chehab 28ab42b818SMauro Carvalho Chehab 29ab42b818SMauro Carvalho ChehabHow to use it? 30ab42b818SMauro Carvalho Chehab============== 31ab42b818SMauro Carvalho Chehab 32ab42b818SMauro Carvalho ChehabSwitching modes is done using the vga=... boot parameter. Read 33*4f4cfa6cSMauro Carvalho ChehabDocumentation/admin-guide/svga.rst for details. 34ab42b818SMauro Carvalho Chehab 35ab42b818SMauro Carvalho ChehabYou should compile in both vgacon (for text mode) and vesafb (for 36ab42b818SMauro Carvalho Chehabgraphics mode). Which of them takes over the console depends on 37ab42b818SMauro Carvalho Chehabwhenever the specified mode is text or graphics. 38ab42b818SMauro Carvalho Chehab 39ab42b818SMauro Carvalho ChehabThe graphic modes are NOT in the list which you get if you boot with 40ab42b818SMauro Carvalho Chehabvga=ask and hit return. The mode you wish to use is derived from the 41ab42b818SMauro Carvalho ChehabVESA mode number. Here are those VESA mode numbers: 42ab42b818SMauro Carvalho Chehab 43ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 44ab42b818SMauro Carvalho Chehabcolors 640x480 800x600 1024x768 1280x1024 45ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 46ab42b818SMauro Carvalho Chehab256 0x101 0x103 0x105 0x107 47ab42b818SMauro Carvalho Chehab32k 0x110 0x113 0x116 0x119 48ab42b818SMauro Carvalho Chehab64k 0x111 0x114 0x117 0x11A 49ab42b818SMauro Carvalho Chehab16M 0x112 0x115 0x118 0x11B 50ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 51ab42b818SMauro Carvalho Chehab 52ab42b818SMauro Carvalho Chehab 53ab42b818SMauro Carvalho ChehabThe video mode number of the Linux kernel is the VESA mode number plus 54ab42b818SMauro Carvalho Chehab0x200: 55ab42b818SMauro Carvalho Chehab 56ab42b818SMauro Carvalho Chehab Linux_kernel_mode_number = VESA_mode_number + 0x200 57ab42b818SMauro Carvalho Chehab 58ab42b818SMauro Carvalho ChehabSo the table for the Kernel mode numbers are: 59ab42b818SMauro Carvalho Chehab 60ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 61ab42b818SMauro Carvalho Chehabcolors 640x480 800x600 1024x768 1280x1024 62ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 63ab42b818SMauro Carvalho Chehab256 0x301 0x303 0x305 0x307 64ab42b818SMauro Carvalho Chehab32k 0x310 0x313 0x316 0x319 65ab42b818SMauro Carvalho Chehab64k 0x311 0x314 0x317 0x31A 66ab42b818SMauro Carvalho Chehab16M 0x312 0x315 0x318 0x31B 67ab42b818SMauro Carvalho Chehab====== ======= ======= ======== ========= 68ab42b818SMauro Carvalho Chehab 69ab42b818SMauro Carvalho ChehabTo enable one of those modes you have to specify "vga=ask" in the 70ab42b818SMauro Carvalho Chehablilo.conf file and rerun LILO. Then you can type in the desired 71ab42b818SMauro Carvalho Chehabmode at the "vga=ask" prompt. For example if you like to use 72ab42b818SMauro Carvalho Chehab1024x768x256 colors you have to say "305" at this prompt. 73ab42b818SMauro Carvalho Chehab 74ab42b818SMauro Carvalho ChehabIf this does not work, this might be because your BIOS does not support 75ab42b818SMauro Carvalho Chehablinear framebuffers or because it does not support this mode at all. 76ab42b818SMauro Carvalho ChehabEven if your board does, it might be the BIOS which does not. VESA BIOS 77ab42b818SMauro Carvalho ChehabExtensions v2.0 are required, 1.2 is NOT sufficient. You will get a 78ab42b818SMauro Carvalho Chehab"bad mode number" message if something goes wrong. 79ab42b818SMauro Carvalho Chehab 80ab42b818SMauro Carvalho Chehab1. Note: LILO cannot handle hex, for booting directly with 81ab42b818SMauro Carvalho Chehab "vga=mode-number" you have to transform the numbers to decimal. 82ab42b818SMauro Carvalho Chehab2. Note: Some newer versions of LILO appear to work with those hex values, 83ab42b818SMauro Carvalho Chehab if you set the 0x in front of the numbers. 84ab42b818SMauro Carvalho Chehab 85ab42b818SMauro Carvalho ChehabX11 86ab42b818SMauro Carvalho Chehab=== 87ab42b818SMauro Carvalho Chehab 88ab42b818SMauro Carvalho ChehabXF68_FBDev should work just fine, but it is non-accelerated. Running 89ab42b818SMauro Carvalho Chehabanother (accelerated) X-Server like XF86_SVGA might or might not work. 90ab42b818SMauro Carvalho ChehabIt depends on X-Server and graphics board. 91ab42b818SMauro Carvalho Chehab 92ab42b818SMauro Carvalho ChehabThe X-Server must restore the video mode correctly, else you end up 93ab42b818SMauro Carvalho Chehabwith a broken console (and vesafb cannot do anything about this). 94ab42b818SMauro Carvalho Chehab 95ab42b818SMauro Carvalho Chehab 96ab42b818SMauro Carvalho ChehabRefresh rates 97ab42b818SMauro Carvalho Chehab============= 98ab42b818SMauro Carvalho Chehab 99ab42b818SMauro Carvalho ChehabThere is no way to change the vesafb video mode and/or timings after 100ab42b818SMauro Carvalho Chehabbooting linux. If you are not happy with the 60 Hz refresh rate, you 101ab42b818SMauro Carvalho Chehabhave these options: 102ab42b818SMauro Carvalho Chehab 103ab42b818SMauro Carvalho Chehab * configure and load the DOS-Tools for the graphics board (if 104ab42b818SMauro Carvalho Chehab available) and boot linux with loadlin. 105ab42b818SMauro Carvalho Chehab * use a native driver (matroxfb/atyfb) instead if vesafb. If none 106ab42b818SMauro Carvalho Chehab is available, write a new one! 107ab42b818SMauro Carvalho Chehab * VBE 3.0 might work too. I have neither a gfx board with VBE 3.0 108ab42b818SMauro Carvalho Chehab support nor the specs, so I have not checked this yet. 109ab42b818SMauro Carvalho Chehab 110ab42b818SMauro Carvalho Chehab 111ab42b818SMauro Carvalho ChehabConfiguration 112ab42b818SMauro Carvalho Chehab============= 113ab42b818SMauro Carvalho Chehab 114ab42b818SMauro Carvalho ChehabThe VESA BIOS provides protected mode interface for changing 115ab42b818SMauro Carvalho Chehabsome parameters. vesafb can use it for palette changes and 116ab42b818SMauro Carvalho Chehabto pan the display. It is turned off by default because it 117ab42b818SMauro Carvalho Chehabseems not to work with some BIOS versions, but there are options 118ab42b818SMauro Carvalho Chehabto turn it on. 119ab42b818SMauro Carvalho Chehab 120ab42b818SMauro Carvalho ChehabYou can pass options to vesafb using "video=vesafb:option" on 121ab42b818SMauro Carvalho Chehabthe kernel command line. Multiple options should be separated 122ab42b818SMauro Carvalho Chehabby comma, like this: "video=vesafb:ypan,inverse" 123ab42b818SMauro Carvalho Chehab 124ab42b818SMauro Carvalho ChehabAccepted options: 125ab42b818SMauro Carvalho Chehab 126ab42b818SMauro Carvalho Chehabinverse use inverse color map 127ab42b818SMauro Carvalho Chehab 128ab42b818SMauro Carvalho Chehab========= ====================================================================== 129ab42b818SMauro Carvalho Chehabypan enable display panning using the VESA protected mode 130ab42b818SMauro Carvalho Chehab interface. The visible screen is just a window of the 131ab42b818SMauro Carvalho Chehab video memory, console scrolling is done by changing the 132ab42b818SMauro Carvalho Chehab start of the window. 133ab42b818SMauro Carvalho Chehab 134ab42b818SMauro Carvalho Chehab pro: 135ab42b818SMauro Carvalho Chehab 136ab42b818SMauro Carvalho Chehab * scrolling (fullscreen) is fast, because there is 137ab42b818SMauro Carvalho Chehab no need to copy around data. 138ab42b818SMauro Carvalho Chehab 139ab42b818SMauro Carvalho Chehab kontra: 140ab42b818SMauro Carvalho Chehab 141ab42b818SMauro Carvalho Chehab * scrolling only parts of the screen causes some 142ab42b818SMauro Carvalho Chehab ugly flicker effects (boot logo flickers for 143ab42b818SMauro Carvalho Chehab example). 144ab42b818SMauro Carvalho Chehab 145ab42b818SMauro Carvalho Chehabywrap Same as ypan, but assumes your gfx board can wrap-around 146ab42b818SMauro Carvalho Chehab the video memory (i.e. starts reading from top if it 147ab42b818SMauro Carvalho Chehab reaches the end of video memory). Faster than ypan. 148ab42b818SMauro Carvalho Chehab 149ab42b818SMauro Carvalho Chehabredraw Scroll by redrawing the affected part of the screen, this 150ab42b818SMauro Carvalho Chehab is the safe (and slow) default. 151ab42b818SMauro Carvalho Chehab 152ab42b818SMauro Carvalho Chehab 153ab42b818SMauro Carvalho Chehabvgapal Use the standard vga registers for palette changes. 154ab42b818SMauro Carvalho Chehab This is the default. 155ab42b818SMauro Carvalho Chehabpmipal Use the protected mode interface for palette changes. 156ab42b818SMauro Carvalho Chehab 157ab42b818SMauro Carvalho Chehabmtrr:n Setup memory type range registers for the vesafb framebuffer 158ab42b818SMauro Carvalho Chehab where n: 159ab42b818SMauro Carvalho Chehab 160ab42b818SMauro Carvalho Chehab - 0 - disabled (equivalent to nomtrr) (default) 161ab42b818SMauro Carvalho Chehab - 1 - uncachable 162ab42b818SMauro Carvalho Chehab - 2 - write-back 163ab42b818SMauro Carvalho Chehab - 3 - write-combining 164ab42b818SMauro Carvalho Chehab - 4 - write-through 165ab42b818SMauro Carvalho Chehab 166ab42b818SMauro Carvalho Chehab If you see the following in dmesg, choose the type that matches the 167ab42b818SMauro Carvalho Chehab old one. In this example, use "mtrr:2". 168ab42b818SMauro Carvalho Chehab... 169ab42b818SMauro Carvalho Chehabmtrr: type mismatch for e0000000,8000000 old: write-back new: 170ab42b818SMauro Carvalho Chehab write-combining 171ab42b818SMauro Carvalho Chehab... 172ab42b818SMauro Carvalho Chehab 173ab42b818SMauro Carvalho Chehabnomtrr disable mtrr 174ab42b818SMauro Carvalho Chehab 175ab42b818SMauro Carvalho Chehabvremap:n 176ab42b818SMauro Carvalho Chehab Remap 'n' MiB of video RAM. If 0 or not specified, remap memory 177ab42b818SMauro Carvalho Chehab according to video mode. (2.5.66 patch/idea by Antonino Daplas 178ab42b818SMauro Carvalho Chehab reversed to give override possibility (allocate more fb memory 179ab42b818SMauro Carvalho Chehab than the kernel would) to 2.4 by tmb@iki.fi) 180ab42b818SMauro Carvalho Chehab 181ab42b818SMauro Carvalho Chehabvtotal:n If the video BIOS of your card incorrectly determines the total 182ab42b818SMauro Carvalho Chehab amount of video RAM, use this option to override the BIOS (in MiB). 183ab42b818SMauro Carvalho Chehab========= ====================================================================== 184ab42b818SMauro Carvalho Chehab 185ab42b818SMauro Carvalho ChehabHave fun! 186ab42b818SMauro Carvalho Chehab 187ab42b818SMauro Carvalho ChehabGerd Knorr <kraxel@goldbach.in-berlin.de> 188ab42b818SMauro Carvalho Chehab 189ab42b818SMauro Carvalho ChehabMinor (mostly typo) changes 190ab42b818SMauro Carvalho Chehabby Nico Schmoigl <schmoigl@rumms.uni-mannheim.de> 191