|
Lines 58-63
Link Here
|
| 58 |
is for running |
58 |
is for running |
| 59 |
.Xr XFree86 1 |
59 |
.Xr XFree86 1 |
| 60 |
on the Intel i81x controllers. |
60 |
on the Intel i81x controllers. |
|
|
61 |
.Sh IOCTLS |
| 62 |
The |
| 63 |
.Pa /dev/agpgart |
| 64 |
can be opened and a few operations can be performed on it. The |
| 65 |
.Xr ioctl 2 |
| 66 |
command codes below are defined in |
| 67 |
.Aq Pa sys/agpio.h . |
| 68 |
.Bl -tag -width AGPIOC_DEALLOCATE |
| 69 |
.It Dv AGPIOC_INFO |
| 70 |
.Pq Li "agp_info *" |
| 71 |
Returns the state of AGP system. The result is a pointer to |
| 72 |
the following structure: |
| 73 |
.Bd -literal |
| 74 |
typedef struct _agp_info { |
| 75 |
agp_version version; /* version of the driver */ |
| 76 |
u_int32_t bridge_id; /* bridge vendor/device */ |
| 77 |
u_int32_t agp_mode; /* mode info of bridge */ |
| 78 |
off_t aper_base; /* base of aperture */ |
| 79 |
size_t aper_size; /* size of aperture */ |
| 80 |
size_t pg_total; /* max pages (swap + system) */ |
| 81 |
size_t pg_system; /* max pages (system) */ |
| 82 |
size_t pg_used; /* current pages used */ |
| 83 |
} agp_info; |
| 84 |
.Ed |
| 85 |
.Pp |
| 86 |
.It Dv AGPIOC_ACQUIRE |
| 87 |
Acquire AGP chipset for use by the kernel. Returns |
| 88 |
.Er EBUSY |
| 89 |
if the AGP chipset is already acquired by another user. |
| 90 |
.It Dv AGPIOC_RELEASE |
| 91 |
Release AGP chipset. |
| 92 |
.It Dv AGPIOC_SETUP |
| 93 |
.Pq Li "agp_setup *" |
| 94 |
Enable the |
| 95 |
.Nm |
| 96 |
hardware with the relevant mode. The argument is the pointer to the |
| 97 |
following type: |
| 98 |
.Bd -literal |
| 99 |
typedef struct _agp_setup { |
| 100 |
u_int32_t agp_mode; /* mode info of bridge */ |
| 101 |
} agp_setup; |
| 102 |
.Ed |
| 103 |
.Pp |
| 104 |
The mode bits are defined in |
| 105 |
.Aq Pa sys/agpio.h . |
| 106 |
.It Dv AGPIOC_ALLOCATE |
| 107 |
.Pq Li "agp_allocate *" |
| 108 |
Allocate physical memory suitable for mapping into the AGP aperture. |
| 109 |
The third argument is the pointer to the following structure: |
| 110 |
.Bd -literal |
| 111 |
typedef struct _agp_allocate { |
| 112 |
int key; /* tag of allocation */ |
| 113 |
size_t pg_count; /* number of pages */ |
| 114 |
u_int32_t type; /* 0 == normal, other devspec */ |
| 115 |
u_int32_t physical; /* device specific (some devices |
| 116 |
* need a phys address of the |
| 117 |
* actual page behind the gatt |
| 118 |
* table) */ |
| 119 |
} agp_allocate; |
| 120 |
.Ed |
| 121 |
.Pp |
| 122 |
Returns the handle to the memory allocated. |
| 123 |
.It Dv AGPIOC_DEALLOCATE |
| 124 |
.Pq Li "int *" |
| 125 |
Free the previously allocated memory associated with the handle passed. |
| 126 |
.It Dv AGPIOC_BIND |
| 127 |
.Pq Li "agp_bind *" |
| 128 |
Bind the allocated memory at given offset with the AGP aperture. Returns |
| 129 |
.Er EINVAL |
| 130 |
if the memory is already bound or the offset is not at an AGP page boundary. |
| 131 |
The third argument is the pointer to the following structure: |
| 132 |
.Bd -literal |
| 133 |
typedef struct _agp_bind { |
| 134 |
int key; /* tag of allocation */ |
| 135 |
off_t pg_start; /* starting page to populate */ |
| 136 |
} agp_bind; |
| 137 |
.Ed |
| 138 |
.Pp |
| 139 |
The tag of allocation here means the handle returned by AGPIOC_ALLOCATE. |
| 140 |
.It Dv AGPIOC_UNBIND |
| 141 |
.Pq Li "agp_unbind *" |
| 142 |
Unbind memory from the AGP aperture. Return |
| 143 |
.Er EINVAL |
| 144 |
if the memory is not bound. The third argument is the pointer to the |
| 145 |
following structure: |
| 146 |
.Bd -literal |
| 147 |
typedef struct _agp_unbind { |
| 148 |
int key; /* tag of allocation */ |
| 149 |
u_int32_t priority; /* priority for paging out */ |
| 150 |
} agp_unbind; |
| 151 |
.Ed |
| 152 |
.Pp |
| 153 |
.El |
| 61 |
.Sh FILES |
154 |
.Sh FILES |
| 62 |
.Bl -tag -width ".Pa /dev/agpgart" -compact |
155 |
.Bl -tag -width ".Pa /dev/agpgart" -compact |
| 63 |
.It Pa /dev/agpgart |
156 |
.It Pa /dev/agpgart |