xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/svga.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. include:: <isonum.txt>
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun=================================
4*4882a593SmuzhiyunVideo Mode Selection Support 2.13
5*4882a593Smuzhiyun=================================
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun:Copyright: |copy| 1995--1999 Martin Mares, <mj@ucw.cz>
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunIntro
10*4882a593Smuzhiyun~~~~~
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThis small document describes the "Video Mode Selection" feature which
13*4882a593Smuzhiyunallows the use of various special video modes supported by the video BIOS. Due
14*4882a593Smuzhiyunto usage of the BIOS, the selection is limited to boot time (before the
15*4882a593Smuzhiyunkernel decompression starts) and works only on 80X86 machines that are
16*4882a593Smuzhiyunbooted through BIOS firmware (as opposed to through UEFI, kexec, etc.).
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun.. note::
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun   Short intro for the impatient: Just use vga=ask for the first time,
21*4882a593Smuzhiyun   enter ``scan`` on the video mode prompt, pick the mode you want to use,
22*4882a593Smuzhiyun   remember its mode ID (the four-digit hexadecimal number) and then
23*4882a593Smuzhiyun   set the vga parameter to this number (converted to decimal first).
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunThe video mode to be used is selected by a kernel parameter which can be
26*4882a593Smuzhiyunspecified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
27*4882a593Smuzhiyunoption of LILO (or some other boot loader you use) or by the "xrandr" utility
28*4882a593Smuzhiyun(present in standard Linux utility packages). You can use the following values
29*4882a593Smuzhiyunof this parameter::
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun   NORMAL_VGA - Standard 80x25 mode available on all display adapters.
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun   EXTENDED_VGA	- Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA.
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun   ASK_VGA - Display a video mode menu upon startup (see below).
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun   0..35 - Menu item number (when you have used the menu to view the list of
38*4882a593Smuzhiyun      modes available on your adapter, you can specify the menu item you want
39*4882a593Smuzhiyun      to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the
40*4882a593Smuzhiyun      mode list displayed may vary as the kernel version changes, because the
41*4882a593Smuzhiyun      modes are listed in a "first detected -- first displayed" manner. It's
42*4882a593Smuzhiyun      better to use absolute mode numbers instead.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun   0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
45*4882a593Smuzhiyun      for exact meaning of the ID). Warning: LILO doesn't support
46*4882a593Smuzhiyun      hexadecimal numbers -- you have to convert it to decimal manually.
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunMenu
49*4882a593Smuzhiyun~~~~
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunThe ASK_VGA mode causes the kernel to offer a video mode menu upon
52*4882a593Smuzhiyunbootup. It displays a "Press <RETURN> to see video modes available, <SPACE>
53*4882a593Smuzhiyunto continue or wait 30 secs" message. If you press <RETURN>, you enter the
54*4882a593Smuzhiyunmenu, if you press <SPACE> or wait 30 seconds, the kernel will boot up in
55*4882a593Smuzhiyunthe standard 80x25 mode.
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunThe menu looks like::
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun	Video adapter: <name-of-detected-video-adapter>
60*4882a593Smuzhiyun	Mode:    COLSxROWS:
61*4882a593Smuzhiyun	0  0F00  80x25
62*4882a593Smuzhiyun	1  0F01  80x50
63*4882a593Smuzhiyun	2  0F02  80x43
64*4882a593Smuzhiyun	3  0F03  80x26
65*4882a593Smuzhiyun	....
66*4882a593Smuzhiyun	Enter mode number or ``scan``: <flashing-cursor-here>
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun<name-of-detected-video-adapter> tells what video adapter did Linux detect
69*4882a593Smuzhiyun-- it's either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA
70*4882a593Smuzhiyunwith VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection
71*4882a593Smuzhiyunof chipsets is turned off by default as it's inherently unreliable due to
72*4882a593Smuzhiyunabsolutely insane PC design.
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun"0  0F00  80x25" means that the first menu item (the menu items are numbered
75*4882a593Smuzhiyunfrom "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the
76*4882a593Smuzhiyunnext section for a description of mode IDs).
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun<flashing-cursor-here> encourages you to enter the item number or mode ID
79*4882a593Smuzhiyunyou wish to set and press <RETURN>. If the computer complains something about
80*4882a593Smuzhiyun"Unknown mode ID", it is trying to tell you that it isn't possible to set such
81*4882a593Smuzhiyuna mode. It's also possible to press only <RETURN> which leaves the current mode.
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunThe mode list usually contains a few basic modes and some VESA modes.  In
84*4882a593Smuzhiyuncase your chipset has been detected, some chipset-specific modes are shown as
85*4882a593Smuzhiyunwell (some of these might be missing or unusable on your machine as different
86*4882a593SmuzhiyunBIOSes are often shipped with the same card and the mode numbers depend purely
87*4882a593Smuzhiyunon the VGA BIOS).
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunThe modes displayed on the menu are partially sorted: The list starts with
90*4882a593Smuzhiyunthe standard modes (80x25 and 80x50) followed by "special" modes (80x28 and
91*4882a593Smuzhiyun80x43), local modes (if the local modes feature is enabled), VESA modes and
92*4882a593Smuzhiyunfinally SVGA modes for the auto-detected adapter.
93*4882a593Smuzhiyun
94*4882a593SmuzhiyunIf you are not happy with the mode list offered (e.g., if you think your card
95*4882a593Smuzhiyunis able to do more), you can enter "scan" instead of item number / mode ID.  The
96*4882a593Smuzhiyunprogram will try to ask the BIOS for all possible video mode numbers and test
97*4882a593Smuzhiyunwhat happens then. The screen will be probably flashing wildly for some time and
98*4882a593Smuzhiyunstrange noises will be heard from inside the monitor and so on and then, really
99*4882a593Smuzhiyunall consistent video modes supported by your BIOS will appear (plus maybe some
100*4882a593Smuzhiyun``ghost modes``). If you are afraid this could damage your monitor, don't use
101*4882a593Smuzhiyunthis function.
102*4882a593Smuzhiyun
103*4882a593SmuzhiyunAfter scanning, the mode ordering is a bit different: the auto-detected SVGA
104*4882a593Smuzhiyunmodes are not listed at all and the modes revealed by ``scan`` are shown before
105*4882a593Smuzhiyunall VESA modes.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunMode IDs
108*4882a593Smuzhiyun~~~~~~~~
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunBecause of the complexity of all the video stuff, the video mode IDs
111*4882a593Smuzhiyunused here are also a bit complex. A video mode ID is a 16-bit number usually
112*4882a593Smuzhiyunexpressed in a hexadecimal notation (starting with "0x"). You can set a mode
113*4882a593Smuzhiyunby entering its mode directly if you know it even if it isn't shown on the menu.
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunThe ID numbers can be divided to those regions::
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun   0x0000 to 0x00ff - menu item references. 0x0000 is the first item. Don't use
118*4882a593Smuzhiyun	outside the menu as this can change from boot to boot (especially if you
119*4882a593Smuzhiyun	have used the ``scan`` feature).
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun   0x0100 to 0x017f - standard BIOS modes. The ID is a BIOS video mode number
122*4882a593Smuzhiyun	(as presented to INT 10, function 00) increased by 0x0100.
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun   0x0200 to 0x08ff - VESA BIOS modes. The ID is a VESA mode ID increased by
125*4882a593Smuzhiyun	0x0100. All VESA modes should be autodetected and shown on the menu.
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun   0x0900 to 0x09ff - Video7 special modes. Set by calling INT 0x10, AX=0x6f05.
128*4882a593Smuzhiyun	(Usually 940=80x43, 941=132x25, 942=132x44, 943=80x60, 944=100x60,
129*4882a593Smuzhiyun	945=132x28 for the standard Video7 BIOS)
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun   0x0f00 to 0x0fff - special modes (they are set by various tricks -- usually
132*4882a593Smuzhiyun	by modifying one of the standard modes). Currently available:
133*4882a593Smuzhiyun	0x0f00	standard 80x25, don't reset mode if already set (=FFFF)
134*4882a593Smuzhiyun	0x0f01	standard with 8-point font: 80x43 on EGA, 80x50 on VGA
135*4882a593Smuzhiyun	0x0f02	VGA 80x43 (VGA switched to 350 scanlines with a 8-point font)
136*4882a593Smuzhiyun	0x0f03	VGA 80x28 (standard VGA scans, but 14-point font)
137*4882a593Smuzhiyun	0x0f04	leave current video mode
138*4882a593Smuzhiyun	0x0f05	VGA 80x30 (480 scans, 16-point font)
139*4882a593Smuzhiyun	0x0f06	VGA 80x34 (480 scans, 14-point font)
140*4882a593Smuzhiyun	0x0f07	VGA 80x60 (480 scans, 8-point font)
141*4882a593Smuzhiyun	0x0f08	Graphics hack (see the VIDEO_GFX_HACK paragraph below)
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun   0x1000 to 0x7fff - modes specified by resolution. The code has a "0xRRCC"
144*4882a593Smuzhiyun	form where RR is a number of rows and CC is a number of columns.
145*4882a593Smuzhiyun	E.g., 0x1950 corresponds to a 80x25 mode, 0x2b84 to 132x43 etc.
146*4882a593Smuzhiyun	This is the only fully portable way to refer to a non-standard mode,
147*4882a593Smuzhiyun	but it relies on the mode being found and displayed on the menu
148*4882a593Smuzhiyun	(remember that mode scanning is not done automatically).
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun   0xff00 to 0xffff - aliases for backward compatibility:
151*4882a593Smuzhiyun	0xffff	equivalent to 0x0f00 (standard 80x25)
152*4882a593Smuzhiyun	0xfffe	equivalent to 0x0f01 (EGA 80x43 or VGA 80x50)
153*4882a593Smuzhiyun
154*4882a593SmuzhiyunIf you add 0x8000 to the mode ID, the program will try to recalculate
155*4882a593Smuzhiyunvertical display timing according to mode parameters, which can be used to
156*4882a593Smuzhiyuneliminate some annoying bugs of certain VGA BIOSes (usually those used for
157*4882a593Smuzhiyuncards with S3 chipsets and old Cirrus Logic BIOSes) -- mainly extra lines at the
158*4882a593Smuzhiyunend of the display.
159*4882a593Smuzhiyun
160*4882a593SmuzhiyunOptions
161*4882a593Smuzhiyun~~~~~~~
162*4882a593Smuzhiyun
163*4882a593SmuzhiyunBuild options for arch/x86/boot/* are selected by the kernel kconfig
164*4882a593Smuzhiyunutility and the kernel .config file.
165*4882a593Smuzhiyun
166*4882a593SmuzhiyunVIDEO_GFX_HACK - includes special hack for setting of graphics modes
167*4882a593Smuzhiyunto be used later by special drivers.
168*4882a593SmuzhiyunAllows to set _any_ BIOS mode including graphic ones and forcing specific
169*4882a593Smuzhiyuntext screen resolution instead of peeking it from BIOS variables. Don't use
170*4882a593Smuzhiyununless you think you know what you're doing. To activate this setup, use
171*4882a593Smuzhiyunmode number 0x0f08 (see the Mode IDs section above).
172*4882a593Smuzhiyun
173*4882a593SmuzhiyunStill doesn't work?
174*4882a593Smuzhiyun~~~~~~~~~~~~~~~~~~~
175*4882a593Smuzhiyun
176*4882a593SmuzhiyunWhen the mode detection doesn't work (e.g., the mode list is incorrect or
177*4882a593Smuzhiyunthe machine hangs instead of displaying the menu), try to switch off some of
178*4882a593Smuzhiyunthe configuration options listed under "Options". If it fails, you can still use
179*4882a593Smuzhiyunyour kernel with the video mode set directly via the kernel parameter.
180*4882a593Smuzhiyun
181*4882a593SmuzhiyunIn either case, please send me a bug report containing what _exactly_
182*4882a593Smuzhiyunhappens and how do the configuration switches affect the behaviour of the bug.
183*4882a593Smuzhiyun
184*4882a593SmuzhiyunIf you start Linux from M$-DOS, you might also use some DOS tools for
185*4882a593Smuzhiyunvideo mode setting. In this case, you must specify the 0x0f04 mode ("leave
186*4882a593Smuzhiyuncurrent settings") to Linux, because if you don't and you use any non-standard
187*4882a593Smuzhiyunmode, Linux will switch to 80x25 automatically.
188*4882a593Smuzhiyun
189*4882a593SmuzhiyunIf you set some extended mode and there's one or more extra lines on the
190*4882a593Smuzhiyunbottom of the display containing already scrolled-out text, your VGA BIOS
191*4882a593Smuzhiyuncontains the most common video BIOS bug called "incorrect vertical display
192*4882a593Smuzhiyunend setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately,
193*4882a593Smuzhiyunthis must be done manually -- no autodetection mechanisms are available.
194*4882a593Smuzhiyun
195*4882a593SmuzhiyunHistory
196*4882a593Smuzhiyun~~~~~~~
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun=============== ================================================================
199*4882a593Smuzhiyun1.0 (??-Nov-95)	First version supporting all adapters supported by the old
200*4882a593Smuzhiyun		setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels
201*4882a593Smuzhiyun		and then removed due to instability on some machines.
202*4882a593Smuzhiyun2.0 (28-Jan-96)	Rewritten from scratch. Cirrus Logic 64XX support added, almost
203*4882a593Smuzhiyun		everything is configurable, the VESA support should be much more
204*4882a593Smuzhiyun		stable, explicit mode numbering allowed, "scan" implemented etc.
205*4882a593Smuzhiyun2.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution
206*4882a593Smuzhiyun		supported. Few bugs fixed. VESA modes are listed prior to
207*4882a593Smuzhiyun		modes supplied by SVGA autodetection as they are more reliable.
208*4882a593Smuzhiyun		CLGD autodetect works better. Doesn't depend on 80x25 being
209*4882a593Smuzhiyun		active when started. Scanning fixed. 80x43 (any VGA) added.
210*4882a593Smuzhiyun		Code cleaned up.
211*4882a593Smuzhiyun2.2 (01-Feb-96)	EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX
212*4882a593Smuzhiyun		VESA modes work now). Display end bug workaround supported.
213*4882a593Smuzhiyun		Special modes renumbered to allow adding of the "recalculate"
214*4882a593Smuzhiyun		flag, 0xffff and 0xfffe became aliases instead of real IDs.
215*4882a593Smuzhiyun		Screen contents retained during mode changes.
216*4882a593Smuzhiyun2.3 (15-Mar-96)	Changed to work with 1.3.74 kernel.
217*4882a593Smuzhiyun2.4 (18-Mar-96)	Added patches by Hans Lermen fixing a memory overwrite problem
218*4882a593Smuzhiyun		with some boot loaders. Memory management rewritten to reflect
219*4882a593Smuzhiyun		these changes. Unfortunately, screen contents retaining works
220*4882a593Smuzhiyun		only with some loaders now.
221*4882a593Smuzhiyun		Added a Tseng 132x60 mode.
222*4882a593Smuzhiyun2.5 (19-Mar-96)	Fixed a VESA mode scanning bug introduced in 2.4.
223*4882a593Smuzhiyun2.6 (25-Mar-96)	Some VESA BIOS errors not reported -- it fixes error reports on
224*4882a593Smuzhiyun		several cards with broken VESA code (e.g., ATI VGA).
225*4882a593Smuzhiyun2.7 (09-Apr-96)	- Accepted all VESA modes in range 0x100 to 0x7ff, because some
226*4882a593Smuzhiyun		  cards use very strange mode numbers.
227*4882a593Smuzhiyun		- Added Realtek VGA modes (thanks to Gonzalo Tornaria).
228*4882a593Smuzhiyun		- Hardware testing order slightly changed, tests based on ROM
229*4882a593Smuzhiyun		  contents done as first.
230*4882a593Smuzhiyun		- Added support for special Video7 mode switching functions
231*4882a593Smuzhiyun		  (thanks to Tom Vander Aa).
232*4882a593Smuzhiyun		- Added 480-scanline modes (especially useful for notebooks,
233*4882a593Smuzhiyun		  original version written by hhanemaa@cs.ruu.nl, patched by
234*4882a593Smuzhiyun		  Jeff Chua, rewritten by me).
235*4882a593Smuzhiyun		- Screen store/restore fixed.
236*4882a593Smuzhiyun2.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA.
237*4882a593Smuzhiyun		- Better recognition of text modes during mode scan.
238*4882a593Smuzhiyun2.9 (12-May-96)	- Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!)
239*4882a593Smuzhiyun2.10(11-Nov-96) - The whole thing made optional.
240*4882a593Smuzhiyun		- Added the CONFIG_VIDEO_400_HACK switch.
241*4882a593Smuzhiyun		- Added the CONFIG_VIDEO_GFX_HACK switch.
242*4882a593Smuzhiyun		- Code cleanup.
243*4882a593Smuzhiyun2.11(03-May-97) - Yet another cleanup, now including also the documentation.
244*4882a593Smuzhiyun		- Direct testing of SVGA adapters turned off by default, ``scan``
245*4882a593Smuzhiyun		  offered explicitly on the prompt line.
246*4882a593Smuzhiyun		- Removed the doc section describing adding of new probing
247*4882a593Smuzhiyun		  functions as I try to get rid of _all_ hardware probing here.
248*4882a593Smuzhiyun2.12(25-May-98) Added support for VESA frame buffer graphics.
249*4882a593Smuzhiyun2.13(14-May-99) Minor documentation fixes.
250*4882a593Smuzhiyun=============== ================================================================
251