agp.4 revision 115186
Copyright (c) 2001 Yar Tikhiy
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

$FreeBSD: head/share/man/man4/agp.4 115186 2003-05-20 22:06:43Z ru $

.Dd October 5, 2001 .Dt AGP 4 .Os .Sh NAME .Nm agp .Nd "generic interface to the Accelerated Graphics Port (AGP)" .Sh SYNOPSIS .Cd "device agp" .Sh DESCRIPTION The .Nm driver provides uniform, abstract methods for controlling the following devices: l -bullet -offset indent -compact t Ali M1541 host-to-AGP bridge t 761 not in -stable
AMD 751 and 761 host-to-AGP bridges t Intel i820, i840, i845, i850, and i860 host-to-AGP bridge t Intel i810, i810-DC100, i810E, and i815 SVGA controllers t Intel 82443GX host-to-AGP bridge t SiS 5591 host-to-AGP bridge .El

p The most common application of .Nm is for running .Xr XFree86 1 on the Intel i81x controllers. .Sh IOCTLS The following .Xr ioctl 2 operations can be performed on

a /dev/agpgart , which are defined in .Aq Pa sys/agpio.h : l -tag -width indent t Dv AGPIOC_INFO Returns state of the .Nm system. The result is a pointer to the following structure: d -literal typedef struct _agp_info { agp_version version; /* version of the driver */ 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 t 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. t 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. t Dv AGPIOC_SETUP Enable the AGP hardware with the relevant mode. This .Xr ioctl 2 takes the following structure: d -literal typedef struct _agp_setup { u_int32_t agp_mode; /* mode info of bridge */ } agp_setup; .Ed

p The mode bits are defined in .Aq Pa sys/agpio.h . t Dv AGPIOC_ALLOCATE Allocate physical memory suitable for mapping into the AGP aperture. This .Xr ioctl 2 takes the following structure: d -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

p Returns a handle to the allocated memory. t Dv AGPIOC_DEALLOCATE Free the previously allocated memory associated with the handle passed. t Dv AGPIOC_BIND Bind the allocated memory at given offset with the AGP aperture. Returns .Er EINVAL if the memory is already bound or the offset is not at AGP page boundary. This .Xr ioctl 2 takes the following structure: d -literal typedef struct _agp_bind { int key; /* tag of allocation */ off_t pg_start; /* starting page to populate */ } agp_bind; .Ed

p The tag of allocation is the handle returned by .Dv AGPIOC_ALLOCATE . t 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: d -literal typedef struct _agp_unbind { int key; /* tag of allocation */ u_int32_t priority; /* priority for paging out */ } agp_unbind; .Ed .El .Sh FILES l -tag -width ".Pa /dev/agpgart" -compact t Pa /dev/agpgart AGP device node. .El .Sh SEE ALSO .Xr XFree86 1 .Sh HISTORY The .Nm driver first appeared in .Fx 4.1 .