summaryrefslogtreecommitdiff
path: root/share/man/man4/agp.4
blob: b945113fdc66ecd069291276601f447c7b2ae125 (plain)
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
.\" $OpenBSD: agp.4,v 1.4 2008/03/16 22:23:51 jmc Exp $
.\" Copyright (c) Owain Ainsworth <oga@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.Dd $Mdocdate: March 16 2008 $
.Dt AGP 4
.Os
.Sh NAME
.Nm agp
.Nd accelerated graphics port driver
.Sh SYNOPSIS
.Cd "agp* at vga?"
.Sh DESCRIPTION
The
.Nm
driver provides support for programming the AGP GART through
.Xr ioctl 2 .
This support is used by the X server on some architectures.
.Pp
The following
.Xr ioctl 2
operations can be performed on
.Pa /dev/agp* ,
and are defined in
.Aq Pa 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
.Aq Pa 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
It 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 a given offset with the AGP
aperture.
Returns
.Er EINVAL
if the memory is already bound or the offset is not at an
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 FILES
.Bl -tag -width "/dev/agpgartXXX" -compact
.It Pa /dev/agp?
AGP GART device special files.
.It Pa /dev/agpgart
AGP GART device special file.
.El
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr vga 4
.Sh HISTORY
The
.Nm
driver first appeared in
.Fx 4.1 .
It was adopted in
.Nx 1.6 .
The driver was then ported in parts to
.Ox ,
and fully integrated in
.Ox 4.3 .