17d662e77SYaroslav Tykhiy.\" Copyright (c) 2001 Yar Tikhiy 27d662e77SYaroslav Tykhiy.\" All rights reserved. 37d662e77SYaroslav Tykhiy.\" 47d662e77SYaroslav Tykhiy.\" Redistribution and use in source and binary forms, with or without 57d662e77SYaroslav Tykhiy.\" modification, are permitted provided that the following conditions 67d662e77SYaroslav Tykhiy.\" are met: 77d662e77SYaroslav Tykhiy.\" 1. Redistributions of source code must retain the above copyright 87d662e77SYaroslav Tykhiy.\" notice, this list of conditions and the following disclaimer. 97d662e77SYaroslav Tykhiy.\" 2. Redistributions in binary form must reproduce the above copyright 107d662e77SYaroslav Tykhiy.\" notice, this list of conditions and the following disclaimer in the 117d662e77SYaroslav Tykhiy.\" documentation and/or other materials provided with the distribution. 127d662e77SYaroslav Tykhiy.\" 137d662e77SYaroslav Tykhiy.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 147d662e77SYaroslav Tykhiy.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 157d662e77SYaroslav Tykhiy.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 167d662e77SYaroslav Tykhiy.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 177d662e77SYaroslav Tykhiy.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 187d662e77SYaroslav Tykhiy.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 197d662e77SYaroslav Tykhiy.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 207d662e77SYaroslav Tykhiy.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 217d662e77SYaroslav Tykhiy.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 227d662e77SYaroslav Tykhiy.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 237d662e77SYaroslav Tykhiy.\" SUCH DAMAGE. 247d662e77SYaroslav Tykhiy.\" 2552b2974aSRemko Lodder.Dd November 28, 2007 267d662e77SYaroslav Tykhiy.Dt AGP 4 277d662e77SYaroslav Tykhiy.Os 287d662e77SYaroslav Tykhiy.Sh NAME 297d662e77SYaroslav Tykhiy.Nm agp 307d662e77SYaroslav Tykhiy.Nd "generic interface to the Accelerated Graphics Port (AGP)" 317d662e77SYaroslav Tykhiy.Sh SYNOPSIS 327d662e77SYaroslav Tykhiy.Cd "device agp" 33*0abe2d39SMark Johnston.Sh DEPRECATION NOTICE 34*0abe2d39SMark JohnstonThe 35*0abe2d39SMark Johnston.Nm 36*0abe2d39SMark Johnstondriver is slated to be removed in 37*0abe2d39SMark Johnston.Fx 15.0 . 387d662e77SYaroslav Tykhiy.Sh DESCRIPTION 397d662e77SYaroslav TykhiyThe 407d662e77SYaroslav Tykhiy.Nm 417d662e77SYaroslav Tykhiydriver provides uniform, abstract methods for controlling 427d662e77SYaroslav Tykhiythe following devices: 4313ae4dadSChristian Brueffer.Pp 4413ae4dadSChristian Brueffer.Bl -tag -width "NVIDIA:" -compact 4513ae4dadSChristian Brueffer.It Ali: 4613ae4dadSChristian BruefferM1541, M1621 and M1671 host to AGP bridges 4713ae4dadSChristian Brueffer.It AMD: 4813ae4dadSChristian Brueffer751, 761 and 762 host to AGP bridges 4913ae4dadSChristian Brueffer.It ATI: 5013ae4dadSChristian BruefferRS100, RS200, RS250 and RS300 AGP bridges 5113ae4dadSChristian Brueffer.It Intel: 5213ae4dadSChristian Bruefferi820, i840, i845, i850, and i860 host to AGP bridges 5313ae4dadSChristian Brueffer.It Intel: 5452b2974aSRemko Lodderi810, i810-DC100, i810E, i815, 830M, 845G, 845M, 852GM, 852GME, 855GM, 855GME, 865G, 915G and 915GM SVGA controllers 5513ae4dadSChristian Brueffer.It Intel: 56431fe15dSChristian Brueffer82443BX, 82443GX, 82443LX, 82815, 82820, 82830, 82840, 82845, 82845G, 82850, 82855, 82855GM, 82860, 82865, 82875P, E7205 and E7505 host to AGP bridges 5713ae4dadSChristian Brueffer.It NVIDIA: 5813ae4dadSChristian BrueffernForce and nForce2 AGP controllers 5913ae4dadSChristian Brueffer.It SiS: 6013ae4dadSChristian Brueffer530, 540, 550, 620, 630, 645, 645DX, 648, 650, 651, 655, 661, 730, 735, 740, 741, 745, 746, 760 and 5591 host to AGP bridges 6113ae4dadSChristian Brueffer.It VIA: 6213ae4dadSChristian Brueffer3296, 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 637d662e77SYaroslav Tykhiy.El 647d662e77SYaroslav Tykhiy.Pp 657d662e77SYaroslav TykhiyThe most common application of 667d662e77SYaroslav Tykhiy.Nm 677d662e77SYaroslav Tykhiyis for running 689356efa8SJens Schweikhardt.Xr X 7 Pq Pa ports/x11/xorg-docs 697d662e77SYaroslav Tykhiyon the Intel i81x controllers. 70b46845a9SHiten Pandya.Sh IOCTLS 71b46845a9SHiten PandyaThe following 72b46845a9SHiten Pandya.Xr ioctl 2 73b46845a9SHiten Pandyaoperations can be performed on 74b46845a9SHiten Pandya.Pa /dev/agpgart , 75b46845a9SHiten Pandyawhich are defined in 76fe08efe6SRuslan Ermilov.In sys/agpio.h : 775ab9b7efSRuslan Ermilov.Bl -tag -width indent 785ab9b7efSRuslan Ermilov.It Dv AGPIOC_INFO 79b46845a9SHiten PandyaReturns state of the 80b46845a9SHiten Pandya.Nm 81b46845a9SHiten Pandyasystem. 82b46845a9SHiten PandyaThe result is a pointer to the following structure: 83b46845a9SHiten Pandya.Bd -literal 84b46845a9SHiten Pandyatypedef struct _agp_info { 85b46845a9SHiten Pandya agp_version version; /* version of the driver */ 866b99842aSEd Schouten uint32_t bridge_id; /* bridge vendor/device */ 876b99842aSEd Schouten uint32_t agp_mode; /* mode info of bridge */ 88b46845a9SHiten Pandya off_t aper_base; /* base of aperture */ 89b46845a9SHiten Pandya size_t aper_size; /* size of aperture */ 90b46845a9SHiten Pandya size_t pg_total; /* max pages (swap + system) */ 91b46845a9SHiten Pandya size_t pg_system; /* max pages (system) */ 92b46845a9SHiten Pandya size_t pg_used; /* current pages used */ 93b46845a9SHiten Pandya} agp_info; 94b46845a9SHiten Pandya.Ed 955ab9b7efSRuslan Ermilov.It Dv AGPIOC_ACQUIRE 96b46845a9SHiten PandyaAcquire control of the AGP chipset for use by this client. 97b46845a9SHiten PandyaReturns 98b46845a9SHiten Pandya.Er EBUSY 99b46845a9SHiten Pandyaif the AGP chipset is already acquired by another client. 1005ab9b7efSRuslan Ermilov.It Dv AGPIOC_RELEASE 101b46845a9SHiten PandyaRelease control of the AGP chipset. 102b46845a9SHiten PandyaThis does not unbind or free any allocated memory, which is the 103b46845a9SHiten Pandyaresponsibility of the client to handle if necessary. 1045ab9b7efSRuslan Ermilov.It Dv AGPIOC_SETUP 105b46845a9SHiten PandyaEnable the AGP hardware with the relevant mode. 106b46845a9SHiten PandyaThis 107b46845a9SHiten Pandya.Xr ioctl 2 108b46845a9SHiten Pandyatakes the following structure: 109b46845a9SHiten Pandya.Bd -literal 110b46845a9SHiten Pandyatypedef struct _agp_setup { 1116b99842aSEd Schouten uint32_t agp_mode; /* mode info of bridge */ 112b46845a9SHiten Pandya} agp_setup; 113b46845a9SHiten Pandya.Ed 114b46845a9SHiten Pandya.Pp 115b46845a9SHiten PandyaThe mode bits are defined in 116fe08efe6SRuslan Ermilov.In sys/agpio.h . 1175ab9b7efSRuslan Ermilov.It Dv AGPIOC_ALLOCATE 118b46845a9SHiten PandyaAllocate physical memory suitable for mapping into the AGP aperture. 119b46845a9SHiten PandyaThis 120b46845a9SHiten Pandya.Xr ioctl 2 121b46845a9SHiten Pandyatakes the following structure: 122b46845a9SHiten Pandya.Bd -literal 123b46845a9SHiten Pandyatypedef struct _agp_allocate { 124b46845a9SHiten Pandya int key; /* tag of allocation */ 125b46845a9SHiten Pandya size_t pg_count; /* number of pages */ 1266b99842aSEd Schouten uint32_t type; /* 0 == normal, other devspec */ 1276b99842aSEd Schouten uint32_t physical; /* device specific (some devices 128b46845a9SHiten Pandya * need a phys address of the 129b46845a9SHiten Pandya * actual page behind the gatt 130b46845a9SHiten Pandya * table) */ 131b46845a9SHiten Pandya} agp_allocate; 132b46845a9SHiten Pandya.Ed 133b46845a9SHiten Pandya.Pp 134b46845a9SHiten PandyaReturns a handle to the allocated memory. 1355ab9b7efSRuslan Ermilov.It Dv AGPIOC_DEALLOCATE 136b46845a9SHiten PandyaFree the previously allocated memory associated with the handle passed. 1375ab9b7efSRuslan Ermilov.It Dv AGPIOC_BIND 138b46845a9SHiten PandyaBind the allocated memory at given offset with the AGP aperture. 139b46845a9SHiten PandyaReturns 140b46845a9SHiten Pandya.Er EINVAL 141b46845a9SHiten Pandyaif the memory is already bound or the offset is not at AGP page boundary. 142b46845a9SHiten PandyaThis 143b46845a9SHiten Pandya.Xr ioctl 2 144b46845a9SHiten Pandyatakes the following structure: 145b46845a9SHiten Pandya.Bd -literal 146b46845a9SHiten Pandyatypedef struct _agp_bind { 147b46845a9SHiten Pandya int key; /* tag of allocation */ 148b46845a9SHiten Pandya off_t pg_start; /* starting page to populate */ 149b46845a9SHiten Pandya} agp_bind; 150b46845a9SHiten Pandya.Ed 151b46845a9SHiten Pandya.Pp 1525ab9b7efSRuslan ErmilovThe tag of allocation is the handle returned by 153b46845a9SHiten Pandya.Dv AGPIOC_ALLOCATE . 1545ab9b7efSRuslan Ermilov.It Dv AGPIOC_UNBIND 155b46845a9SHiten PandyaUnbind memory from the AGP aperture. 156b46845a9SHiten PandyaReturns 157b46845a9SHiten Pandya.Er EINVAL 158b46845a9SHiten Pandyaif the memory is not bound. 159b46845a9SHiten PandyaThis 1605ab9b7efSRuslan Ermilov.Xr ioctl 2 161b46845a9SHiten Pandyatakes the following structure: 162b46845a9SHiten Pandya.Bd -literal 163b46845a9SHiten Pandyatypedef struct _agp_unbind { 164b46845a9SHiten Pandya int key; /* tag of allocation */ 1656b99842aSEd Schouten uint32_t priority; /* priority for paging out */ 166b46845a9SHiten Pandya} agp_unbind; 167b46845a9SHiten Pandya.Ed 1685ab9b7efSRuslan Ermilov.El 1697d662e77SYaroslav Tykhiy.Sh FILES 1707d662e77SYaroslav Tykhiy.Bl -tag -width ".Pa /dev/agpgart" -compact 1717d662e77SYaroslav Tykhiy.It Pa /dev/agpgart 1723a10201fSYaroslav TykhiyAGP device node. 1737d662e77SYaroslav Tykhiy.El 1747d662e77SYaroslav Tykhiy.Sh SEE ALSO 175f0ea72a0SChristian Brueffer.Xr X 7 Pq Pa ports/x11/xorg 1767d662e77SYaroslav Tykhiy.Sh HISTORY 1777d662e77SYaroslav TykhiyThe 1787d662e77SYaroslav Tykhiy.Nm 1797d662e77SYaroslav Tykhiydriver first appeared in 1807d662e77SYaroslav Tykhiy.Fx 4.1 . 181