]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/vga
vga, vesa: scaling modes
[plan9front.git] / sys / man / 3 / vga
1 .TH VGA 3 
2 .SH NAME
3 vga \- VGA controller device
4 .SH SYNOPSIS
5 .nf
6 .B bind #v /dev
7
8 .B /dev/vgabios
9 .B /dev/vgactl
10 .B /dev/vgaovl
11 .B /dev/vgaovlctl
12 .fi
13 .SH DESCRIPTION
14 The VGA device allows configuration of a graphics controller
15 on a PC.
16 .B Vgactl
17 allows control over higher-level settings such as display height, width, depth,
18 controller and hardware-cursor type.
19 Along with the I/O-port registers
20 provided by
21 .IR arch (3),
22 it is used to implement configuration and setup of VGA controller cards.
23 This is usually performed by
24 .IR vga (8).
25 .PP
26 .B Vgabios
27 provides read-only access to the low 640kB of memory,
28 where the VGA and other BIOS ROMs are located.
29 .PP
30 Writing strings to 
31 .B vgactl
32 configures the VGA device.
33 The following are valid commands.
34 .TP
35 .BI size " X" x Y x "Z chan"
36 Set the size of the screen image to be
37 .I X 
38 pixels wide
39 and
40 .I Y 
41 pixels high.
42 Each pixel is 
43 .I Z 
44 bits as specified by 
45 .IR chan ,
46 whose format is described in
47 .IR image (6).
48 .TP
49 .BI actualsize " X" x Y
50 Set the physical size of the display to be
51 .I X
52 pixels wide by
53 .I Y 
54 pixels high.
55 This message is optional;
56 it is used to implement panning and to accommodate
57 displays that require the in-memory screen image
58 to have certain alignment properties.
59 For example, a 1400x1050 screen with a 1408x1050 in-memory image
60 will use 
61 .B "size 1408x1050
62 but
63 .BR "actualsize 1400x1050" .
64 .TP
65 .BI panning " mode"
66 Depending on whether
67 .I mode
68 is 
69 .B on
70 or
71 .BR off ,
72 enable or disable panning in a virtual screen.
73 If panning is on and the screen's
74 .B size
75 is larger than its
76 .BR actualsize ,
77 the displayed portion of the screen will pan to follow the mouse.
78 Setting the panning mode after the first attach of the
79 .B #i
80 driver has no effect.
81 .TP
82 .BI type " ctlr"
83 Set the type of VGA controller being used.
84 .I Ctlr
85 is one of 
86 .BR ark200pv ,
87 .BR clgd542x ,
88 .BR clgd546x ,
89 .BR ct65545 ,
90 .BR cyber938x ,
91 .BR hiqvideo ,
92 .BR mach64xx ,
93 .BR mga2164w ,
94 .BR neomagic ,
95 .BR nvidia ,
96 .BR s3 ,
97 and
98 .BR t2r4 .
99 .IP
100 Note that this list does not indicate the full set of VGA chips
101 supported. For example,
102 .B s3
103 includes the 86C801/5, 86C928, Vision864, and Vision964.
104 It is the job of
105 .IR vga (8)
106 to recognize which particular chip is being used and to initialize it
107 appropriately.
108 .TP
109 .BI hwgc " gc"
110 Set the type of hardware graphics cursor being used.
111 .I Gc
112 is one of
113 .BR ark200pvhwgc ,
114 .BR bt485hwgc ,
115 .BR clgd542xhwgc ,
116 .BR clgd546xhwgc ,
117 .BR ct65545hwgc ,
118 .BR cyber938xhwgc ,
119 .BR hiqvideohwgc ,
120 .BR mach64xxhwgc ,
121 .BR mga2164whwgc ,
122 .BR neomagichwgc ,
123 .BR nvidiahwgc ,
124 .BR rgb524hwgc ,
125 .BR s3hwgc ,
126 .BR t2r4hwgc ,
127 .BR tvp3020hwgc ,
128 and
129 .BR tvp3026hwgc .
130 A value of
131 .B off
132 disables the cursor.
133 There is no software cursor.
134 .TP
135 .BI palettedepth " d"
136 Set the number of bits of precision used by the 
137 VGA palette to 
138 .IR d ,
139 which must be either 
140 .B 6
141 or
142 .BR 8 .
143 .TP
144 .B blank
145 Blank the screen.
146 This consists of setting the hardware
147 color map to all black as well as, on some controllers, setting the
148 VGA hsync and vsync signals so as to turn off
149 VESA DPMS-compliant monitors.
150 The screen also blanks after 30 minutes of inactivity.
151 The screen can be unblanked by moving the mouse.
152 .TP
153 .BI blanktime " minutes"
154 Set the timeout before the
155 screen blanks; the default is 30 minutes.
156 If
157 .I minutes
158 is zero, blanking is disabled.
159 .TP
160 .BI hwaccel " mode"
161 Depending on whether
162 .I mode
163 is 
164 .B on
165 or
166 .BR off ,
167 enable or disable whether hardware acceleration
168 (currently for rectangle filling and moving)
169 used by the graphics engine.
170 The default setting is
171 .BR on .
172 .TP
173 .BI softscreen " mode"
174 Depending on whether
175 .I mode
176 is 
177 .B on
178 or
179 .BR off ,
180 enable or disable shadow framebuffer to reduce
181 slow bus reads. Enabling
182 .BI softscreen
183 disables hardware acceleration. The default setting is
184 .BR off
185 except for the
186 .BR vesa
187 driver. 
188 .TP
189 .BI hwblank " mode"
190 Depending on whether
191 .I mode
192 is
193 .B on
194 or
195 .BR off ,
196 enable or disable the use of DPMS blanking
197 (see
198 .B blank
199 above).
200 .TP
201 .BI scaling " mode"
202 Set the GPU scaling
203 .I mode
204 to
205 .BR off ,
206 .B full
207 or
208 .B aspect
209 to either disable scaling, scale to full screen, or
210 to scale while preserving aspect ratio.
211 .TP
212 .BI linear " size align"
213 Use a linear screen aperture of size
214 .I size
215 aligned on an
216 .IR align -byte
217 boundary.
218 .TP
219 .B drawinit
220 Initialize the graphics hardware.
221 This must be sent after setting the
222 .BR type .
223 .PP
224 Reading
225 .B vgactl
226 returns the current settings, one per line.
227 .PP
228 Some VGA cards support overlay graphics.
229 Writing strings to
230 .B vgaovlctl
231 configures such cards.
232 The following are valid overlay control commands:
233 .TP
234 .BI openctl
235 opens the overlay device.
236 .TP
237 .BI configure " w h format"
238 allocates resources inside the driver to support an overlay area
239 of width
240 .I w
241 and height
242 .I h
243 pixels.  Currently, the only supported
244 .I format
245 is
246 .B YUYV
247 packed.
248 In
249 .B YUYV
250 two pixels are encoded by their separate Y values
251 and their combined U and V values.
252 The size of the two pixels is 32 bits.
253 .TP
254 .BI enable " x y w h"
255 enables drawing data on the display through the overlay mode.  The data
256 is drawn at position
257 .IR x , y
258 and has a width and height of
259 .IR w , h
260 respectively.
261 .TP
262 .BI closectl
263 terminates overlay control.
264 .PP
265 Overlay data can be written to
266 .BR vgaovl .
267 .SH EXAMPLES
268 The following disables hardware acceleration.
269 .IP
270 .EX
271 echo hwaccel off > /dev/vgactl
272 .EE
273 .SH SOURCE
274 .B /sys/src/9/pc/devvga.c
275 .SH SEE ALSO
276 .IR arch (3),
277 .IR vga (8)
278 .SH BUGS
279 The hardware graphics cursor on the
280 .B et4000
281 does not work in 2x8-bit mode.