From owner-freebsd-doc@FreeBSD.ORG Mon Mar 31 13:20:09 2003 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3E2137B405 for ; Mon, 31 Mar 2003 13:20:09 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA76B43FAF for ; Mon, 31 Mar 2003 13:20:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h2VLK6Up046344 for ; Mon, 31 Mar 2003 13:20:06 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h2VLK6tf046343; Mon, 31 Mar 2003 13:20:06 -0800 (PST) Resent-Date: Mon, 31 Mar 2003 13:20:06 -0800 (PST) Resent-Message-Id: <200303312120.h2VLK6tf046343@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Semenyaka Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8440737B405 for ; Mon, 31 Mar 2003 13:11:01 -0800 (PST) Received: from snark.ratmir.ru (snark.ratmir.ru [213.24.248.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35B8243FB1 for ; Mon, 31 Mar 2003 13:11:00 -0800 (PST) (envelope-from alexs@snark.ratmir.ru) Received: from snark.ratmir.ru (alexs@localhost [127.0.0.1]) by snark.ratmir.ru (8.12.9/8.12.9) with ESMTP id h2VLAwDR057796 for ; Tue, 1 Apr 2003 01:10:58 +0400 (MSD) (envelope-from alexs@snark.ratmir.ru) Received: (from alexs@localhost) by snark.ratmir.ru (8.12.9/8.12.9/Submit) id h2VLAwWO057795; Tue, 1 Apr 2003 01:10:58 +0400 (MSD) Message-Id: <200303312110.h2VLAwWO057795@snark.ratmir.ru> Date: Tue, 1 Apr 2003 01:10:58 +0400 (MSD) From: Alex Semenyaka To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/50503: Upgate to the agp(4) manual page X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alex Semenyaka List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2003 21:20:12 -0000 >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@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: