Blame view

Documentation/svga.txt 14.1 KB
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
1
  .. include:: <isonum.txt>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2

aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
3
4
5
6
7
8
9
10
11
12
  =================================
  Video Mode Selection Support 2.13
  =================================
  
  :Copyright: |copy| 1995--1999 Martin Mares, <mj@ucw.cz>
  
  Intro
  ~~~~~
  
  This small document describes the "Video Mode Selection" feature which
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
14
15
  allows the use of various special video modes supported by the video BIOS. Due
  to usage of the BIOS, the selection is limited to boot time (before the
  kernel decompression starts) and works only on 80X86 machines.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
16
  .. note::
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
17

aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
18
19
20
21
22
23
     Short intro for the impatient: Just use vga=ask for the first time,
     enter ``scan`` on the video mode prompt, pick the mode you want to use,
     remember its mode ID (the four-digit hexadecimal number) and then
     set the vga parameter to this number (converted to decimal first).
  
  The video mode to be used is selected by a kernel parameter which can be
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
24
25
26
  specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
  option of LILO (or some other boot loader you use) or by the "vidmode" utility
  (present in standard Linux utility packages). You can use the following values
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
27
  of this parameter::
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  
     NORMAL_VGA - Standard 80x25 mode available on all display adapters.
  
     EXTENDED_VGA	- Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA.
  
     ASK_VGA - Display a video mode menu upon startup (see below).
  
     0..35 - Menu item number (when you have used the menu to view the list of
        modes available on your adapter, you can specify the menu item you want
        to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the
        mode list displayed may vary as the kernel version changes, because the
        modes are listed in a "first detected -- first displayed" manner. It's
        better to use absolute mode numbers instead.
  
     0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
        for exact meaning of the ID). Warning: rdev and LILO don't support
        hexadecimal numbers -- you have to convert it to decimal manually.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
45
46
47
48
  Menu
  ~~~~
  
  The ASK_VGA mode causes the kernel to offer a video mode menu upon
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
49
50
51
52
  bootup. It displays a "Press <RETURN> to see video modes available, <SPACE>
  to continue or wait 30 secs" message. If you press <RETURN>, you enter the
  menu, if you press <SPACE> or wait 30 seconds, the kernel will boot up in
  the standard 80x25 mode.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
53
  The menu looks like::
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
54

aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
55
56
57
58
59
60
61
62
  	Video adapter: <name-of-detected-video-adapter>
  	Mode:    COLSxROWS:
  	0  0F00  80x25
  	1  0F01  80x50
  	2  0F02  80x43
  	3  0F03  80x26
  	....
  	Enter mode number or ``scan``: <flashing-cursor-here>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
63

aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
64
  <name-of-detected-video-adapter> tells what video adapter did Linux detect
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
65
66
67
68
69
  -- it's either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA
  with VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection
  of chipsets is turned off by default (see CONFIG_VIDEO_SVGA in chapter 4 to see
  how to enable it if you really want) as it's inherently unreliable due to
  absolutely insane PC design.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
70
  "0  0F00  80x25" means that the first menu item (the menu items are numbered
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
71
72
  from "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the
  next section for a description of mode IDs).
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
73
  <flashing-cursor-here> encourages you to enter the item number or mode ID
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
75
76
  you wish to set and press <RETURN>. If the computer complains something about
  "Unknown mode ID", it is trying to tell you that it isn't possible to set such
  a mode. It's also possible to press only <RETURN> which leaves the current mode.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
77
  The mode list usually contains a few basic modes and some VESA modes.  In
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
78
79
80
81
  case your chipset has been detected, some chipset-specific modes are shown as
  well (some of these might be missing or unusable on your machine as different
  BIOSes are often shipped with the same card and the mode numbers depend purely
  on the VGA BIOS).
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
82
  The modes displayed on the menu are partially sorted: The list starts with
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
83
84
85
  the standard modes (80x25 and 80x50) followed by "special" modes (80x28 and
  80x43), local modes (if the local modes feature is enabled), VESA modes and
  finally SVGA modes for the auto-detected adapter.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
86
  If you are not happy with the mode list offered (e.g., if you think your card
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
87
88
89
90
91
  is able to do more), you can enter "scan" instead of item number / mode ID.  The
  program will try to ask the BIOS for all possible video mode numbers and test
  what happens then. The screen will be probably flashing wildly for some time and
  strange noises will be heard from inside the monitor and so on and then, really
  all consistent video modes supported by your BIOS will appear (plus maybe some
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
92
93
  ``ghost modes``). If you are afraid this could damage your monitor, don't use
  this function.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
94

aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
95
96
  After scanning, the mode ordering is a bit different: the auto-detected SVGA
  modes are not listed at all and the modes revealed by ``scan`` are shown before
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
97
  all VESA modes.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
98
99
100
101
  Mode IDs
  ~~~~~~~~
  
  Because of the complexity of all the video stuff, the video mode IDs
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102
103
104
  used here are also a bit complex. A video mode ID is a 16-bit number usually
  expressed in a hexadecimal notation (starting with "0x"). You can set a mode
  by entering its mode directly if you know it even if it isn't shown on the menu.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
