xref: /freebsd/share/man/man4/agp.4 (revision 38a52bd3)
1.\" Copyright (c) 2001 Yar Tikhiy
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd November 28, 2007
28.Dt AGP 4
29.Os
30.Sh NAME
31.Nm agp
32.Nd "generic interface to the Accelerated Graphics Port (AGP)"
33.Sh SYNOPSIS
34.Cd "device agp"
35.Sh DESCRIPTION
36The
37.Nm
38driver provides uniform, abstract methods for controlling
39the following devices:
40.Pp
41.Bl -tag -width "NVIDIA:" -compact
42.It Ali:
43M1541, M1621 and M1671 host to AGP bridges
44.It AMD:
45751, 761 and 762 host to AGP bridges
46.It ATI:
47RS100, RS200, RS250 and RS300 AGP bridges
48.It Intel:
49i820, i840, i845, i850, and i860 host to AGP bridges
50.It Intel:
51i810, i810-DC100, i810E, i815, 830M, 845G, 845M, 852GM, 852GME, 855GM, 855GME, 865G, 915G and 915GM SVGA controllers
52.It Intel:
5382443BX, 82443GX, 82443LX, 82815, 82820, 82830, 82840, 82845, 82845G, 82850, 82855, 82855GM, 82860, 82865, 82875P, E7205 and E7505 host to AGP bridges
54.It NVIDIA:
55nForce and nForce2 AGP controllers
56.It SiS:
57530, 540, 550, 620, 630, 645, 645DX, 648, 650, 651, 655, 661, 730, 735, 740, 741, 745, 746, 760 and 5591 host to AGP bridges
58.It VIA:
593296, 82C597, 82C598, 82C691, 82C694X, 82C8363, 8235, 8237, 8361, 8367, 8371, 8377, 8501, 8601, 862x, 8633, 8653, 8703, 8753, 8754, 8763, 8783, KT880, PM800, PM880, PN800, PN880, PT880, XM266 and XN266 host to PCI bridges
60.El
61.Pp
62The most common application of
63.Nm
64is for running
65.Xr X 7 Pq Pa ports/x11/xorg-docs
66on the Intel i81x controllers.
67.Sh IOCTLS
68The following
69.Xr ioctl 2
70operations can be performed on
71.Pa /dev/agpgart ,
72which are defined in
73.In sys/agpio.h :
74.Bl -tag -width indent
75.It Dv AGPIOC_INFO
76Returns state of the
77.Nm
78system.
79The result is a pointer to the following structure:
80.Bd -literal
81typedef struct _agp_info {
82	agp_version version;  /* version of the driver        */
83	uint32_t bridge_id;   /* bridge vendor/device         */
84	uint32_t agp_mode;    /* mode info of bridge          */
85	off_t aper_base;      /* base of aperture             */
86	size_t aper_size;     /* size of aperture             */
87	size_t pg_total;      /* max pages (swap + system)    */
88	size_t pg_system;     /* max pages (system)           */
89	size_t pg_used;       /* current pages used           */
90} agp_info;
91.Ed
92.It Dv AGPIOC_ACQUIRE
93Acquire control of the AGP chipset for use by this client.
94Returns
95.Er EBUSY
96if the AGP chipset is already acquired by another client.
97.It Dv AGPIOC_RELEASE
98Release control of the AGP chipset.
99This does not unbind or free any allocated memory, which is the
100responsibility of the client to handle if necessary.
101.It Dv AGPIOC_SETUP
102Enable the AGP hardware with the relevant mode.
103This
104.Xr ioctl 2
105takes the following structure:
106.Bd -literal
107typedef struct _agp_setup {
108	uint32_t agp_mode;    /* mode info of bridge */
109} agp_setup;
110.Ed
111.Pp
112The mode bits are defined in
113.In sys/agpio.h .
114.It Dv AGPIOC_ALLOCATE
115Allocate physical memory suitable for mapping into the AGP aperture.
116This
117.Xr ioctl 2
118takes the following structure:
119.Bd -literal
120typedef struct _agp_allocate {
121	int key;              /* tag of allocation            */
122	size_t pg_count;      /* number of pages              */
123	uint32_t type;        /* 0 == normal, other devspec   */
124	uint32_t physical;    /* device specific (some devices
125			       * need a phys address of the
126			       * actual page behind the gatt
127			       * table)                       */
128} agp_allocate;
129.Ed
130.Pp
131Returns a handle to the allocated memory.
132.It Dv AGPIOC_DEALLOCATE
133Free the previously allocated memory associated with the handle passed.
134.It Dv AGPIOC_BIND
135Bind the allocated memory at given offset with the AGP aperture.
136Returns
137.Er EINVAL
138if the memory is already bound or the offset is not at AGP page boundary.
139This
140.Xr ioctl 2
141takes the following structure:
142.Bd -literal
143typedef struct _agp_bind {
144	int key;         /* tag of allocation            */
145	off_t pg_start;  /* starting page to populate    */
146} agp_bind;
147.Ed
148.Pp
149The tag of allocation is the handle returned by
150.Dv AGPIOC_ALLOCATE .
151.It Dv AGPIOC_UNBIND
152Unbind memory from the AGP aperture.
153Returns
154.Er EINVAL
155if the memory is not bound.
156This
157.Xr ioctl 2
158takes the following structure:
159.Bd -literal
160typedef struct _agp_unbind {
161	int key;                /* tag of allocation         */
162	uint32_t priority;      /* priority for paging out   */
163} agp_unbind;
164.Ed
165.El
166.Sh FILES
167.Bl -tag -width ".Pa /dev/agpgart" -compact
168.It Pa /dev/agpgart
169AGP device node.
170.El
171.Sh SEE ALSO
172.Xr X 7 Pq Pa ports/x11/xorg
173.Sh HISTORY
174The
175.Nm
176driver first appeared in
177.Fx 4.1 .
178