xref: /freebsd/share/man/man4/agp.4 (revision 96190b4fef3b4a0cc3ca0606b0c4e3e69a5e6717)
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.Dd November 28, 2007
26.Dt AGP 4
27.Os
28.Sh NAME
29.Nm agp
30.Nd "generic interface to the Accelerated Graphics Port (AGP)"
31.Sh SYNOPSIS
32.Cd "device agp"
33.Sh DEPRECATION NOTICE
34The
35.Nm
36driver is slated to be removed in
37.Fx 15.0 .
38.Sh DESCRIPTION
39The
40.Nm
41driver provides uniform, abstract methods for controlling
42the following devices:
43.Pp
44.Bl -tag -width "NVIDIA:" -compact
45.It Ali:
46M1541, M1621 and M1671 host to AGP bridges
47.It AMD:
48751, 761 and 762 host to AGP bridges
49.It ATI:
50RS100, RS200, RS250 and RS300 AGP bridges
51.It Intel:
52i820, i840, i845, i850, and i860 host to AGP bridges
53.It Intel:
54i810, i810-DC100, i810E, i815, 830M, 845G, 845M, 852GM, 852GME, 855GM, 855GME, 865G, 915G and 915GM SVGA controllers
55.It Intel:
5682443BX, 82443GX, 82443LX, 82815, 82820, 82830, 82840, 82845, 82845G, 82850, 82855, 82855GM, 82860, 82865, 82875P, E7205 and E7505 host to AGP bridges
57.It NVIDIA:
58nForce and nForce2 AGP controllers
59.It SiS:
60530, 540, 550, 620, 630, 645, 645DX, 648, 650, 651, 655, 661, 730, 735, 740, 741, 745, 746, 760 and 5591 host to AGP bridges
61.It VIA:
623296, 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
63.El
64.Pp
65The most common application of
66.Nm
67is for running
68.Xr X 7 Pq Pa ports/x11/xorg-docs
69on the Intel i81x controllers.
70.Sh IOCTLS
71The following
72.Xr ioctl 2
73operations can be performed on
74.Pa /dev/agpgart ,
75which are defined in
76.In sys/agpio.h :
77.Bl -tag -width indent
78.It Dv AGPIOC_INFO
79Returns state of the
80.Nm
81system.
82The result is a pointer to the following structure:
83.Bd -literal
84typedef struct _agp_info {
85	agp_version version;  /* version of the driver        */
86	uint32_t bridge_id;   /* bridge vendor/device         */
87	uint32_t agp_mode;    /* mode info of bridge          */
88	off_t aper_base;      /* base of aperture             */
89	size_t aper_size;     /* size of aperture             */
90	size_t pg_total;      /* max pages (swap + system)    */
91	size_t pg_system;     /* max pages (system)           */
92	size_t pg_used;       /* current pages used           */
93} agp_info;
94.Ed
95.It Dv AGPIOC_ACQUIRE
96Acquire control of the AGP chipset for use by this client.
97Returns
98.Er EBUSY
99if the AGP chipset is already acquired by another client.
100.It Dv AGPIOC_RELEASE
101Release control of the AGP chipset.
102This does not unbind or free any allocated memory, which is the
103responsibility of the client to handle if necessary.
104.It Dv AGPIOC_SETUP
105Enable the AGP hardware with the relevant mode.
106This
107.Xr ioctl 2
108takes the following structure:
109.Bd -literal
110typedef struct _agp_setup {
111	uint32_t agp_mode;    /* mode info of bridge */
112} agp_setup;
113.Ed
114.Pp
115The mode bits are defined in
116.In sys/agpio.h .
117.It Dv AGPIOC_ALLOCATE
118Allocate physical memory suitable for mapping into the AGP aperture.
119This
120.Xr ioctl 2
121takes the following structure:
122.Bd -literal
123typedef struct _agp_allocate {
124	int key;              /* tag of allocation            */
125	size_t pg_count;      /* number of pages              */
126	uint32_t type;        /* 0 == normal, other devspec   */
127	uint32_t physical;    /* device specific (some devices
128			       * need a phys address of the
129			       * actual page behind the gatt
130			       * table)                       */
131} agp_allocate;
132.Ed
133.Pp
134Returns a handle to the allocated memory.
135.It Dv AGPIOC_DEALLOCATE
136Free the previously allocated memory associated with the handle passed.
137.It Dv AGPIOC_BIND
138Bind the allocated memory at given offset with the AGP aperture.
139Returns
140.Er EINVAL
141if the memory is already bound or the offset is not at AGP page boundary.
142This
143.Xr ioctl 2
144takes the following structure:
145.Bd -literal
146typedef struct _agp_bind {
147	int key;         /* tag of allocation            */
148	off_t pg_start;  /* starting page to populate    */
149} agp_bind;
150.Ed
151.Pp
152The tag of allocation is the handle returned by
153.Dv AGPIOC_ALLOCATE .
154.It Dv AGPIOC_UNBIND
155Unbind memory from the AGP aperture.
156Returns
157.Er EINVAL
158if the memory is not bound.
159This
160.Xr ioctl 2
161takes the following structure:
162.Bd -literal
163typedef struct _agp_unbind {
164	int key;                /* tag of allocation         */
165	uint32_t priority;      /* priority for paging out   */
166} agp_unbind;
167.Ed
168.El
169.Sh FILES
170.Bl -tag -width ".Pa /dev/agpgart" -compact
171.It Pa /dev/agpgart
172AGP device node.
173.El
174.Sh SEE ALSO
175.Xr X 7 Pq Pa ports/x11/xorg
176.Sh HISTORY
177The
178.Nm
179driver first appeared in
180.Fx 4.1 .
181