105
  The ID numbers can be divided to those regions::
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
106
107
108
  
     0x0000 to 0x00ff - menu item references. 0x0000 is the first item. Don't use
  	outside the menu as this can change from boot to boot (especially if you
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
109
  	have used the ``scan`` feature).
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
  
     0x0100 to 0x017f - standard BIOS modes. The ID is a BIOS video mode number
  	(as presented to INT 10, function 00) increased by 0x0100.
  
     0x0200 to 0x08ff - VESA BIOS modes. The ID is a VESA mode ID increased by
  	0x0100. All VESA modes should be autodetected and shown on the menu.
  
     0x0900 to 0x09ff - Video7 special modes. Set by calling INT 0x10, AX=0x6f05.
  	(Usually 940=80x43, 941=132x25, 942=132x44, 943=80x60, 944=100x60,
  	945=132x28 for the standard Video7 BIOS)
  
     0x0f00 to 0x0fff - special modes (they are set by various tricks -- usually
  	by modifying one of the standard modes). Currently available:
  	0x0f00	standard 80x25, don't reset mode if already set (=FFFF)
  	0x0f01	standard with 8-point font: 80x43 on EGA, 80x50 on VGA
  	0x0f02	VGA 80x43 (VGA switched to 350 scanlines with a 8-point font)
  	0x0f03	VGA 80x28 (standard VGA scans, but 14-point font)
  	0x0f04	leave current video mode
  	0x0f05	VGA 80x30 (480 scans, 16-point font)
  	0x0f06	VGA 80x34 (480 scans, 14-point font)
  	0x0f07	VGA 80x60 (480 scans, 8-point font)
  	0x0f08	Graphics hack (see the CONFIG_VIDEO_HACK paragraph below)
  
     0x1000 to 0x7fff - modes specified by resolution. The code has a "0xRRCC"
  	form where RR is a number of rows and CC is a number of columns.
  	E.g., 0x1950 corresponds to a 80x25 mode, 0x2b84 to 132x43 etc.
  	This is the only fully portable way to refer to a non-standard mode,
  	but it relies on the mode being found and displayed on the menu
  	(remember that mode scanning is not done automatically).
  
     0xff00 to 0xffff - aliases for backward compatibility:
  	0xffff	equivalent to 0x0f00 (standard 80x25)
  	0xfffe	equivalent to 0x0f01 (EGA 80x43 or VGA 80x50)
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
143
  If you add 0x8000 to the mode ID, the program will try to recalculate
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
144
145
146
147
  vertical display timing according to mode parameters, which can be used to
  eliminate some annoying bugs of certain VGA BIOSes (usually those used for
  cards with S3 chipsets and old Cirrus Logic BIOSes) -- mainly extra lines at the
  end of the display.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
