xref: /freebsd/share/man/man4/agp.4 (revision c98323078dede7579020518ec84cdcb478e5c142)
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 October 5, 2001
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.Bl -bullet -offset indent -compact
41.It
42Ali M1541 host-to-AGP bridge
43.It
44.\" 761 not in -stable
45AMD 751 and 761 host-to-AGP bridges
46.It
47Intel i820, i840, i845, i850, and i860 host-to-AGP bridge
48.It
49Intel i810, i810-DC100, i810E, and i815 SVGA controllers
50.It
51Intel 82443GX host-to-AGP bridge
52.It
53SiS 5591 host-to-AGP bridge
54.El
55.Pp
56The most common application of
57.Nm
58is for running
59.Xr XFree86 1
60on the Intel i81x controllers.
61.Sh IOCTLS
62The following
63.Xr ioctl 2
64operations can be performed on
65.Pa /dev/agpgart ,
66which are defined in
67.In sys/agpio.h :
68.Bl -tag -width indent
69.It Dv AGPIOC_INFO
70Returns state of the
71.Nm
72system.
73The result is a pointer to the following structure:
74.Bd -literal
75typedef struct _agp_info {
76	agp_version version;  /* version of the driver        */
77	u_int32_t bridge_id;  /* bridge vendor/device         */
78	u_int32_t agp_mode;   /* mode info of bridge          */
79	off_t aper_base;      /* base of aperture             */
80	size_t aper_size;     /* size of aperture             */
81	size_t pg_total;      /* max pages (swap + system)    */
82	size_t pg_system;     /* max pages (system)           */
83	size_t pg_used;       /* current pages used           */
84} agp_info;
85.Ed
86.It Dv AGPIOC_ACQUIRE
87Acquire control of the AGP chipset for use by this client.
88Returns
89.Er EBUSY
90if the AGP chipset is already acquired by another client.
91.It Dv AGPIOC_RELEASE
92Release control of the AGP chipset.
93This does not unbind or free any allocated memory, which is the
94responsibility of the client to handle if necessary.
95.It Dv AGPIOC_SETUP
96Enable the AGP hardware with the relevant mode.
97This
98.Xr ioctl 2
99takes the following structure:
100.Bd -literal
101typedef struct _agp_setup {
102	u_int32_t agp_mode;   /* mode info of bridge */
103} agp_setup;
104.Ed
105.Pp
106The mode bits are defined in
107.In sys/agpio.h .
108.It Dv AGPIOC_ALLOCATE
109Allocate physical memory suitable for mapping into the AGP aperture.
110This
111.Xr ioctl 2
112takes the following structure:
113.Bd -literal
114typedef struct _agp_allocate {
115	int key;              /* tag of allocation            */
116	size_t pg_count;      /* number of pages              */
117	u_int32_t type;       /* 0 == normal, other devspec   */
118	u_int32_t physical;   /* device specific (some devices
119			       * need a phys address of the
120			       * actual page behind the gatt
121			       * table)                       */
122} agp_allocate;
123.Ed
124.Pp
125Returns a handle to the allocated memory.
126.It Dv AGPIOC_DEALLOCATE
127Free the previously allocated memory associated with the handle passed.
128.It Dv AGPIOC_BIND
129Bind the allocated memory at given offset with the AGP aperture.
130Returns
131.Er EINVAL
132if the memory is already bound or the offset is not at AGP page boundary.
133This
134.Xr ioctl 2
135takes the following structure:
136.Bd -literal
137typedef struct _agp_bind {
138	int key;         /* tag of allocation            */
139	off_t pg_start;  /* starting page to populate    */
140} agp_bind;
141.Ed
142.Pp
143The tag of allocation is the handle returned by
144.Dv AGPIOC_ALLOCATE .
145.It Dv AGPIOC_UNBIND
146Unbind memory from the AGP aperture.
147Returns
148.Er EINVAL
149if the memory is not bound.
150This
151.Xr ioctl 2
152takes the following structure:
153.Bd -literal
154typedef struct _agp_unbind {
155	int key;                /* tag of allocation         */
156	u_int32_t priority;     /* priority for paging out   */
157} agp_unbind;
158.Ed
159.El
160.Sh FILES
161.Bl -tag -width ".Pa /dev/agpgart" -compact
162.It Pa /dev/agpgart
163AGP device node.
164.El
165.Sh SEE ALSO
166.Xr XFree86 1
167.Sh HISTORY
168The
169.Nm
170driver first appeared in
171.Fx 4.1 .
172