xref: /openbsd-src/share/man/man4/agp.4 (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1.\" $OpenBSD: agp.4,v 1.4 2008/03/16 22:23:51 jmc Exp $
2.\" Copyright (c) Owain Ainsworth <oga@openbsd.org>
3.\"
4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.Dd $Mdocdate: March 16 2008 $
16.Dt AGP 4
17.Os
18.Sh NAME
19.Nm agp
20.Nd accelerated graphics port driver
21.Sh SYNOPSIS
22.Cd "agp* at vga?"
23.Sh DESCRIPTION
24The
25.Nm
26driver provides support for programming the AGP GART through
27.Xr ioctl 2 .
28This support is used by the X server on some architectures.
29.Pp
30The following
31.Xr ioctl 2
32operations can be performed on
33.Pa /dev/agp* ,
34and are defined in
35.Aq Pa sys/agpio.h :
36.Bl -tag -width indent
37.It Dv AGPIOC_INFO
38Returns information about the AGP subsystem.
39The result is a pointer to the following structure:
40.Bd -literal
41typedef struct _agp_info {
42	agp_version version;  /* version of driver (unused)   */
43	u_int32_t bridge_id;  /* bridge vendor/device         */
44	u_int32_t agp_mode;   /* mode info of bridge          */
45	off_t aper_base;      /* base of aperture             */
46	size_t aper_size;     /* size of aperture             */
47	size_t pg_total;      /* max pages (swap + system)    */
48	size_t pg_system;     /* max pages (system)           */
49	size_t pg_used;       /* current pages used           */
50} agp_info;
51.Ed
52.It Dv AGPIOC_ACQUIRE
53Acquire control of the AGP chipset for use by this client.
54Returns
55.Er EBUSY
56if the AGP chipset is already acquired by another client.
57.It Dv AGPIOC_RELEASE
58Release control of the AGP chipset.
59This does not unbind or free any allocated memory, which is the
60responsibility of the client to handle if necessary.
61.It Dv AGPIOC_SETUP
62Enable the AGP hardware with the relevant mode.
63This
64.Xr ioctl 2
65takes the following structure:
66.Bd -literal
67typedef struct _agp_setup {
68	u_int32_t agp_mode;   /* mode info of bridge */
69} agp_setup;
70.Ed
71.Pp
72The mode bits are defined in
73.Aq Pa sys/agpio.h .
74.It Dv AGPIOC_ALLOCATE
75Allocate physical memory suitable for mapping into the AGP aperture.
76This
77.Xr ioctl 2
78takes the following structure:
79.Bd -literal
80typedef struct _agp_allocate {
81	int key;              /* tag of allocation            */
82	size_t pg_count;      /* number of pages              */
83	u_int32_t type;       /* 0 == normal, other devspec   */
84	u_int32_t physical;   /* device specific (some devices
85			       * need a phys address of the
86			       * actual page behind the gatt
87			       * table)                       */
88} agp_allocate;
89.Ed
90.Pp
91It returns a handle to the allocated memory.
92.It Dv AGPIOC_DEALLOCATE
93Free the previously allocated memory associated with the
94handle passed.
95.It Dv AGPIOC_BIND
96Bind the allocated memory at a given offset with the AGP
97aperture.
98Returns
99.Er EINVAL
100if the memory is already bound or the offset is not at an
101AGP page boundary.
102This
103.Xr ioctl 2
104takes the following structure:
105.Bd -literal
106typedef struct _agp_bind {
107	int key;         /* tag of allocation            */
108	off_t pg_start;  /* starting page to populate    */
109} agp_bind;
110.Ed
111.Pp
112The tag of allocation is the handle returned by
113.Dv AGPIOC_ALLOCATE .
114.It Dv AGPIOC_UNBIND
115Unbind memory from the AGP aperture.
116Returns
117.Er EINVAL
118if the memory is not bound.
119This
120.Xr ioctl 2
121takes the following structure:
122.Bd -literal
123typedef struct _agp_unbind {
124	int key;                /* tag of allocation         */
125	u_int32_t priority;     /* priority for paging out   */
126} agp_unbind;
127.Ed
128.El
129.Sh FILES
130.Bl -tag -width "/dev/agpgartXXX" -compact
131.It Pa /dev/agp?
132AGP GART device special files.
133.It Pa /dev/agpgart
134AGP GART device special file.
135.El
136.Sh SEE ALSO
137.Xr ioctl 2 ,
138.Xr vga 4
139.Sh HISTORY
140The
141.Nm
142driver first appeared in
143.Fx 4.1 .
144It was adopted in
145.Nx 1.6 .
146The driver was then ported in parts to
147.Ox ,
148and fully integrated in
149.Ox 4.3 .
150