148
149
150
151
  Options
  ~~~~~~~
  
  Some options can be set in the source text (in arch/i386/boot/video.S).
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
152
153
  All of them are simple #define's -- change them to #undef's when you want to
  switch them off. Currently supported:
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
154
  CONFIG_VIDEO_SVGA - enables autodetection of SVGA cards. This is switched
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
155
  off by default as it's a bit unreliable due to terribly bad PC design. If you
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
156
  really want to have the adapter autodetected (maybe in case the ``scan`` feature
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
157
158
159
  doesn't work on your machine), switch this on and don't cry if the results
  are not completely sane. In case you really need this feature, please drop me
  a mail as I think of removing it some day.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
160
  CONFIG_VIDEO_VESA - enables autodetection of VESA modes. If it doesn't work
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
161
162
  on your machine (or displays a "Error: Scanning of VESA modes failed" message),
  you can switch it off and report as a bug.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
163
  CONFIG_VIDEO_COMPACT - enables compacting of the video mode list. If there
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
164
165
166
167
  are more modes with the same screen size, only the first one is kept (see above
  for more info on mode ordering). However, in very strange cases it's possible
  that the first "version" of the mode doesn't work although some of the others
  do -- in this case turn this switch off to see the rest.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
168
  CONFIG_VIDEO_RETAIN - enables retaining of screen contents when switching
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
169
170
171
  video modes. Works only with some boot loaders which leave enough room for the
  buffer. (If you have old LILO, you can adjust heap_end_ptr and loadflags
  in setup.S, but it's better to upgrade the boot loader...)
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
172
  CONFIG_VIDEO_LOCAL - enables inclusion of "local modes" in the list. The
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
173
174
175
176
177
  local modes are added automatically to the beginning of the list not depending
  on hardware configuration. The local modes are listed in the source text after
  the "local_mode_table:" line. The comment before this line describes the format
  of the table (which also includes a video card name to be displayed on the
  top of the menu).
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
178
  CONFIG_VIDEO_400_HACK - force setting of 400 scan lines for standard VGA
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
179
180
181
  modes. This option is intended to be used on certain buggy BIOSes which draw
  some useless logo using font download and then fail to reset the correct mode.
  Don't use unless needed as it forces resetting the video card.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
182
  CONFIG_VIDEO_GFX_HACK - includes special hack for setting of graphics modes
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
183
184
185
186
187
188
  to be used later by special drivers (e.g., 800x600 on IBM ThinkPad -- see
  ftp://ftp.phys.keio.ac.jp/pub/XFree86/800x600/XF86Configs/XF86Config.IBM_TP560).
  Allows to set _any_ BIOS mode including graphic ones and forcing specific
  text screen resolution instead of peeking it from BIOS variables. Don't use
  unless you think you know what you're doing. To activate this setup, use
  mode number 0x0f08 (see section 3).
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
189
190
191
192
  Still doesn't work?
  ~~~~~~~~~~~~~~~~~~~
  
  When the mode detection doesn't work (e.g., the mode list is incorrect or
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
193
194
195
  the machine hangs instead of displaying the menu), try to switch off some of
  the configuration options listed in section 4. If it fails, you can still use
  your kernel with the video mode set directly via the kernel parameter.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
196
  In either case, please send me a bug report containing what _exactly_
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
197
  happens and how do the configuration switches affect the behaviour of the bug.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
198
  If you start Linux from M$-DOS, you might also use some DOS tools for
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
199
200
201
  video mode setting. In this case, you must specify the 0x0f04 mode ("leave
  current settings") to Linux, because if you don't and you use any non-standard
  mode, Linux will switch to 80x25 automatically.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
202
  If you set some extended mode and there's one or more extra lines on the
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
203
204
205
206
  bottom of the display containing already scrolled-out text, your VGA BIOS
  contains the most common video BIOS bug called "incorrect vertical display
  end setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately,
  this must be done manually -- no autodetection mechanisms are available.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
207
  If you have a VGA card and your display still looks as on EGA, your BIOS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
208
209
  is probably broken and you need to set the CONFIG_VIDEO_400_HACK switch to
  force setting of the correct mode.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
210
211
212
213
  History
  ~~~~~~~
  
  =============== ================================================================
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
  1.0 (??-Nov-95)	First version supporting all adapters supported by the old
  		setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels
  		and then removed due to instability on some machines.
  2.0 (28-Jan-96)	Rewritten from scratch. Cirrus Logic 64XX support added, almost
  		everything is configurable, the VESA support should be much more
  		stable, explicit mode numbering allowed, "scan" implemented etc.
  2.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution
  		supported. Few bugs fixed. VESA modes are listed prior to
  		modes supplied by SVGA autodetection as they are more reliable.
  		CLGD autodetect works better. Doesn't depend on 80x25 being
  		active when started. Scanning fixed. 80x43 (any VGA) added.
  		Code cleaned up.
  2.2 (01-Feb-96)	EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX
  		VESA modes work now). Display end bug workaround supported.
  		Special modes renumbered to allow adding of the "recalculate"
  		flag, 0xffff and 0xfffe became aliases instead of real IDs.
  		Screen contents retained during mode changes.
  2.3 (15-Mar-96)	Changed to work with 1.3.74 kernel.
  2.4 (18-Mar-96)	Added patches by Hans Lermen fixing a memory overwrite problem
  		with some boot loaders. Memory management rewritten to reflect
  		these changes. Unfortunately, screen contents retaining works
  		only with some loaders now.
  		Added a Tseng 132x60 mode.
  2.5 (19-Mar-96)	Fixed a VESA mode scanning bug introduced in 2.4.
  2.6 (25-Mar-96)	Some VESA BIOS errors not reported -- it fixes error reports on
  		several cards with broken VESA code (e.g., ATI VGA).
  2.7 (09-Apr-96)	- Accepted all VESA modes in range 0x100 to 0x7ff, because some
  		  cards use very strange mode numbers.
  		- Added Realtek VGA modes (thanks to Gonzalo Tornaria).
  		- Hardware testing order slightly changed, tests based on ROM
  		  contents done as first.
  		- Added support for special Video7 mode switching functions
  		  (thanks to Tom Vander Aa).
  		- Added 480-scanline modes (especially useful for notebooks,
  		  original version written by hhanemaa@cs.ruu.nl, patched by
  		  Jeff Chua, rewritten by me).
  		- Screen store/restore fixed.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
251
  2.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
252
253
  		- Better recognition of text modes during mode scan.
  2.9 (12-May-96)	- Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!)
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
254
  2.10(11-Nov-96) - The whole thing made optional.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
255
256
257
  		- Added the CONFIG_VIDEO_400_HACK switch.
  		- Added the CONFIG_VIDEO_GFX_HACK switch.
  		- Code cleanup.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
258
259
  2.11(03-May-97) - Yet another cleanup, now including also the documentation.
  		- Direct testing of SVGA adapters turned off by default, ``scan``
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
260
261
262
  		  offered explicitly on the prompt line.
  		- Removed the doc section describing adding of new probing
  		  functions as I try to get rid of _all_ hardware probing here.
aa4d52035   Mauro Carvalho Chehab   svga.txt: standar...
263
264
265
  2.12(25-May-98) Added support for VESA frame buffer graphics.
  2.13(14-May-99) Minor documentation fixes.
  =============== ================================================================