docs/50503: Upgate to the agp(4) manual page

Alex Semenyaka alexs at snark.ratmir.ru
Mon Mar 31 21:20:12 UTC 2003


>Number:         50503
>Category:       docs
>Synopsis:       Upgate to the agp(4) manual page
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 31 13:20:06 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alex Semenyaka
>Release:        FreeBSD 4.8-RC i386
>Organization:
Ratmir
>Environment:
System: FreeBSD snark.ratmir.ru 4.8-RC FreeBSD 4.8-RC #7: Sun Mar 30 07:23:48 MSD 2003 root at snark.ratmir.ru:/usr/obj/usr/src/sys/SNARK i386

>Description:

There were no descriptions of agp ioctls. I tried to provide such decriptions
on the base of the source code of AGP systems and (primarily) the comments
there.

>How-To-Repeat:

man 4 agp

>Fix:

Apply the following patch to the agp.4:

--- /usr/src/share/man/man4/agp.4	Wed Feb 26 00:38:48 2003
+++ agp.4	Tue Apr  1 01:07:55 2003
@@ -58,6 +58,99 @@
 is for running
 .Xr XFree86 1
 on the Intel i81x controllers.
+.Sh IOCTLS
+The
+.Pa /dev/agpgart
+can be opened and a few operations can be performed on it. The
+.Xr ioctl 2
+command codes below are defined in
+.Aq Pa sys/agpio.h .
+.Bl -tag -width AGPIOC_DEALLOCATE
+.It Dv AGPIOC_INFO
+.Pq Li "agp_info *"
+Returns the state of AGP system. The result is a pointer to
+the following structure:
+.Bd -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
+.Pp
+.It Dv AGPIOC_ACQUIRE
+Acquire AGP chipset for use by the kernel. Returns
+.Er EBUSY
+if the AGP chipset is already acquired by another user.
+.It Dv AGPIOC_RELEASE
+Release AGP chipset.
+.It Dv AGPIOC_SETUP
+.Pq Li "agp_setup *"
+Enable the
+.Nm
+hardware with the relevant mode. The argument is the pointer to the
+following type:
+.Bd -literal
+typedef struct _agp_setup {
+	u_int32_t agp_mode;		/* mode info of bridge          */
+} agp_setup;
+.Ed
+.Pp
+The mode bits are defined in
+.Aq Pa sys/agpio.h .
+.It Dv AGPIOC_ALLOCATE
+.Pq Li "agp_allocate *"
+Allocate physical memory suitable for mapping into the AGP aperture.
+The third argument is the pointer to the following structure:
+.Bd -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
+.Pp
+Returns the handle to the memory allocated.
+.It Dv AGPIOC_DEALLOCATE
+.Pq Li "int *"
+Free the previously allocated memory associated with the handle passed.
+.It Dv AGPIOC_BIND
+.Pq Li "agp_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 an AGP page boundary.
+The third argument is the pointer to the following structure:
+.Bd -literal
+typedef struct _agp_bind {
+	int key;		/* tag of allocation            */
+	off_t pg_start;		/* starting page to populate    */
+} agp_bind;
+.Ed
+.Pp
+The tag of allocation here means the handle returned by AGPIOC_ALLOCATE.
+.It Dv AGPIOC_UNBIND
+.Pq Li "agp_unbind *"
+Unbind memory from the AGP aperture. Return
+.Er EINVAL
+if the memory is not bound. The third argument is the pointer to the
+following structure:
+.Bd -literal
+typedef struct _agp_unbind {
+	int key;		/* tag of allocation            */
+	u_int32_t priority;	/* priority for paging out      */
+} agp_unbind;
+.Ed
+.Pp
+.El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/agpgart" -compact
 .It Pa /dev/agpgart
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list