1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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
|
.\" $OpenBSD: vga.4,v 1.11 2006/03/16 21:24:33 dim Exp $
.\" $NetBSD: vga.4,v 1.2.4.1 2000/08/09 07:48:40 drochner Exp $
.\"
.\" Copyright (c) 1999, 2000
.\" Matthias Drochner. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd March 20, 1999
.Dt VGA 4
.Os
.Sh NAME
.Nm vga
.Nd VGA graphics driver for wscons
.Sh SYNOPSIS
.Cd "vga0 at isa?"
.Cd "vga* at pci?"
.Cd "wsdisplay* at vga?"
.Cd "option PCIAGP"
.Sh DESCRIPTION
This driver handles VGA graphics hardware within the
.Xr wscons 4
console framework.
It doesn't provide direct device driver entry points but makes its
functions available via the internal
.Xr wsdisplay 4
interface.
.Pp
The
.Nm
driver supports multiple virtual screens on one physical display.
The screens allocated on one display can be of different
.Dq types ,
where a type refers to various display properties.
The type is determined at the time the virtual screen is created and can't
be changed later.
Screens are either created at kernel startup (then the default type is used)
or later with help of the
.Xr wsconscfg 8
utility.
.Pp
Currently, the following screen types are supported:
.Bl -hang
.It 80x25
This is the standard VGA text mode with 80 columns and 25 rows.
16 different colors can be displayed at the same time.
Characters are 8 x 16 pixels large, and a font consists of 256 characters.
A built-in font of this size is always present on a VGA card.
It's also possible to use a downloaded font instead.
.It 80x25bf
A modified version of the previous.
It only allows 8 colors to be displayed.
In exchange, it can access two fonts at the same time, so that 512
different characters can be displayed.
.It 80x40
A text mode with 80 columns and 40 rows.
Similar to the standard mode, 16 colors and 256 characters are available.
Characters are 8 x 10 pixels large.
For this mode to be useful, a font of that character size must be downloaded.
.It 80x40bf
A modified version of the previous.
It only allows 8 colors to be displayed.
In exchange, it can access two fonts at the same time, so that 512
different characters can be displayed.
.It 80x50
A text mode with 80 columns and 50 rows.
Similar to the standard mode, 16 colors and 256 characters are available.
Characters are 8 x 8 pixels large.
For this mode to be useful, a font of that character size must be downloaded.
.It 80x50bf
A modified version of the previous.
It only allows 8 colors to be displayed.
In exchange, it can access two fonts at the same time, so that 512
different characters can be displayed.
.It 80x24
A variant of the
.Dq 80x25
screen type which displays 24 lines only.
It uses the standard 8x16 VGA font.
This mode might be useful for applications which depend on closer
DEC VT100 compatibility.
.It 80x24bf
A modified version of the previous.
It only allows 8 colors to be displayed.
In exchange, it can access two fonts at the same time, so that 512
different characters can be displayed.
.El
.Pp
The
.Nm
driver can display fonts of the original IBM type and ISO-8859-1 encoded fonts.
As an experimental feature, the
.Dq higher half
fonts of the former
.Ox Ns /i386
pcvt driver distribution can be used too if
.Ic option WSCONS_SUPPORT_PCVTFONTS
was set at kernel compile time.
This is only useful with the
.Dq *bf
screen types; a font containing the ASCII
range of characters must be available too on this screen.
.Pp
.Sh AGP SUPPORT
.Ic option PCIAGP
enables support for programming the AGP GART through
.Xr ioctl 2 ,
which is used by
.Xr Xorg 1
on some architectures.
.Pp
The following
.Xr ioctl 2
operations can be performed on
.Pa /dev/ttyC0 ,
which are defined in
.In sys/agpio.h :
.Bl -tag -width indent
.It Dv AGPIOC_INFO
Returns information about the AGP subsystem.
The result is a pointer to the following structure:
.Bd -literal
typedef struct _agp_info {
agp_version version; /* version of driver (unused) */
u_int32_t bridge_id; /* bridge vendor/device */
u_int32_t agp_mode; /* mode info of bridge */
off_t aper_base; /* base of aperture */
size_t aper_size; /* size of aperture */
size_t pg_total; /* max pages (swap + system) */
size_t pg_system; /* max pages (system) */
size_t pg_used; /* current pages used */
} agp_info;
.Ed
.It Dv AGPIOC_ACQUIRE
Acquire control of the AGP chipset for use by this client.
Returns
.Er EBUSY
if the AGP chipset is already acquired by another client.
.It Dv AGPIOC_RELEASE
Release control of the AGP chipset.
This does not unbind or free any allocated memory, which is the
responsibility of the client to handle if necessary.
.It Dv AGPIOC_SETUP
Enable the AGP hardware with the relevant mode.
This
.Xr ioctl 2
takes the following structure:
.Bd -literal
typedef struct _agp_setup {
u_int32_t agp_mode; /* mode info of bridge */
} agp_setup;
.Ed
.Pp
The mode bits are defined in
.In sys/agpio.h .
.It Dv AGPIOC_ALLOCATE
Allocate physical memory suitable for mapping into the AGP aperture.
This
.Xr ioctl 2
takes the following structure:
.Bd -literal
typedef struct _agp_allocate {
int key; /* tag of allocation */
size_t pg_count; /* number of pages */
u_int32_t type; /* 0 == normal, other devspec */
u_int32_t physical; /* device specific (some devices
* need a phys address of the
* actual page behind the gatt
* table) */
} agp_allocate;
.Ed
.Pp
Returns a handle to the allocated memory.
.It Dv AGPIOC_DEALLOCATE
Free the previously allocated memory associated with the handle passed.
.It Dv AGPIOC_BIND
Bind the allocated memory at given offset with the AGP aperture.
Returns
.Er EINVAL
if the memory is already bound or the offset is not at AGP page boundary.
This
.Xr ioctl 2
takes the following structure:
.Bd -literal
typedef struct _agp_bind {
int key; /* tag of allocation */
off_t pg_start; /* starting page to populate */
} agp_bind;
.Ed
.Pp
The tag of allocation is the handle returned by
.Dv AGPIOC_ALLOCATE .
.It Dv AGPIOC_UNBIND
Unbind memory from the AGP aperture.
Returns
.Er EINVAL
if the memory is not bound.
This
.Xr ioctl 2
takes the following structure:
.Bd -literal
typedef struct _agp_unbind {
int key; /* tag of allocation */
u_int32_t priority; /* priority for paging out */
} agp_unbind;
.Ed
.El
.Sh SEE ALSO
.Xr intro 4 ,
.Xr isa 4 ,
.Xr pcdisplay 4 ,
.Xr pci 4 ,
.Xr wscons 4 ,
.Xr wsdisplay 4 ,
.Xr wsconscfg 8 ,
.Xr wsfontload 8 ,
.Xr ioctl 2
.Sh BUGS
Only a subset of the possible text modes is supported.
.Pp
VGA cards are supposed to emulate an MDA if a monochrome display is connected.
In this case, the device will naturally not support colors at all, but
offer the capability to display underlined characters instead.
The
.Dq 80x25bf ,
.Dq 80x40bf ,
.Dq 80x50bf ,
and
.Dq 80x24bf
screen types will not be available.
This mode of operation is not tested.
|