vesafb.rst 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ===============
  2. What is vesafb?
  3. ===============
  4. This is a generic driver for a graphic framebuffer on intel boxes.
  5. The idea is simple: Turn on graphics mode at boot time with the help
  6. of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k
  7. (and other) ports do.
  8. This means we decide at boot time whenever we want to run in text or
  9. graphics mode. Switching mode later on (in protected mode) is
  10. impossible; BIOS calls work in real mode only. VESA BIOS Extensions
  11. Version 2.0 are required, because we need a linear frame buffer.
  12. Advantages:
  13. * It provides a nice large console (128 cols + 48 lines with 1024x768)
  14. without using tiny, unreadable fonts.
  15. * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11
  16. support for every VBE 2.0 compliant graphics board).
  17. * Most important: boot logo :-)
  18. Disadvantages:
  19. * graphic mode is slower than text mode...
  20. How to use it?
  21. ==============
  22. Switching modes is done using the vga=... boot parameter. Read
  23. Documentation/admin-guide/svga.rst for details.
  24. You should compile in both vgacon (for text mode) and vesafb (for
  25. graphics mode). Which of them takes over the console depends on
  26. whenever the specified mode is text or graphics.
  27. The graphic modes are NOT in the list which you get if you boot with
  28. vga=ask and hit return. The mode you wish to use is derived from the
  29. VESA mode number. Here are those VESA mode numbers:
  30. ====== ======= ======= ======== =========
  31. colors 640x480 800x600 1024x768 1280x1024
  32. ====== ======= ======= ======== =========
  33. 256 0x101 0x103 0x105 0x107
  34. 32k 0x110 0x113 0x116 0x119
  35. 64k 0x111 0x114 0x117 0x11A
  36. 16M 0x112 0x115 0x118 0x11B
  37. ====== ======= ======= ======== =========
  38. The video mode number of the Linux kernel is the VESA mode number plus
  39. 0x200:
  40. Linux_kernel_mode_number = VESA_mode_number + 0x200
  41. So the table for the Kernel mode numbers are:
  42. ====== ======= ======= ======== =========
  43. colors 640x480 800x600 1024x768 1280x1024
  44. ====== ======= ======= ======== =========
  45. 256 0x301 0x303 0x305 0x307
  46. 32k 0x310 0x313 0x316 0x319
  47. 64k 0x311 0x314 0x317 0x31A
  48. 16M 0x312 0x315 0x318 0x31B
  49. ====== ======= ======= ======== =========
  50. To enable one of those modes you have to specify "vga=ask" in the
  51. lilo.conf file and rerun LILO. Then you can type in the desired
  52. mode at the "vga=ask" prompt. For example if you like to use
  53. 1024x768x256 colors you have to say "305" at this prompt.
  54. If this does not work, this might be because your BIOS does not support
  55. linear framebuffers or because it does not support this mode at all.
  56. Even if your board does, it might be the BIOS which does not. VESA BIOS
  57. Extensions v2.0 are required, 1.2 is NOT sufficient. You will get a
  58. "bad mode number" message if something goes wrong.
  59. 1. Note: LILO cannot handle hex, for booting directly with
  60. "vga=mode-number" you have to transform the numbers to decimal.
  61. 2. Note: Some newer versions of LILO appear to work with those hex values,
  62. if you set the 0x in front of the numbers.
  63. X11
  64. ===
  65. XF68_FBDev should work just fine, but it is non-accelerated. Running
  66. another (accelerated) X-Server like XF86_SVGA might or might not work.
  67. It depends on X-Server and graphics board.
  68. The X-Server must restore the video mode correctly, else you end up
  69. with a broken console (and vesafb cannot do anything about this).
  70. Refresh rates
  71. =============
  72. There is no way to change the vesafb video mode and/or timings after
  73. booting linux. If you are not happy with the 60 Hz refresh rate, you
  74. have these options:
  75. * configure and load the DOS-Tools for the graphics board (if
  76. available) and boot linux with loadlin.
  77. * use a native driver (matroxfb/atyfb) instead if vesafb. If none
  78. is available, write a new one!
  79. * VBE 3.0 might work too. I have neither a gfx board with VBE 3.0
  80. support nor the specs, so I have not checked this yet.
  81. Configuration
  82. =============
  83. The VESA BIOS provides protected mode interface for changing
  84. some parameters. vesafb can use it for palette changes and
  85. to pan the display. It is turned off by default because it
  86. seems not to work with some BIOS versions, but there are options
  87. to turn it on.
  88. You can pass options to vesafb using "video=vesafb:option" on
  89. the kernel command line. Multiple options should be separated
  90. by comma, like this: "video=vesafb:ypan,inverse"
  91. Accepted options:
  92. inverse use inverse color map
  93. ========= ======================================================================
  94. ypan enable display panning using the VESA protected mode
  95. interface. The visible screen is just a window of the
  96. video memory, console scrolling is done by changing the
  97. start of the window.
  98. pro:
  99. * scrolling (fullscreen) is fast, because there is
  100. no need to copy around data.
  101. kontra:
  102. * scrolling only parts of the screen causes some
  103. ugly flicker effects (boot logo flickers for
  104. example).
  105. ywrap Same as ypan, but assumes your gfx board can wrap-around
  106. the video memory (i.e. starts reading from top if it
  107. reaches the end of video memory). Faster than ypan.
  108. redraw Scroll by redrawing the affected part of the screen, this
  109. is the safe (and slow) default.
  110. vgapal Use the standard vga registers for palette changes.
  111. This is the default.
  112. pmipal Use the protected mode interface for palette changes.
  113. mtrr:n Setup memory type range registers for the vesafb framebuffer
  114. where n:
  115. - 0 - disabled (equivalent to nomtrr) (default)
  116. - 1 - uncachable
  117. - 2 - write-back
  118. - 3 - write-combining
  119. - 4 - write-through
  120. If you see the following in dmesg, choose the type that matches the
  121. old one. In this example, use "mtrr:2".
  122. ...
  123. mtrr: type mismatch for e0000000,8000000 old: write-back new:
  124. write-combining
  125. ...
  126. nomtrr disable mtrr
  127. vremap:n
  128. Remap 'n' MiB of video RAM. If 0 or not specified, remap memory
  129. according to video mode. (2.5.66 patch/idea by Antonino Daplas
  130. reversed to give override possibility (allocate more fb memory
  131. than the kernel would) to 2.4 by tmb@iki.fi)
  132. vtotal:n If the video BIOS of your card incorrectly determines the total
  133. amount of video RAM, use this option to override the BIOS (in MiB).
  134. ========= ======================================================================
  135. Have fun!
  136. Gerd Knorr <kraxel@goldbach.in-berlin.de>
  137. Minor (mostly typo) changes
  138. by Nico Schmoigl <schmoigl@rumms.uni-mannheim.de>