diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-09-25 00:28:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-09-25 00:28:13 -0400 |
commit | b5e89ed53ed8d24f83ba1941c07382af00ed238e (patch) | |
tree | 747bae7a565f88a2e1d5974776eeb054a932c505 /drivers/char/drm/drm.h | |
parent | 99a2657a29e2d623c3568cd86b27cac13fb63140 (diff) |
drm: lindent the drm directory.
I've been threatening this for a while, so no point hanging around.
This lindents the DRM code which was always really bad in tabbing department.
I've also fixed some misnamed files in comments and removed some trailing
whitespace.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm.h')
-rw-r--r-- | drivers/char/drm/drm.h | 295 |
1 files changed, 126 insertions, 169 deletions
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h index fc6598a81acd..64d6237fdd0b 100644 --- a/drivers/char/drm/drm.h +++ b/drivers/char/drm/drm.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * \file drm.h | 2 | * \file drm.h |
3 | * Header for the Direct Rendering Manager | 3 | * Header for the Direct Rendering Manager |
4 | * | 4 | * |
5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | 5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> |
6 | * | 6 | * |
7 | * \par Acknowledgments: | 7 | * \par Acknowledgments: |
@@ -33,7 +33,6 @@ | |||
33 | * OTHER DEALINGS IN THE SOFTWARE. | 33 | * OTHER DEALINGS IN THE SOFTWARE. |
34 | */ | 34 | */ |
35 | 35 | ||
36 | |||
37 | #ifndef _DRM_H_ | 36 | #ifndef _DRM_H_ |
38 | #define _DRM_H_ | 37 | #define _DRM_H_ |
39 | 38 | ||
@@ -56,7 +55,7 @@ | |||
56 | #define ioctl(a,b,c) xf86ioctl(a,b,c) | 55 | #define ioctl(a,b,c) xf86ioctl(a,b,c) |
57 | #else | 56 | #else |
58 | #include <sys/ioccom.h> | 57 | #include <sys/ioccom.h> |
59 | #endif /* __FreeBSD__ && xf86ioctl */ | 58 | #endif /* __FreeBSD__ && xf86ioctl */ |
60 | #define DRM_IOCTL_NR(n) ((n) & 0xff) | 59 | #define DRM_IOCTL_NR(n) ((n) & 0xff) |
61 | #define DRM_IOC_VOID IOC_VOID | 60 | #define DRM_IOC_VOID IOC_VOID |
62 | #define DRM_IOC_READ IOC_OUT | 61 | #define DRM_IOC_READ IOC_OUT |
@@ -97,16 +96,14 @@ | |||
97 | #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) | 96 | #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) |
98 | #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) | 97 | #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) |
99 | 98 | ||
100 | 99 | typedef unsigned int drm_handle_t; | |
101 | typedef unsigned int drm_handle_t; | 100 | typedef unsigned int drm_context_t; |
102 | typedef unsigned int drm_context_t; | 101 | typedef unsigned int drm_drawable_t; |
103 | typedef unsigned int drm_drawable_t; | 102 | typedef unsigned int drm_magic_t; |
104 | typedef unsigned int drm_magic_t; | ||
105 | |||
106 | 103 | ||
107 | /** | 104 | /** |
108 | * Cliprect. | 105 | * Cliprect. |
109 | * | 106 | * |
110 | * \warning: If you change this structure, make sure you change | 107 | * \warning: If you change this structure, make sure you change |
111 | * XF86DRIClipRectRec in the server as well | 108 | * XF86DRIClipRectRec in the server as well |
112 | * | 109 | * |
@@ -114,22 +111,21 @@ typedef unsigned int drm_magic_t; | |||
114 | * backwards-compatibility reasons. | 111 | * backwards-compatibility reasons. |
115 | */ | 112 | */ |
116 | typedef struct drm_clip_rect { | 113 | typedef struct drm_clip_rect { |
117 | unsigned short x1; | 114 | unsigned short x1; |
118 | unsigned short y1; | 115 | unsigned short y1; |
119 | unsigned short x2; | 116 | unsigned short x2; |
120 | unsigned short y2; | 117 | unsigned short y2; |
121 | } drm_clip_rect_t; | 118 | } drm_clip_rect_t; |
122 | 119 | ||
123 | |||
124 | /** | 120 | /** |
125 | * Texture region, | 121 | * Texture region, |
126 | */ | 122 | */ |
127 | typedef struct drm_tex_region { | 123 | typedef struct drm_tex_region { |
128 | unsigned char next; | 124 | unsigned char next; |
129 | unsigned char prev; | 125 | unsigned char prev; |
130 | unsigned char in_use; | 126 | unsigned char in_use; |
131 | unsigned char padding; | 127 | unsigned char padding; |
132 | unsigned int age; | 128 | unsigned int age; |
133 | } drm_tex_region_t; | 129 | } drm_tex_region_t; |
134 | 130 | ||
135 | /** | 131 | /** |
@@ -141,28 +137,26 @@ typedef struct drm_tex_region { | |||
141 | */ | 137 | */ |
142 | typedef struct drm_hw_lock { | 138 | typedef struct drm_hw_lock { |
143 | __volatile__ unsigned int lock; /**< lock variable */ | 139 | __volatile__ unsigned int lock; /**< lock variable */ |
144 | char padding[60]; /**< Pad to cache line */ | 140 | char padding[60]; /**< Pad to cache line */ |
145 | } drm_hw_lock_t; | 141 | } drm_hw_lock_t; |
146 | 142 | ||
147 | |||
148 | /** | 143 | /** |
149 | * DRM_IOCTL_VERSION ioctl argument type. | 144 | * DRM_IOCTL_VERSION ioctl argument type. |
150 | * | 145 | * |
151 | * \sa drmGetVersion(). | 146 | * \sa drmGetVersion(). |
152 | */ | 147 | */ |
153 | typedef struct drm_version { | 148 | typedef struct drm_version { |
154 | int version_major; /**< Major version */ | 149 | int version_major; /**< Major version */ |
155 | int version_minor; /**< Minor version */ | 150 | int version_minor; /**< Minor version */ |
156 | int version_patchlevel;/**< Patch level */ | 151 | int version_patchlevel; /**< Patch level */ |
157 | size_t name_len; /**< Length of name buffer */ | 152 | size_t name_len; /**< Length of name buffer */ |
158 | char __user *name; /**< Name of driver */ | 153 | char __user *name; /**< Name of driver */ |
159 | size_t date_len; /**< Length of date buffer */ | 154 | size_t date_len; /**< Length of date buffer */ |
160 | char __user *date; /**< User-space buffer to hold date */ | 155 | char __user *date; /**< User-space buffer to hold date */ |
161 | size_t desc_len; /**< Length of desc buffer */ | 156 | size_t desc_len; /**< Length of desc buffer */ |
162 | char __user *desc; /**< User-space buffer to hold desc */ | 157 | char __user *desc; /**< User-space buffer to hold desc */ |
163 | } drm_version_t; | 158 | } drm_version_t; |
164 | 159 | ||
165 | |||
166 | /** | 160 | /** |
167 | * DRM_IOCTL_GET_UNIQUE ioctl argument type. | 161 | * DRM_IOCTL_GET_UNIQUE ioctl argument type. |
168 | * | 162 | * |
@@ -170,21 +164,18 @@ typedef struct drm_version { | |||
170 | */ | 164 | */ |
171 | typedef struct drm_unique { | 165 | typedef struct drm_unique { |
172 | size_t unique_len; /**< Length of unique */ | 166 | size_t unique_len; /**< Length of unique */ |
173 | char __user *unique; /**< Unique name for driver instantiation */ | 167 | char __user *unique; /**< Unique name for driver instantiation */ |
174 | } drm_unique_t; | 168 | } drm_unique_t; |
175 | 169 | ||
176 | |||
177 | typedef struct drm_list { | 170 | typedef struct drm_list { |
178 | int count; /**< Length of user-space structures */ | 171 | int count; /**< Length of user-space structures */ |
179 | drm_version_t __user *version; | 172 | drm_version_t __user *version; |
180 | } drm_list_t; | 173 | } drm_list_t; |
181 | 174 | ||
182 | |||
183 | typedef struct drm_block { | 175 | typedef struct drm_block { |
184 | int unused; | 176 | int unused; |
185 | } drm_block_t; | 177 | } drm_block_t; |
186 | 178 | ||
187 | |||
188 | /** | 179 | /** |
189 | * DRM_IOCTL_CONTROL ioctl argument type. | 180 | * DRM_IOCTL_CONTROL ioctl argument type. |
190 | * | 181 | * |
@@ -196,44 +187,40 @@ typedef struct drm_control { | |||
196 | DRM_RM_COMMAND, | 187 | DRM_RM_COMMAND, |
197 | DRM_INST_HANDLER, | 188 | DRM_INST_HANDLER, |
198 | DRM_UNINST_HANDLER | 189 | DRM_UNINST_HANDLER |
199 | } func; | 190 | } func; |
200 | int irq; | 191 | int irq; |
201 | } drm_control_t; | 192 | } drm_control_t; |
202 | 193 | ||
203 | |||
204 | /** | 194 | /** |
205 | * Type of memory to map. | 195 | * Type of memory to map. |
206 | */ | 196 | */ |
207 | typedef enum drm_map_type { | 197 | typedef enum drm_map_type { |
208 | _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ | 198 | _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ |
209 | _DRM_REGISTERS = 1, /**< no caching, no core dump */ | 199 | _DRM_REGISTERS = 1, /**< no caching, no core dump */ |
210 | _DRM_SHM = 2, /**< shared, cached */ | 200 | _DRM_SHM = 2, /**< shared, cached */ |
211 | _DRM_AGP = 3, /**< AGP/GART */ | 201 | _DRM_AGP = 3, /**< AGP/GART */ |
212 | _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ | 202 | _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ |
213 | _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ | 203 | _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ |
214 | } drm_map_type_t; | 204 | } drm_map_type_t; |
215 | 205 | ||
216 | |||
217 | /** | 206 | /** |
218 | * Memory mapping flags. | 207 | * Memory mapping flags. |
219 | */ | 208 | */ |
220 | typedef enum drm_map_flags { | 209 | typedef enum drm_map_flags { |
221 | _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ | 210 | _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ |
222 | _DRM_READ_ONLY = 0x02, | 211 | _DRM_READ_ONLY = 0x02, |
223 | _DRM_LOCKED = 0x04, /**< shared, cached, locked */ | 212 | _DRM_LOCKED = 0x04, /**< shared, cached, locked */ |
224 | _DRM_KERNEL = 0x08, /**< kernel requires access */ | 213 | _DRM_KERNEL = 0x08, /**< kernel requires access */ |
225 | _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ | 214 | _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ |
226 | _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ | 215 | _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ |
227 | _DRM_REMOVABLE = 0x40 /**< Removable mapping */ | 216 | _DRM_REMOVABLE = 0x40 /**< Removable mapping */ |
228 | } drm_map_flags_t; | 217 | } drm_map_flags_t; |
229 | 218 | ||
230 | |||
231 | typedef struct drm_ctx_priv_map { | 219 | typedef struct drm_ctx_priv_map { |
232 | unsigned int ctx_id; /**< Context requesting private mapping */ | 220 | unsigned int ctx_id; /**< Context requesting private mapping */ |
233 | void *handle; /**< Handle of map */ | 221 | void *handle; /**< Handle of map */ |
234 | } drm_ctx_priv_map_t; | 222 | } drm_ctx_priv_map_t; |
235 | 223 | ||
236 | |||
237 | /** | 224 | /** |
238 | * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls | 225 | * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls |
239 | * argument type. | 226 | * argument type. |
@@ -241,30 +228,28 @@ typedef struct drm_ctx_priv_map { | |||
241 | * \sa drmAddMap(). | 228 | * \sa drmAddMap(). |
242 | */ | 229 | */ |
243 | typedef struct drm_map { | 230 | typedef struct drm_map { |
244 | unsigned long offset; /**< Requested physical address (0 for SAREA)*/ | 231 | unsigned long offset; /**< Requested physical address (0 for SAREA)*/ |
245 | unsigned long size; /**< Requested physical size (bytes) */ | 232 | unsigned long size; /**< Requested physical size (bytes) */ |
246 | drm_map_type_t type; /**< Type of memory to map */ | 233 | drm_map_type_t type; /**< Type of memory to map */ |
247 | drm_map_flags_t flags; /**< Flags */ | 234 | drm_map_flags_t flags; /**< Flags */ |
248 | void *handle; /**< User-space: "Handle" to pass to mmap() */ | 235 | void *handle; /**< User-space: "Handle" to pass to mmap() */ |
249 | /**< Kernel-space: kernel-virtual address */ | 236 | /**< Kernel-space: kernel-virtual address */ |
250 | int mtrr; /**< MTRR slot used */ | 237 | int mtrr; /**< MTRR slot used */ |
251 | /* Private data */ | 238 | /* Private data */ |
252 | } drm_map_t; | 239 | } drm_map_t; |
253 | 240 | ||
254 | |||
255 | /** | 241 | /** |
256 | * DRM_IOCTL_GET_CLIENT ioctl argument type. | 242 | * DRM_IOCTL_GET_CLIENT ioctl argument type. |
257 | */ | 243 | */ |
258 | typedef struct drm_client { | 244 | typedef struct drm_client { |
259 | int idx; /**< Which client desired? */ | 245 | int idx; /**< Which client desired? */ |
260 | int auth; /**< Is client authenticated? */ | 246 | int auth; /**< Is client authenticated? */ |
261 | unsigned long pid; /**< Process ID */ | 247 | unsigned long pid; /**< Process ID */ |
262 | unsigned long uid; /**< User ID */ | 248 | unsigned long uid; /**< User ID */ |
263 | unsigned long magic; /**< Magic */ | 249 | unsigned long magic; /**< Magic */ |
264 | unsigned long iocs; /**< Ioctl count */ | 250 | unsigned long iocs; /**< Ioctl count */ |
265 | } drm_client_t; | 251 | } drm_client_t; |
266 | 252 | ||
267 | |||
268 | typedef enum { | 253 | typedef enum { |
269 | _DRM_STAT_LOCK, | 254 | _DRM_STAT_LOCK, |
270 | _DRM_STAT_OPENS, | 255 | _DRM_STAT_OPENS, |
@@ -282,63 +267,58 @@ typedef enum { | |||
282 | _DRM_STAT_DMA, /**< DMA */ | 267 | _DRM_STAT_DMA, /**< DMA */ |
283 | _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ | 268 | _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ |
284 | _DRM_STAT_MISSED /**< Missed DMA opportunity */ | 269 | _DRM_STAT_MISSED /**< Missed DMA opportunity */ |
285 | 270 | /* Add to the *END* of the list */ | |
286 | /* Add to the *END* of the list */ | ||
287 | } drm_stat_type_t; | 271 | } drm_stat_type_t; |
288 | 272 | ||
289 | |||
290 | /** | 273 | /** |
291 | * DRM_IOCTL_GET_STATS ioctl argument type. | 274 | * DRM_IOCTL_GET_STATS ioctl argument type. |
292 | */ | 275 | */ |
293 | typedef struct drm_stats { | 276 | typedef struct drm_stats { |
294 | unsigned long count; | 277 | unsigned long count; |
295 | struct { | 278 | struct { |
296 | unsigned long value; | 279 | unsigned long value; |
297 | drm_stat_type_t type; | 280 | drm_stat_type_t type; |
298 | } data[15]; | 281 | } data[15]; |
299 | } drm_stats_t; | 282 | } drm_stats_t; |
300 | 283 | ||
301 | |||
302 | /** | 284 | /** |
303 | * Hardware locking flags. | 285 | * Hardware locking flags. |
304 | */ | 286 | */ |
305 | typedef enum drm_lock_flags { | 287 | typedef enum drm_lock_flags { |
306 | _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ | 288 | _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ |
307 | _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ | 289 | _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ |
308 | _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ | 290 | _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ |
309 | _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ | 291 | _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ |
310 | /* These *HALT* flags aren't supported yet | 292 | /* These *HALT* flags aren't supported yet |
311 | -- they will be used to support the | 293 | -- they will be used to support the |
312 | full-screen DGA-like mode. */ | 294 | full-screen DGA-like mode. */ |
313 | _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ | 295 | _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ |
314 | _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ | 296 | _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ |
315 | } drm_lock_flags_t; | 297 | } drm_lock_flags_t; |
316 | 298 | ||
317 | |||
318 | /** | 299 | /** |
319 | * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. | 300 | * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. |
320 | * | 301 | * |
321 | * \sa drmGetLock() and drmUnlock(). | 302 | * \sa drmGetLock() and drmUnlock(). |
322 | */ | 303 | */ |
323 | typedef struct drm_lock { | 304 | typedef struct drm_lock { |
324 | int context; | 305 | int context; |
325 | drm_lock_flags_t flags; | 306 | drm_lock_flags_t flags; |
326 | } drm_lock_t; | 307 | } drm_lock_t; |
327 | 308 | ||
328 | |||
329 | /** | 309 | /** |
330 | * DMA flags | 310 | * DMA flags |
331 | * | 311 | * |
332 | * \warning | 312 | * \warning |
333 | * These values \e must match xf86drm.h. | 313 | * These values \e must match xf86drm.h. |
334 | * | 314 | * |
335 | * \sa drm_dma. | 315 | * \sa drm_dma. |
336 | */ | 316 | */ |
337 | typedef enum drm_dma_flags { | 317 | typedef enum drm_dma_flags { |
338 | /* Flags for DMA buffer dispatch */ | 318 | /* Flags for DMA buffer dispatch */ |
339 | _DRM_DMA_BLOCK = 0x01, /**< | 319 | _DRM_DMA_BLOCK = 0x01, /**< |
340 | * Block until buffer dispatched. | 320 | * Block until buffer dispatched. |
341 | * | 321 | * |
342 | * \note The buffer may not yet have | 322 | * \note The buffer may not yet have |
343 | * been processed by the hardware -- | 323 | * been processed by the hardware -- |
344 | * getting a hardware lock with the | 324 | * getting a hardware lock with the |
@@ -347,79 +327,73 @@ typedef enum drm_dma_flags { | |||
347 | * processed. | 327 | * processed. |
348 | */ | 328 | */ |
349 | _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ | 329 | _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ |
350 | _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ | 330 | _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ |
351 | 331 | ||
352 | /* Flags for DMA buffer request */ | 332 | /* Flags for DMA buffer request */ |
353 | _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ | 333 | _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ |
354 | _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ | 334 | _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ |
355 | _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ | 335 | _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ |
356 | } drm_dma_flags_t; | 336 | } drm_dma_flags_t; |
357 | 337 | ||
358 | |||
359 | /** | 338 | /** |
360 | * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. | 339 | * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. |
361 | * | 340 | * |
362 | * \sa drmAddBufs(). | 341 | * \sa drmAddBufs(). |
363 | */ | 342 | */ |
364 | typedef struct drm_buf_desc { | 343 | typedef struct drm_buf_desc { |
365 | int count; /**< Number of buffers of this size */ | 344 | int count; /**< Number of buffers of this size */ |
366 | int size; /**< Size in bytes */ | 345 | int size; /**< Size in bytes */ |
367 | int low_mark; /**< Low water mark */ | 346 | int low_mark; /**< Low water mark */ |
368 | int high_mark; /**< High water mark */ | 347 | int high_mark; /**< High water mark */ |
369 | enum { | 348 | enum { |
370 | _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ | 349 | _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ |
371 | _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ | 350 | _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ |
372 | _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ | 351 | _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ |
373 | _DRM_FB_BUFFER = 0x08 /**< Buffer is in frame buffer */ | 352 | _DRM_FB_BUFFER = 0x08 /**< Buffer is in frame buffer */ |
374 | } flags; | 353 | } flags; |
375 | unsigned long agp_start; /**< | 354 | unsigned long agp_start; /**< |
376 | * Start address of where the AGP buffers are | 355 | * Start address of where the AGP buffers are |
377 | * in the AGP aperture | 356 | * in the AGP aperture |
378 | */ | 357 | */ |
379 | } drm_buf_desc_t; | 358 | } drm_buf_desc_t; |
380 | 359 | ||
381 | |||
382 | /** | 360 | /** |
383 | * DRM_IOCTL_INFO_BUFS ioctl argument type. | 361 | * DRM_IOCTL_INFO_BUFS ioctl argument type. |
384 | */ | 362 | */ |
385 | typedef struct drm_buf_info { | 363 | typedef struct drm_buf_info { |
386 | int count; /**< Entries in list */ | 364 | int count; /**< Entries in list */ |
387 | drm_buf_desc_t __user *list; | 365 | drm_buf_desc_t __user *list; |
388 | } drm_buf_info_t; | 366 | } drm_buf_info_t; |
389 | 367 | ||
390 | |||
391 | /** | 368 | /** |
392 | * DRM_IOCTL_FREE_BUFS ioctl argument type. | 369 | * DRM_IOCTL_FREE_BUFS ioctl argument type. |
393 | */ | 370 | */ |
394 | typedef struct drm_buf_free { | 371 | typedef struct drm_buf_free { |
395 | int count; | 372 | int count; |
396 | int __user *list; | 373 | int __user *list; |
397 | } drm_buf_free_t; | 374 | } drm_buf_free_t; |
398 | 375 | ||
399 | |||
400 | /** | 376 | /** |
401 | * Buffer information | 377 | * Buffer information |
402 | * | 378 | * |
403 | * \sa drm_buf_map. | 379 | * \sa drm_buf_map. |
404 | */ | 380 | */ |
405 | typedef struct drm_buf_pub { | 381 | typedef struct drm_buf_pub { |
406 | int idx; /**< Index into the master buffer list */ | 382 | int idx; /**< Index into the master buffer list */ |
407 | int total; /**< Buffer size */ | 383 | int total; /**< Buffer size */ |
408 | int used; /**< Amount of buffer in use (for DMA) */ | 384 | int used; /**< Amount of buffer in use (for DMA) */ |
409 | void __user *address; /**< Address of buffer */ | 385 | void __user *address; /**< Address of buffer */ |
410 | } drm_buf_pub_t; | 386 | } drm_buf_pub_t; |
411 | 387 | ||
412 | |||
413 | /** | 388 | /** |
414 | * DRM_IOCTL_MAP_BUFS ioctl argument type. | 389 | * DRM_IOCTL_MAP_BUFS ioctl argument type. |
415 | */ | 390 | */ |
416 | typedef struct drm_buf_map { | 391 | typedef struct drm_buf_map { |
417 | int count; /**< Length of the buffer list */ | 392 | int count; /**< Length of the buffer list */ |
418 | void __user *virtual; /**< Mmap'd area in user-virtual */ | 393 | void __user *virtual; /**< Mmap'd area in user-virtual */ |
419 | drm_buf_pub_t __user *list; /**< Buffer information */ | 394 | drm_buf_pub_t __user *list; /**< Buffer information */ |
420 | } drm_buf_map_t; | 395 | } drm_buf_map_t; |
421 | 396 | ||
422 | |||
423 | /** | 397 | /** |
424 | * DRM_IOCTL_DMA ioctl argument type. | 398 | * DRM_IOCTL_DMA ioctl argument type. |
425 | * | 399 | * |
@@ -428,61 +402,55 @@ typedef struct drm_buf_map { | |||
428 | * \sa drmDMA(). | 402 | * \sa drmDMA(). |
429 | */ | 403 | */ |
430 | typedef struct drm_dma { | 404 | typedef struct drm_dma { |
431 | int context; /**< Context handle */ | 405 | int context; /**< Context handle */ |
432 | int send_count; /**< Number of buffers to send */ | 406 | int send_count; /**< Number of buffers to send */ |
433 | int __user *send_indices; /**< List of handles to buffers */ | 407 | int __user *send_indices; /**< List of handles to buffers */ |
434 | int __user *send_sizes; /**< Lengths of data to send */ | 408 | int __user *send_sizes; /**< Lengths of data to send */ |
435 | drm_dma_flags_t flags; /**< Flags */ | 409 | drm_dma_flags_t flags; /**< Flags */ |
436 | int request_count; /**< Number of buffers requested */ | 410 | int request_count; /**< Number of buffers requested */ |
437 | int request_size; /**< Desired size for buffers */ | 411 | int request_size; /**< Desired size for buffers */ |
438 | int __user *request_indices; /**< Buffer information */ | 412 | int __user *request_indices; /**< Buffer information */ |
439 | int __user *request_sizes; | 413 | int __user *request_sizes; |
440 | int granted_count; /**< Number of buffers granted */ | 414 | int granted_count; /**< Number of buffers granted */ |
441 | } drm_dma_t; | 415 | } drm_dma_t; |
442 | 416 | ||
443 | |||
444 | typedef enum { | 417 | typedef enum { |
445 | _DRM_CONTEXT_PRESERVED = 0x01, | 418 | _DRM_CONTEXT_PRESERVED = 0x01, |
446 | _DRM_CONTEXT_2DONLY = 0x02 | 419 | _DRM_CONTEXT_2DONLY = 0x02 |
447 | } drm_ctx_flags_t; | 420 | } drm_ctx_flags_t; |
448 | 421 | ||
449 | |||
450 | /** | 422 | /** |
451 | * DRM_IOCTL_ADD_CTX ioctl argument type. | 423 | * DRM_IOCTL_ADD_CTX ioctl argument type. |
452 | * | 424 | * |
453 | * \sa drmCreateContext() and drmDestroyContext(). | 425 | * \sa drmCreateContext() and drmDestroyContext(). |
454 | */ | 426 | */ |
455 | typedef struct drm_ctx { | 427 | typedef struct drm_ctx { |
456 | drm_context_t handle; | 428 | drm_context_t handle; |
457 | drm_ctx_flags_t flags; | 429 | drm_ctx_flags_t flags; |
458 | } drm_ctx_t; | 430 | } drm_ctx_t; |
459 | 431 | ||
460 | |||
461 | /** | 432 | /** |
462 | * DRM_IOCTL_RES_CTX ioctl argument type. | 433 | * DRM_IOCTL_RES_CTX ioctl argument type. |
463 | */ | 434 | */ |
464 | typedef struct drm_ctx_res { | 435 | typedef struct drm_ctx_res { |
465 | int count; | 436 | int count; |
466 | drm_ctx_t __user *contexts; | 437 | drm_ctx_t __user *contexts; |
467 | } drm_ctx_res_t; | 438 | } drm_ctx_res_t; |
468 | 439 | ||
469 | |||
470 | /** | 440 | /** |
471 | * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. | 441 | * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. |
472 | */ | 442 | */ |
473 | typedef struct drm_draw { | 443 | typedef struct drm_draw { |
474 | drm_drawable_t handle; | 444 | drm_drawable_t handle; |
475 | } drm_draw_t; | 445 | } drm_draw_t; |
476 | 446 | ||
477 | |||
478 | /** | 447 | /** |
479 | * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. | 448 | * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. |
480 | */ | 449 | */ |
481 | typedef struct drm_auth { | 450 | typedef struct drm_auth { |
482 | drm_magic_t magic; | 451 | drm_magic_t magic; |
483 | } drm_auth_t; | 452 | } drm_auth_t; |
484 | 453 | ||
485 | |||
486 | /** | 454 | /** |
487 | * DRM_IOCTL_IRQ_BUSID ioctl argument type. | 455 | * DRM_IOCTL_IRQ_BUSID ioctl argument type. |
488 | * | 456 | * |
@@ -495,24 +463,20 @@ typedef struct drm_irq_busid { | |||
495 | int funcnum; /**< function number */ | 463 | int funcnum; /**< function number */ |
496 | } drm_irq_busid_t; | 464 | } drm_irq_busid_t; |
497 | 465 | ||
498 | |||
499 | typedef enum { | 466 | typedef enum { |
500 | _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ | 467 | _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ |
501 | _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ | 468 | _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ |
502 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ | 469 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ |
503 | } drm_vblank_seq_type_t; | 470 | } drm_vblank_seq_type_t; |
504 | 471 | ||
505 | |||
506 | #define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL | 472 | #define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL |
507 | 473 | ||
508 | |||
509 | struct drm_wait_vblank_request { | 474 | struct drm_wait_vblank_request { |
510 | drm_vblank_seq_type_t type; | 475 | drm_vblank_seq_type_t type; |
511 | unsigned int sequence; | 476 | unsigned int sequence; |
512 | unsigned long signal; | 477 | unsigned long signal; |
513 | }; | 478 | }; |
514 | 479 | ||
515 | |||
516 | struct drm_wait_vblank_reply { | 480 | struct drm_wait_vblank_reply { |
517 | drm_vblank_seq_type_t type; | 481 | drm_vblank_seq_type_t type; |
518 | unsigned int sequence; | 482 | unsigned int sequence; |
@@ -520,7 +484,6 @@ struct drm_wait_vblank_reply { | |||
520 | long tval_usec; | 484 | long tval_usec; |
521 | }; | 485 | }; |
522 | 486 | ||
523 | |||
524 | /** | 487 | /** |
525 | * DRM_IOCTL_WAIT_VBLANK ioctl argument type. | 488 | * DRM_IOCTL_WAIT_VBLANK ioctl argument type. |
526 | * | 489 | * |
@@ -531,7 +494,6 @@ typedef union drm_wait_vblank { | |||
531 | struct drm_wait_vblank_reply reply; | 494 | struct drm_wait_vblank_reply reply; |
532 | } drm_wait_vblank_t; | 495 | } drm_wait_vblank_t; |
533 | 496 | ||
534 | |||
535 | /** | 497 | /** |
536 | * DRM_IOCTL_AGP_ENABLE ioctl argument type. | 498 | * DRM_IOCTL_AGP_ENABLE ioctl argument type. |
537 | * | 499 | * |
@@ -541,7 +503,6 @@ typedef struct drm_agp_mode { | |||
541 | unsigned long mode; /**< AGP mode */ | 503 | unsigned long mode; /**< AGP mode */ |
542 | } drm_agp_mode_t; | 504 | } drm_agp_mode_t; |
543 | 505 | ||
544 | |||
545 | /** | 506 | /** |
546 | * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. | 507 | * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. |
547 | * | 508 | * |
@@ -550,22 +511,20 @@ typedef struct drm_agp_mode { | |||
550 | typedef struct drm_agp_buffer { | 511 | typedef struct drm_agp_buffer { |
551 | unsigned long size; /**< In bytes -- will round to page boundary */ | 512 | unsigned long size; /**< In bytes -- will round to page boundary */ |
552 | unsigned long handle; /**< Used for binding / unbinding */ | 513 | unsigned long handle; /**< Used for binding / unbinding */ |
553 | unsigned long type; /**< Type of memory to allocate */ | 514 | unsigned long type; /**< Type of memory to allocate */ |
554 | unsigned long physical; /**< Physical used by i810 */ | 515 | unsigned long physical; /**< Physical used by i810 */ |
555 | } drm_agp_buffer_t; | 516 | } drm_agp_buffer_t; |
556 | 517 | ||
557 | |||
558 | /** | 518 | /** |
559 | * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. | 519 | * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. |
560 | * | 520 | * |
561 | * \sa drmAgpBind() and drmAgpUnbind(). | 521 | * \sa drmAgpBind() and drmAgpUnbind(). |
562 | */ | 522 | */ |
563 | typedef struct drm_agp_binding { | 523 | typedef struct drm_agp_binding { |
564 | unsigned long handle; /**< From drm_agp_buffer */ | 524 | unsigned long handle; /**< From drm_agp_buffer */ |
565 | unsigned long offset; /**< In bytes -- will round to page boundary */ | 525 | unsigned long offset; /**< In bytes -- will round to page boundary */ |
566 | } drm_agp_binding_t; | 526 | } drm_agp_binding_t; |
567 | 527 | ||
568 | |||
569 | /** | 528 | /** |
570 | * DRM_IOCTL_AGP_INFO ioctl argument type. | 529 | * DRM_IOCTL_AGP_INFO ioctl argument type. |
571 | * | 530 | * |
@@ -574,20 +533,19 @@ typedef struct drm_agp_binding { | |||
574 | * drmAgpVendorId() and drmAgpDeviceId(). | 533 | * drmAgpVendorId() and drmAgpDeviceId(). |
575 | */ | 534 | */ |
576 | typedef struct drm_agp_info { | 535 | typedef struct drm_agp_info { |
577 | int agp_version_major; | 536 | int agp_version_major; |
578 | int agp_version_minor; | 537 | int agp_version_minor; |
579 | unsigned long mode; | 538 | unsigned long mode; |
580 | unsigned long aperture_base; /* physical address */ | 539 | unsigned long aperture_base; /* physical address */ |
581 | unsigned long aperture_size; /* bytes */ | 540 | unsigned long aperture_size; /* bytes */ |
582 | unsigned long memory_allowed; /* bytes */ | 541 | unsigned long memory_allowed; /* bytes */ |
583 | unsigned long memory_used; | 542 | unsigned long memory_used; |
584 | 543 | ||
585 | /* PCI information */ | 544 | /* PCI information */ |
586 | unsigned short id_vendor; | 545 | unsigned short id_vendor; |
587 | unsigned short id_device; | 546 | unsigned short id_device; |
588 | } drm_agp_info_t; | 547 | } drm_agp_info_t; |
589 | 548 | ||
590 | |||
591 | /** | 549 | /** |
592 | * DRM_IOCTL_SG_ALLOC ioctl argument type. | 550 | * DRM_IOCTL_SG_ALLOC ioctl argument type. |
593 | */ | 551 | */ |
@@ -606,7 +564,6 @@ typedef struct drm_set_version { | |||
606 | int drm_dd_minor; | 564 | int drm_dd_minor; |
607 | } drm_set_version_t; | 565 | } drm_set_version_t; |
608 | 566 | ||
609 | |||
610 | #define DRM_IOCTL_BASE 'd' | 567 | #define DRM_IOCTL_BASE 'd' |
611 | #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) | 568 | #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) |
612 | #define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) | 569 | #define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) |