aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-07-11 01:27:12 -0400
committerDave Airlie <airlied@linux.ie>2007-07-11 01:27:12 -0400
commitc60ce623bd16137627009d05e311d877729f2ad6 (patch)
tree4d06337a217ccc6c21f8ad96c3b342a1e9452057 /drivers/char/drm
parentc6c656b4b6ddfc964f1a43394bf86bc76c5e8119 (diff)
drm: remove a bunch of typedefs on the userspace interface
This moves a bunch of typedefs into a !defined __KERNEL__ to keep userspace API compatiblity, it changes all internal usages to structs/enum/unions. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drm.h329
-rw-r--r--drivers/char/drm/drmP.h45
-rw-r--r--drivers/char/drm/drm_agpsupport.c36
-rw-r--r--drivers/char/drm/drm_auth.c8
-rw-r--r--drivers/char/drm/drm_bufs.c58
-rw-r--r--drivers/char/drm/drm_context.c41
-rw-r--r--drivers/char/drm/drm_drawable.c34
-rw-r--r--drivers/char/drm/drm_drv.c8
-rw-r--r--drivers/char/drm/drm_ioctl.c26
-rw-r--r--drivers/char/drm/drm_irq.c12
-rw-r--r--drivers/char/drm/drm_lock.c8
-rw-r--r--drivers/char/drm/drm_proc.c2
-rw-r--r--drivers/char/drm/drm_sarea.h4
-rw-r--r--drivers/char/drm/drm_scatter.c8
-rw-r--r--drivers/char/drm/drm_vm.c12
-rw-r--r--drivers/char/drm/i915_dma.c10
-rw-r--r--drivers/char/drm/i915_drm.h8
-rw-r--r--drivers/char/drm/i915_irq.c6
-rw-r--r--drivers/char/drm/i915_mem.c2
-rw-r--r--drivers/char/drm/r300_cmdbuf.c2
-rw-r--r--drivers/char/drm/radeon_cp.c6
-rw-r--r--drivers/char/drm/radeon_drm.h6
-rw-r--r--drivers/char/drm/radeon_drv.h2
-rw-r--r--drivers/char/drm/radeon_state.c10
-rw-r--r--drivers/char/drm/via_drm.h4
25 files changed, 367 insertions, 320 deletions
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 089198491f16..2d6f2d0bd02b 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -109,31 +109,31 @@ typedef unsigned int drm_magic_t;
109 * \note KW: Actually it's illegal to change either for 109 * \note KW: Actually it's illegal to change either for
110 * backwards-compatibility reasons. 110 * backwards-compatibility reasons.
111 */ 111 */
112typedef struct drm_clip_rect { 112struct drm_clip_rect {
113 unsigned short x1; 113 unsigned short x1;
114 unsigned short y1; 114 unsigned short y1;
115 unsigned short x2; 115 unsigned short x2;
116 unsigned short y2; 116 unsigned short y2;
117} drm_clip_rect_t; 117};
118 118
119/** 119/**
120 * Drawable information. 120 * Drawable information.
121 */ 121 */
122typedef struct drm_drawable_info { 122struct drm_drawable_info {
123 unsigned int num_rects; 123 unsigned int num_rects;
124 drm_clip_rect_t *rects; 124 struct drm_clip_rect *rects;
125} drm_drawable_info_t; 125};
126 126
127/** 127/**
128 * Texture region, 128 * Texture region,
129 */ 129 */
130typedef struct drm_tex_region { 130struct drm_tex_region {
131 unsigned char next; 131 unsigned char next;
132 unsigned char prev; 132 unsigned char prev;
133 unsigned char in_use; 133 unsigned char in_use;
134 unsigned char padding; 134 unsigned char padding;
135 unsigned int age; 135 unsigned int age;
136} drm_tex_region_t; 136};
137 137
138/** 138/**
139 * Hardware lock. 139 * Hardware lock.
@@ -142,17 +142,17 @@ typedef struct drm_tex_region {
142 * processor bus contention on a multiprocessor system, there should not be any 142 * processor bus contention on a multiprocessor system, there should not be any
143 * other data stored in the same cache line. 143 * other data stored in the same cache line.
144 */ 144 */
145typedef struct drm_hw_lock { 145struct drm_hw_lock {
146 __volatile__ unsigned int lock; /**< lock variable */ 146 __volatile__ unsigned int lock; /**< lock variable */
147 char padding[60]; /**< Pad to cache line */ 147 char padding[60]; /**< Pad to cache line */
148} drm_hw_lock_t; 148};
149 149
150/** 150/**
151 * DRM_IOCTL_VERSION ioctl argument type. 151 * DRM_IOCTL_VERSION ioctl argument type.
152 * 152 *
153 * \sa drmGetVersion(). 153 * \sa drmGetVersion().
154 */ 154 */
155typedef struct drm_version { 155struct drm_version {
156 int version_major; /**< Major version */ 156 int version_major; /**< Major version */
157 int version_minor; /**< Minor version */ 157 int version_minor; /**< Minor version */
158 int version_patchlevel; /**< Patch level */ 158 int version_patchlevel; /**< Patch level */
@@ -162,33 +162,33 @@ typedef struct drm_version {
162 char __user *date; /**< User-space buffer to hold date */ 162 char __user *date; /**< User-space buffer to hold date */
163 size_t desc_len; /**< Length of desc buffer */ 163 size_t desc_len; /**< Length of desc buffer */
164 char __user *desc; /**< User-space buffer to hold desc */ 164 char __user *desc; /**< User-space buffer to hold desc */
165} drm_version_t; 165};
166 166
167/** 167/**
168 * DRM_IOCTL_GET_UNIQUE ioctl argument type. 168 * DRM_IOCTL_GET_UNIQUE ioctl argument type.
169 * 169 *
170 * \sa drmGetBusid() and drmSetBusId(). 170 * \sa drmGetBusid() and drmSetBusId().
171 */ 171 */
172typedef struct drm_unique { 172struct drm_unique {
173 size_t unique_len; /**< Length of unique */ 173 size_t unique_len; /**< Length of unique */
174 char __user *unique; /**< Unique name for driver instantiation */ 174 char __user *unique; /**< Unique name for driver instantiation */
175} drm_unique_t; 175};
176 176
177typedef struct drm_list { 177struct drm_list {
178 int count; /**< Length of user-space structures */ 178 int count; /**< Length of user-space structures */
179 drm_version_t __user *version; 179 struct drm_version __user *version;
180} drm_list_t; 180};
181 181
182typedef struct drm_block { 182struct drm_block {
183 int unused; 183 int unused;
184} drm_block_t; 184};
185 185
186/** 186/**
187 * DRM_IOCTL_CONTROL ioctl argument type. 187 * DRM_IOCTL_CONTROL ioctl argument type.
188 * 188 *
189 * \sa drmCtlInstHandler() and drmCtlUninstHandler(). 189 * \sa drmCtlInstHandler() and drmCtlUninstHandler().
190 */ 190 */
191typedef struct drm_control { 191struct drm_control {
192 enum { 192 enum {
193 DRM_ADD_COMMAND, 193 DRM_ADD_COMMAND,
194 DRM_RM_COMMAND, 194 DRM_RM_COMMAND,
@@ -196,24 +196,24 @@ typedef struct drm_control {
196 DRM_UNINST_HANDLER 196 DRM_UNINST_HANDLER
197 } func; 197 } func;
198 int irq; 198 int irq;
199} drm_control_t; 199};
200 200
201/** 201/**
202 * Type of memory to map. 202 * Type of memory to map.
203 */ 203 */
204typedef enum drm_map_type { 204enum drm_map_type {
205 _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ 205 _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
206 _DRM_REGISTERS = 1, /**< no caching, no core dump */ 206 _DRM_REGISTERS = 1, /**< no caching, no core dump */
207 _DRM_SHM = 2, /**< shared, cached */ 207 _DRM_SHM = 2, /**< shared, cached */
208 _DRM_AGP = 3, /**< AGP/GART */ 208 _DRM_AGP = 3, /**< AGP/GART */
209 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ 209 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
210 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ 210 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
211} drm_map_type_t; 211};
212 212
213/** 213/**
214 * Memory mapping flags. 214 * Memory mapping flags.
215 */ 215 */
216typedef enum drm_map_flags { 216enum drm_map_flags {
217 _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ 217 _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
218 _DRM_READ_ONLY = 0x02, 218 _DRM_READ_ONLY = 0x02,
219 _DRM_LOCKED = 0x04, /**< shared, cached, locked */ 219 _DRM_LOCKED = 0x04, /**< shared, cached, locked */
@@ -221,12 +221,12 @@ typedef enum drm_map_flags {
221 _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ 221 _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
222 _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ 222 _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
223 _DRM_REMOVABLE = 0x40 /**< Removable mapping */ 223 _DRM_REMOVABLE = 0x40 /**< Removable mapping */
224} drm_map_flags_t; 224};
225 225
226typedef struct drm_ctx_priv_map { 226struct drm_ctx_priv_map {
227 unsigned int ctx_id; /**< Context requesting private mapping */ 227 unsigned int ctx_id; /**< Context requesting private mapping */
228 void *handle; /**< Handle of map */ 228 void *handle; /**< Handle of map */
229} drm_ctx_priv_map_t; 229};
230 230
231/** 231/**
232 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls 232 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
@@ -234,30 +234,30 @@ typedef struct drm_ctx_priv_map {
234 * 234 *
235 * \sa drmAddMap(). 235 * \sa drmAddMap().
236 */ 236 */
237typedef struct drm_map { 237struct drm_map {
238 unsigned long offset; /**< Requested physical address (0 for SAREA)*/ 238 unsigned long offset; /**< Requested physical address (0 for SAREA)*/
239 unsigned long size; /**< Requested physical size (bytes) */ 239 unsigned long size; /**< Requested physical size (bytes) */
240 drm_map_type_t type; /**< Type of memory to map */ 240 enum drm_map_type type; /**< Type of memory to map */
241 drm_map_flags_t flags; /**< Flags */ 241 enum drm_map_flags flags; /**< Flags */
242 void *handle; /**< User-space: "Handle" to pass to mmap() */ 242 void *handle; /**< User-space: "Handle" to pass to mmap() */
243 /**< Kernel-space: kernel-virtual address */ 243 /**< Kernel-space: kernel-virtual address */
244 int mtrr; /**< MTRR slot used */ 244 int mtrr; /**< MTRR slot used */
245 /* Private data */ 245 /* Private data */
246} drm_map_t; 246};
247 247
248/** 248/**
249 * DRM_IOCTL_GET_CLIENT ioctl argument type. 249 * DRM_IOCTL_GET_CLIENT ioctl argument type.
250 */ 250 */
251typedef struct drm_client { 251struct drm_client {
252 int idx; /**< Which client desired? */ 252 int idx; /**< Which client desired? */
253 int auth; /**< Is client authenticated? */ 253 int auth; /**< Is client authenticated? */
254 unsigned long pid; /**< Process ID */ 254 unsigned long pid; /**< Process ID */
255 unsigned long uid; /**< User ID */ 255 unsigned long uid; /**< User ID */
256 unsigned long magic; /**< Magic */ 256 unsigned long magic; /**< Magic */
257 unsigned long iocs; /**< Ioctl count */ 257 unsigned long iocs; /**< Ioctl count */
258} drm_client_t; 258};
259 259
260typedef enum { 260enum drm_stat_type {
261 _DRM_STAT_LOCK, 261 _DRM_STAT_LOCK,
262 _DRM_STAT_OPENS, 262 _DRM_STAT_OPENS,
263 _DRM_STAT_CLOSES, 263 _DRM_STAT_CLOSES,
@@ -275,23 +275,23 @@ typedef enum {
275 _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ 275 _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
276 _DRM_STAT_MISSED /**< Missed DMA opportunity */ 276 _DRM_STAT_MISSED /**< Missed DMA opportunity */
277 /* Add to the *END* of the list */ 277 /* Add to the *END* of the list */
278} drm_stat_type_t; 278};
279 279
280/** 280/**
281 * DRM_IOCTL_GET_STATS ioctl argument type. 281 * DRM_IOCTL_GET_STATS ioctl argument type.
282 */ 282 */
283typedef struct drm_stats { 283struct drm_stats {
284 unsigned long count; 284 unsigned long count;
285 struct { 285 struct {
286 unsigned long value; 286 unsigned long value;
287 drm_stat_type_t type; 287 enum drm_stat_type type;
288 } data[15]; 288 } data[15];
289} drm_stats_t; 289};
290 290
291/** 291/**
292 * Hardware locking flags. 292 * Hardware locking flags.
293 */ 293 */
294typedef enum drm_lock_flags { 294enum drm_lock_flags {
295 _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ 295 _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
296 _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ 296 _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
297 _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ 297 _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
@@ -301,17 +301,17 @@ typedef enum drm_lock_flags {
301 full-screen DGA-like mode. */ 301 full-screen DGA-like mode. */
302 _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ 302 _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
303 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ 303 _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
304} drm_lock_flags_t; 304};
305 305
306/** 306/**
307 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. 307 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
308 * 308 *
309 * \sa drmGetLock() and drmUnlock(). 309 * \sa drmGetLock() and drmUnlock().
310 */ 310 */
311typedef struct drm_lock { 311struct drm_lock {
312 int context; 312 int context;
313 drm_lock_flags_t flags; 313 enum drm_lock_flags flags;
314} drm_lock_t; 314};
315 315
316/** 316/**
317 * DMA flags 317 * DMA flags
@@ -321,7 +321,7 @@ typedef struct drm_lock {
321 * 321 *
322 * \sa drm_dma. 322 * \sa drm_dma.
323 */ 323 */
324typedef enum drm_dma_flags { 324enum drm_dma_flags {
325 /* Flags for DMA buffer dispatch */ 325 /* Flags for DMA buffer dispatch */
326 _DRM_DMA_BLOCK = 0x01, /**< 326 _DRM_DMA_BLOCK = 0x01, /**<
327 * Block until buffer dispatched. 327 * Block until buffer dispatched.
@@ -340,14 +340,14 @@ typedef enum drm_dma_flags {
340 _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ 340 _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
341 _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ 341 _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
342 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ 342 _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
343} drm_dma_flags_t; 343};
344 344
345/** 345/**
346 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. 346 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
347 * 347 *
348 * \sa drmAddBufs(). 348 * \sa drmAddBufs().
349 */ 349 */
350typedef struct drm_buf_desc { 350struct drm_buf_desc {
351 int count; /**< Number of buffers of this size */ 351 int count; /**< Number of buffers of this size */
352 int size; /**< Size in bytes */ 352 int size; /**< Size in bytes */
353 int low_mark; /**< Low water mark */ 353 int low_mark; /**< Low water mark */
@@ -363,44 +363,44 @@ typedef struct drm_buf_desc {
363 * Start address of where the AGP buffers are 363 * Start address of where the AGP buffers are
364 * in the AGP aperture 364 * in the AGP aperture
365 */ 365 */
366} drm_buf_desc_t; 366};
367 367
368/** 368/**
369 * DRM_IOCTL_INFO_BUFS ioctl argument type. 369 * DRM_IOCTL_INFO_BUFS ioctl argument type.
370 */ 370 */
371typedef struct drm_buf_info { 371struct drm_buf_info {
372 int count; /**< Entries in list */ 372 int count; /**< Entries in list */
373 drm_buf_desc_t __user *list; 373 struct drm_buf_desc __user *list;
374} drm_buf_info_t; 374};
375 375
376/** 376/**
377 * DRM_IOCTL_FREE_BUFS ioctl argument type. 377 * DRM_IOCTL_FREE_BUFS ioctl argument type.
378 */ 378 */
379typedef struct drm_buf_free { 379struct drm_buf_free {
380 int count; 380 int count;
381 int __user *list; 381 int __user *list;
382} drm_buf_free_t; 382};
383 383
384/** 384/**
385 * Buffer information 385 * Buffer information
386 * 386 *
387 * \sa drm_buf_map. 387 * \sa drm_buf_map.
388 */ 388 */
389typedef struct drm_buf_pub { 389struct drm_buf_pub {
390 int idx; /**< Index into the master buffer list */ 390 int idx; /**< Index into the master buffer list */
391 int total; /**< Buffer size */ 391 int total; /**< Buffer size */
392 int used; /**< Amount of buffer in use (for DMA) */ 392 int used; /**< Amount of buffer in use (for DMA) */
393 void __user *address; /**< Address of buffer */ 393 void __user *address; /**< Address of buffer */
394} drm_buf_pub_t; 394};
395 395
396/** 396/**
397 * DRM_IOCTL_MAP_BUFS ioctl argument type. 397 * DRM_IOCTL_MAP_BUFS ioctl argument type.
398 */ 398 */
399typedef struct drm_buf_map { 399struct drm_buf_map {
400 int count; /**< Length of the buffer list */ 400 int count; /**< Length of the buffer list */
401 void __user *virtual; /**< Mmap'd area in user-virtual */ 401 void __user *virtual; /**< Mmap'd area in user-virtual */
402 drm_buf_pub_t __user *list; /**< Buffer information */ 402 struct drm_buf_pub __user *list; /**< Buffer information */
403} drm_buf_map_t; 403};
404 404
405/** 405/**
406 * DRM_IOCTL_DMA ioctl argument type. 406 * DRM_IOCTL_DMA ioctl argument type.
@@ -409,48 +409,48 @@ typedef struct drm_buf_map {
409 * 409 *
410 * \sa drmDMA(). 410 * \sa drmDMA().
411 */ 411 */
412typedef struct drm_dma { 412struct drm_dma {
413 int context; /**< Context handle */ 413 int context; /**< Context handle */
414 int send_count; /**< Number of buffers to send */ 414 int send_count; /**< Number of buffers to send */
415 int __user *send_indices; /**< List of handles to buffers */ 415 int __user *send_indices; /**< List of handles to buffers */
416 int __user *send_sizes; /**< Lengths of data to send */ 416 int __user *send_sizes; /**< Lengths of data to send */
417 drm_dma_flags_t flags; /**< Flags */ 417 enum drm_dma_flags flags; /**< Flags */
418 int request_count; /**< Number of buffers requested */ 418 int request_count; /**< Number of buffers requested */
419 int request_size; /**< Desired size for buffers */ 419 int request_size; /**< Desired size for buffers */
420 int __user *request_indices; /**< Buffer information */ 420 int __user *request_indices; /**< Buffer information */
421 int __user *request_sizes; 421 int __user *request_sizes;
422 int granted_count; /**< Number of buffers granted */ 422 int granted_count; /**< Number of buffers granted */
423} drm_dma_t; 423};
424 424
425typedef enum { 425enum drm_ctx_flags {
426 _DRM_CONTEXT_PRESERVED = 0x01, 426 _DRM_CONTEXT_PRESERVED = 0x01,
427 _DRM_CONTEXT_2DONLY = 0x02 427 _DRM_CONTEXT_2DONLY = 0x02
428} drm_ctx_flags_t; 428};
429 429
430/** 430/**
431 * DRM_IOCTL_ADD_CTX ioctl argument type. 431 * DRM_IOCTL_ADD_CTX ioctl argument type.
432 * 432 *
433 * \sa drmCreateContext() and drmDestroyContext(). 433 * \sa drmCreateContext() and drmDestroyContext().
434 */ 434 */
435typedef struct drm_ctx { 435struct drm_ctx {
436 drm_context_t handle; 436 drm_context_t handle;
437 drm_ctx_flags_t flags; 437 enum drm_ctx_flags flags;
438} drm_ctx_t; 438};
439 439
440/** 440/**
441 * DRM_IOCTL_RES_CTX ioctl argument type. 441 * DRM_IOCTL_RES_CTX ioctl argument type.
442 */ 442 */
443typedef struct drm_ctx_res { 443struct drm_ctx_res {
444 int count; 444 int count;
445 drm_ctx_t __user *contexts; 445 struct drm_ctx __user *contexts;
446} drm_ctx_res_t; 446};
447 447
448/** 448/**
449 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. 449 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
450 */ 450 */
451typedef struct drm_draw { 451struct drm_draw {
452 drm_drawable_t handle; 452 drm_drawable_t handle;
453} drm_draw_t; 453};
454 454
455/** 455/**
456 * DRM_IOCTL_UPDATE_DRAW ioctl argument type. 456 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
@@ -459,52 +459,52 @@ typedef enum {
459 DRM_DRAWABLE_CLIPRECTS, 459 DRM_DRAWABLE_CLIPRECTS,
460} drm_drawable_info_type_t; 460} drm_drawable_info_type_t;
461 461
462typedef struct drm_update_draw { 462struct drm_update_draw {
463 drm_drawable_t handle; 463 drm_drawable_t handle;
464 unsigned int type; 464 unsigned int type;
465 unsigned int num; 465 unsigned int num;
466 unsigned long long data; 466 unsigned long long data;
467} drm_update_draw_t; 467};
468 468
469/** 469/**
470 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. 470 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
471 */ 471 */
472typedef struct drm_auth { 472struct drm_auth {
473 drm_magic_t magic; 473 drm_magic_t magic;
474} drm_auth_t; 474};
475 475
476/** 476/**
477 * DRM_IOCTL_IRQ_BUSID ioctl argument type. 477 * DRM_IOCTL_IRQ_BUSID ioctl argument type.
478 * 478 *
479 * \sa drmGetInterruptFromBusID(). 479 * \sa drmGetInterruptFromBusID().
480 */ 480 */
481typedef struct drm_irq_busid { 481struct drm_irq_busid {
482 int irq; /**< IRQ number */ 482 int irq; /**< IRQ number */
483 int busnum; /**< bus number */ 483 int busnum; /**< bus number */
484 int devnum; /**< device number */ 484 int devnum; /**< device number */
485 int funcnum; /**< function number */ 485 int funcnum; /**< function number */
486} drm_irq_busid_t; 486};
487 487
488typedef enum { 488enum drm_vblank_seq_type {
489 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ 489 _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
490 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ 490 _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
491 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ 491 _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
492 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ 492 _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
493 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ 493 _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
494} drm_vblank_seq_type_t; 494};
495 495
496#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) 496#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
497#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \ 497#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \
498 _DRM_VBLANK_NEXTONMISS) 498 _DRM_VBLANK_NEXTONMISS)
499 499
500struct drm_wait_vblank_request { 500struct drm_wait_vblank_request {
501 drm_vblank_seq_type_t type; 501 enum drm_vblank_seq_type type;
502 unsigned int sequence; 502 unsigned int sequence;
503 unsigned long signal; 503 unsigned long signal;
504}; 504};
505 505
506struct drm_wait_vblank_reply { 506struct drm_wait_vblank_reply {
507 drm_vblank_seq_type_t type; 507 enum drm_vblank_seq_type type;
508 unsigned int sequence; 508 unsigned int sequence;
509 long tval_sec; 509 long tval_sec;
510 long tval_usec; 510 long tval_usec;
@@ -515,41 +515,41 @@ struct drm_wait_vblank_reply {
515 * 515 *
516 * \sa drmWaitVBlank(). 516 * \sa drmWaitVBlank().
517 */ 517 */
518typedef union drm_wait_vblank { 518union drm_wait_vblank {
519 struct drm_wait_vblank_request request; 519 struct drm_wait_vblank_request request;
520 struct drm_wait_vblank_reply reply; 520 struct drm_wait_vblank_reply reply;
521} drm_wait_vblank_t; 521};
522 522
523/** 523/**
524 * DRM_IOCTL_AGP_ENABLE ioctl argument type. 524 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
525 * 525 *
526 * \sa drmAgpEnable(). 526 * \sa drmAgpEnable().
527 */ 527 */
528typedef struct drm_agp_mode { 528struct drm_agp_mode {
529 unsigned long mode; /**< AGP mode */ 529 unsigned long mode; /**< AGP mode */
530} drm_agp_mode_t; 530};
531 531
532/** 532/**
533 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. 533 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
534 * 534 *
535 * \sa drmAgpAlloc() and drmAgpFree(). 535 * \sa drmAgpAlloc() and drmAgpFree().
536 */ 536 */
537typedef struct drm_agp_buffer { 537struct drm_agp_buffer {
538 unsigned long size; /**< In bytes -- will round to page boundary */ 538 unsigned long size; /**< In bytes -- will round to page boundary */
539 unsigned long handle; /**< Used for binding / unbinding */ 539 unsigned long handle; /**< Used for binding / unbinding */
540 unsigned long type; /**< Type of memory to allocate */ 540 unsigned long type; /**< Type of memory to allocate */
541 unsigned long physical; /**< Physical used by i810 */ 541 unsigned long physical; /**< Physical used by i810 */
542} drm_agp_buffer_t; 542};
543 543
544/** 544/**
545 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. 545 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
546 * 546 *
547 * \sa drmAgpBind() and drmAgpUnbind(). 547 * \sa drmAgpBind() and drmAgpUnbind().
548 */ 548 */
549typedef struct drm_agp_binding { 549struct drm_agp_binding {
550 unsigned long handle; /**< From drm_agp_buffer */ 550 unsigned long handle; /**< From drm_agp_buffer */
551 unsigned long offset; /**< In bytes -- will round to page boundary */ 551 unsigned long offset; /**< In bytes -- will round to page boundary */
552} drm_agp_binding_t; 552};
553 553
554/** 554/**
555 * DRM_IOCTL_AGP_INFO ioctl argument type. 555 * DRM_IOCTL_AGP_INFO ioctl argument type.
@@ -558,7 +558,7 @@ typedef struct drm_agp_binding {
558 * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), 558 * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
559 * drmAgpVendorId() and drmAgpDeviceId(). 559 * drmAgpVendorId() and drmAgpDeviceId().
560 */ 560 */
561typedef struct drm_agp_info { 561struct drm_agp_info {
562 int agp_version_major; 562 int agp_version_major;
563 int agp_version_minor; 563 int agp_version_minor;
564 unsigned long mode; 564 unsigned long mode;
@@ -570,25 +570,25 @@ typedef struct drm_agp_info {
570 /* PCI information */ 570 /* PCI information */
571 unsigned short id_vendor; 571 unsigned short id_vendor;
572 unsigned short id_device; 572 unsigned short id_device;
573} drm_agp_info_t; 573};
574 574
575/** 575/**
576 * DRM_IOCTL_SG_ALLOC ioctl argument type. 576 * DRM_IOCTL_SG_ALLOC ioctl argument type.
577 */ 577 */
578typedef struct drm_scatter_gather { 578struct drm_scatter_gather {
579 unsigned long size; /**< In bytes -- will round to page boundary */ 579 unsigned long size; /**< In bytes -- will round to page boundary */
580 unsigned long handle; /**< Used for mapping / unmapping */ 580 unsigned long handle; /**< Used for mapping / unmapping */
581} drm_scatter_gather_t; 581};
582 582
583/** 583/**
584 * DRM_IOCTL_SET_VERSION ioctl argument type. 584 * DRM_IOCTL_SET_VERSION ioctl argument type.
585 */ 585 */
586typedef struct drm_set_version { 586struct drm_set_version {
587 int drm_di_major; 587 int drm_di_major;
588 int drm_di_minor; 588 int drm_di_minor;
589 int drm_dd_major; 589 int drm_dd_major;
590 int drm_dd_minor; 590 int drm_dd_minor;
591} drm_set_version_t; 591};
592 592
593#define DRM_IOCTL_BASE 'd' 593#define DRM_IOCTL_BASE 'd'
594#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) 594#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
@@ -596,61 +596,61 @@ typedef struct drm_set_version {
596#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) 596#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
597#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) 597#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
598 598
599#define DRM_IOCTL_VERSION DRM_IOWR(0x00, drm_version_t) 599#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
600#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t) 600#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
601#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, drm_auth_t) 601#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
602#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, drm_irq_busid_t) 602#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
603#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, drm_map_t) 603#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
604#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, drm_client_t) 604#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
605#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, drm_stats_t) 605#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
606#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, drm_set_version_t) 606#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
607 607
608#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm_unique_t) 608#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
609#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, drm_auth_t) 609#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
610#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, drm_block_t) 610#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
611#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, drm_block_t) 611#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
612#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, drm_control_t) 612#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
613#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, drm_map_t) 613#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
614#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, drm_buf_desc_t) 614#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
615#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, drm_buf_desc_t) 615#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
616#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm_buf_info_t) 616#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
617#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm_buf_map_t) 617#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
618#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm_buf_free_t) 618#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
619 619
620#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, drm_map_t) 620#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
621 621
622#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, drm_ctx_priv_map_t) 622#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
623#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, drm_ctx_priv_map_t) 623#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
624 624
625#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, drm_ctx_t) 625#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
626#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, drm_ctx_t) 626#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
627#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, drm_ctx_t) 627#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
628#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, drm_ctx_t) 628#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
629#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, drm_ctx_t) 629#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
630#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, drm_ctx_t) 630#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
631#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, drm_ctx_res_t) 631#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
632#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, drm_draw_t) 632#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
633#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, drm_draw_t) 633#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
634#define DRM_IOCTL_DMA DRM_IOWR(0x29, drm_dma_t) 634#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
635#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, drm_lock_t) 635#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
636#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, drm_lock_t) 636#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
637#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, drm_lock_t) 637#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
638 638
639#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) 639#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
640#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) 640#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
641#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, drm_agp_mode_t) 641#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
642#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, drm_agp_info_t) 642#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
643#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, drm_agp_buffer_t) 643#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
644#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, drm_agp_buffer_t) 644#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
645#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, drm_agp_binding_t) 645#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
646#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, drm_agp_binding_t) 646#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
647 647
648#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, drm_scatter_gather_t) 648#define DRM_IOCTL_SG_ALLOC DRM_IOW( 0x38, struct drm_scatter_gather)
649#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, drm_scatter_gather_t) 649#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
650 650
651#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t) 651#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
652 652
653#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, drm_update_draw_t) 653#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
654 654
655/** 655/**
656 * Device specific ioctls should only be in their respective headers 656 * Device specific ioctls should only be in their respective headers
@@ -663,4 +663,49 @@ typedef struct drm_set_version {
663#define DRM_COMMAND_BASE 0x40 663#define DRM_COMMAND_BASE 0x40
664#define DRM_COMMAND_END 0xA0 664#define DRM_COMMAND_END 0xA0
665 665
666/* typedef area */
667#ifndef __KERNEL__
668typedef struct drm_clip_rect drm_clip_rect_t;
669typedef struct drm_drawable_info drm_drawable_info_t;
670typedef struct drm_tex_region drm_tex_region_t;
671typedef struct drm_hw_lock drm_hw_lock_t;
672typedef struct drm_version drm_version_t;
673typedef struct drm_unique drm_unique_t;
674typedef struct drm_list drm_list_t;
675typedef struct drm_block drm_block_t;
676typedef struct drm_control drm_control_t;
677typedef enum drm_map_type drm_map_type_t;
678typedef enum drm_map_flags drm_map_flags_t;
679typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
680typedef struct drm_map drm_map_t;
681typedef struct drm_client drm_client_t;
682typedef enum drm_stat_type drm_stat_type_t;
683typedef struct drm_stats drm_stats_t;
684typedef enum drm_lock_flags drm_lock_flags_t;
685typedef struct drm_lock drm_lock_t;
686typedef enum drm_dma_flags drm_dma_flags_t;
687typedef struct drm_buf_desc drm_buf_desc_t;
688typedef struct drm_buf_info drm_buf_info_t;
689typedef struct drm_buf_free drm_buf_free_t;
690typedef struct drm_buf_pub drm_buf_pub_t;
691typedef struct drm_buf_map drm_buf_map_t;
692typedef struct drm_dma drm_dma_t;
693typedef union drm_wait_vblank drm_wait_vblank_t;
694typedef struct drm_agp_mode drm_agp_mode_t;
695typedef enum drm_ctx_flags drm_ctx_flags_t;
696typedef struct drm_ctx drm_ctx_t;
697typedef struct drm_ctx_res drm_ctx_res_t;
698typedef struct drm_draw drm_draw_t;
699typedef struct drm_update_draw drm_update_draw_t;
700typedef struct drm_auth drm_auth_t;
701typedef struct drm_irq_busid drm_irq_busid_t;
702typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
703
704typedef struct drm_agp_buffer drm_agp_buffer_t;
705typedef struct drm_agp_binding drm_agp_binding_t;
706typedef struct drm_agp_info drm_agp_info_t;
707typedef struct drm_scatter_gather drm_scatter_gather_t;
708typedef struct drm_set_version drm_set_version_t;
709#endif
710
666#endif 711#endif
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 8634f7613620..a785f3e79b1c 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -395,7 +395,7 @@ typedef struct drm_queue {
395 atomic_t total_flushed; /**< Total flushes statistic */ 395 atomic_t total_flushed; /**< Total flushes statistic */
396 atomic_t total_locks; /**< Total locks statistics */ 396 atomic_t total_locks; /**< Total locks statistics */
397#endif 397#endif
398 drm_ctx_flags_t flags; /**< Context preserving and 2D-only */ 398 enum drm_ctx_flags flags; /**< Context preserving and 2D-only */
399 drm_waitlist_t waitlist; /**< Pending buffers */ 399 drm_waitlist_t waitlist; /**< Pending buffers */
400 wait_queue_head_t flush_queue; /**< Processes waiting until flush */ 400 wait_queue_head_t flush_queue; /**< Processes waiting until flush */
401} drm_queue_t; 401} drm_queue_t;
@@ -404,7 +404,7 @@ typedef struct drm_queue {
404 * Lock data. 404 * Lock data.
405 */ 405 */
406typedef struct drm_lock_data { 406typedef struct drm_lock_data {
407 drm_hw_lock_t *hw_lock; /**< Hardware lock */ 407 struct drm_hw_lock *hw_lock; /**< Hardware lock */
408 struct file *filp; /**< File descr of lock holder (0=kernel) */ 408 struct file *filp; /**< File descr of lock holder (0=kernel) */
409 wait_queue_head_t lock_queue; /**< Queue of blocked processes */ 409 wait_queue_head_t lock_queue; /**< Queue of blocked processes */
410 unsigned long lock_time; /**< Time of last lock in jiffies */ 410 unsigned long lock_time; /**< Time of last lock in jiffies */
@@ -477,7 +477,7 @@ typedef struct drm_sg_mem {
477 477
478typedef struct drm_sigdata { 478typedef struct drm_sigdata {
479 int context; 479 int context;
480 drm_hw_lock_t *lock; 480 struct drm_hw_lock *lock;
481} drm_sigdata_t; 481} drm_sigdata_t;
482 482
483/** 483/**
@@ -486,11 +486,11 @@ typedef struct drm_sigdata {
486typedef struct drm_map_list { 486typedef struct drm_map_list {
487 struct list_head head; /**< list head */ 487 struct list_head head; /**< list head */
488 drm_hash_item_t hash; 488 drm_hash_item_t hash;
489 drm_map_t *map; /**< mapping */ 489 struct drm_map *map; /**< mapping */
490 unsigned int user_token; 490 unsigned int user_token;
491} drm_map_list_t; 491} drm_map_list_t;
492 492
493typedef drm_map_t drm_local_map_t; 493typedef struct drm_map drm_local_map_t;
494 494
495/** 495/**
496 * Context handle list 496 * Context handle list
@@ -594,9 +594,10 @@ struct drm_driver {
594 struct file *filp); 594 struct file *filp);
595 void (*reclaim_buffers_idlelocked) (struct drm_device *dev, 595 void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
596 struct file * filp); 596 struct file * filp);
597 unsigned long (*get_map_ofs) (drm_map_t * map); 597 unsigned long (*get_map_ofs) (struct drm_map * map);
598 unsigned long (*get_reg_ofs) (struct drm_device * dev); 598 unsigned long (*get_reg_ofs) (struct drm_device * dev);
599 void (*set_version) (struct drm_device * dev, drm_set_version_t * sv); 599 void (*set_version) (struct drm_device * dev,
600 struct drm_set_version *sv);
600 601
601 int major; 602 int major;
602 int minor; 603 int minor;
@@ -656,7 +657,7 @@ typedef struct drm_device {
656 /** \name Performance counters */ 657 /** \name Performance counters */
657 /*@{ */ 658 /*@{ */
658 unsigned long counters; 659 unsigned long counters;
659 drm_stat_type_t types[15]; 660 enum drm_stat_type types[15];
660 atomic_t counts[15]; 661 atomic_t counts[15];
661 /*@} */ 662 /*@} */
662 663
@@ -679,7 +680,7 @@ typedef struct drm_device {
679 int ctx_count; /**< Number of context handles */ 680 int ctx_count; /**< Number of context handles */
680 struct mutex ctxlist_mutex; /**< For ctxlist */ 681 struct mutex ctxlist_mutex; /**< For ctxlist */
681 682
682 drm_map_t **context_sareas; /**< per-context SAREA's */ 683 struct drm_map **context_sareas; /**< per-context SAREA's */
683 int max_context; 684 int max_context;
684 685
685 struct list_head vmalist; /**< List of vmas (for debugging) */ 686 struct list_head vmalist; /**< List of vmas (for debugging) */
@@ -756,7 +757,7 @@ typedef struct drm_device {
756 unsigned int drw_bitfield_length; 757 unsigned int drw_bitfield_length;
757 u32 *drw_bitfield; 758 u32 *drw_bitfield;
758 unsigned int drw_info_length; 759 unsigned int drw_info_length;
759 drm_drawable_info_t **drw_info; 760 struct drm_drawable_info **drw_info;
760 /*@} */ 761 /*@} */
761} drm_device_t; 762} drm_device_t;
762 763
@@ -904,7 +905,7 @@ extern int drm_rmdraw(struct inode *inode, struct file *filp,
904 unsigned int cmd, unsigned long arg); 905 unsigned int cmd, unsigned long arg);
905extern int drm_update_drawable_info(struct inode *inode, struct file *filp, 906extern int drm_update_drawable_info(struct inode *inode, struct file *filp,
906 unsigned int cmd, unsigned long arg); 907 unsigned int cmd, unsigned long arg);
907extern drm_drawable_info_t *drm_get_drawable_info(drm_device_t *dev, 908extern struct drm_drawable_info *drm_get_drawable_info(drm_device_t *dev,
908 drm_drawable_t id); 909 drm_drawable_t id);
909 910
910 /* Authentication IOCTL support (drm_auth.h) */ 911 /* Authentication IOCTL support (drm_auth.h) */
@@ -932,11 +933,11 @@ extern int drm_i_have_hw_lock(struct file *filp);
932extern int drm_kernel_take_hw_lock(struct file *filp); 933extern int drm_kernel_take_hw_lock(struct file *filp);
933 934
934 /* Buffer management support (drm_bufs.h) */ 935 /* Buffer management support (drm_bufs.h) */
935extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request); 936extern int drm_addbufs_agp(drm_device_t * dev, struct drm_buf_desc * request);
936extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request); 937extern int drm_addbufs_pci(drm_device_t * dev, struct drm_buf_desc * request);
937extern int drm_addmap(drm_device_t * dev, unsigned int offset, 938extern int drm_addmap(drm_device_t * dev, unsigned int offset,
938 unsigned int size, drm_map_type_t type, 939 unsigned int size, enum drm_map_type type,
939 drm_map_flags_t flags, drm_local_map_t ** map_ptr); 940 enum drm_map_flags flags, drm_local_map_t ** map_ptr);
940extern int drm_addmap_ioctl(struct inode *inode, struct file *filp, 941extern int drm_addmap_ioctl(struct inode *inode, struct file *filp,
941 unsigned int cmd, unsigned long arg); 942 unsigned int cmd, unsigned long arg);
942extern int drm_rmmap(drm_device_t * dev, drm_local_map_t * map); 943extern int drm_rmmap(drm_device_t * dev, drm_local_map_t * map);
@@ -989,22 +990,22 @@ extern int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp,
989extern int drm_agp_release(drm_device_t * dev); 990extern int drm_agp_release(drm_device_t * dev);
990extern int drm_agp_release_ioctl(struct inode *inode, struct file *filp, 991extern int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
991 unsigned int cmd, unsigned long arg); 992 unsigned int cmd, unsigned long arg);
992extern int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode); 993extern int drm_agp_enable(drm_device_t * dev, struct drm_agp_mode mode);
993extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, 994extern int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
994 unsigned int cmd, unsigned long arg); 995 unsigned int cmd, unsigned long arg);
995extern int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info); 996extern int drm_agp_info(drm_device_t * dev, struct drm_agp_info * info);
996extern int drm_agp_info_ioctl(struct inode *inode, struct file *filp, 997extern int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
997 unsigned int cmd, unsigned long arg); 998 unsigned int cmd, unsigned long arg);
998extern int drm_agp_alloc(drm_device_t *dev, drm_agp_buffer_t *request); 999extern int drm_agp_alloc(drm_device_t *dev, struct drm_agp_buffer *request);
999extern int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp, 1000extern int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp,
1000 unsigned int cmd, unsigned long arg); 1001 unsigned int cmd, unsigned long arg);
1001extern int drm_agp_free(drm_device_t *dev, drm_agp_buffer_t *request); 1002extern int drm_agp_free(drm_device_t *dev, struct drm_agp_buffer *request);
1002extern int drm_agp_free_ioctl(struct inode *inode, struct file *filp, 1003extern int drm_agp_free_ioctl(struct inode *inode, struct file *filp,
1003 unsigned int cmd, unsigned long arg); 1004 unsigned int cmd, unsigned long arg);
1004extern int drm_agp_unbind(drm_device_t *dev, drm_agp_binding_t *request); 1005extern int drm_agp_unbind(drm_device_t *dev, struct drm_agp_binding *request);
1005extern int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, 1006extern int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
1006 unsigned int cmd, unsigned long arg); 1007 unsigned int cmd, unsigned long arg);
1007extern int drm_agp_bind(drm_device_t *dev, drm_agp_binding_t *request); 1008extern int drm_agp_bind(drm_device_t *dev, struct drm_agp_binding *request);
1008extern int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, 1009extern int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
1009 unsigned int cmd, unsigned long arg); 1010 unsigned int cmd, unsigned long arg);
1010extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, 1011extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge,
@@ -1137,7 +1138,7 @@ extern void *drm_calloc(size_t nmemb, size_t size, int area);
1137 1138
1138/*@}*/ 1139/*@}*/
1139 1140
1140extern unsigned long drm_core_get_map_ofs(drm_map_t * map); 1141extern unsigned long drm_core_get_map_ofs(struct drm_map * map);
1141extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev); 1142extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev);
1142 1143
1143#endif /* __KERNEL__ */ 1144#endif /* __KERNEL__ */
diff --git a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c
index 54c59e7ec7b6..d1a9e508af4b 100644
--- a/drivers/char/drm/drm_agpsupport.c
+++ b/drivers/char/drm/drm_agpsupport.c
@@ -48,7 +48,7 @@
48 * Verifies the AGP device has been initialized and acquired and fills in the 48 * Verifies the AGP device has been initialized and acquired and fills in the
49 * drm_agp_info structure with the information in drm_agp_head::agp_info. 49 * drm_agp_info structure with the information in drm_agp_head::agp_info.
50 */ 50 */
51int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info) 51int drm_agp_info(drm_device_t * dev, struct drm_agp_info * info)
52{ 52{
53 DRM_AGP_KERN *kern; 53 DRM_AGP_KERN *kern;
54 54
@@ -76,14 +76,14 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
76{ 76{
77 drm_file_t *priv = filp->private_data; 77 drm_file_t *priv = filp->private_data;
78 drm_device_t *dev = priv->head->dev; 78 drm_device_t *dev = priv->head->dev;
79 drm_agp_info_t info; 79 struct drm_agp_info info;
80 int err; 80 int err;
81 81
82 err = drm_agp_info(dev, &info); 82 err = drm_agp_info(dev, &info);
83 if (err) 83 if (err)
84 return err; 84 return err;
85 85
86 if (copy_to_user((drm_agp_info_t __user *) arg, &info, sizeof(info))) 86 if (copy_to_user((struct drm_agp_info __user *) arg, &info, sizeof(info)))
87 return -EFAULT; 87 return -EFAULT;
88 return 0; 88 return 0;
89} 89}
@@ -168,7 +168,7 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
168 * Verifies the AGP device has been acquired but not enabled, and calls 168 * Verifies the AGP device has been acquired but not enabled, and calls
169 * \c agp_enable. 169 * \c agp_enable.
170 */ 170 */
171int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode) 171int drm_agp_enable(drm_device_t * dev, struct drm_agp_mode mode)
172{ 172{
173 if (!dev->agp || !dev->agp->acquired) 173 if (!dev->agp || !dev->agp->acquired)
174 return -EINVAL; 174 return -EINVAL;
@@ -187,9 +187,9 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
187{ 187{
188 drm_file_t *priv = filp->private_data; 188 drm_file_t *priv = filp->private_data;
189 drm_device_t *dev = priv->head->dev; 189 drm_device_t *dev = priv->head->dev;
190 drm_agp_mode_t mode; 190 struct drm_agp_mode mode;
191 191
192 if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode))) 192 if (copy_from_user(&mode, (struct drm_agp_mode __user *) arg, sizeof(mode)))
193 return -EFAULT; 193 return -EFAULT;
194 194
195 return drm_agp_enable(dev, mode); 195 return drm_agp_enable(dev, mode);
@@ -207,7 +207,7 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
207 * Verifies the AGP device is present and has been acquired, allocates the 207 * Verifies the AGP device is present and has been acquired, allocates the
208 * memory via alloc_agp() and creates a drm_agp_mem entry for it. 208 * memory via alloc_agp() and creates a drm_agp_mem entry for it.
209 */ 209 */
210int drm_agp_alloc(drm_device_t *dev, drm_agp_buffer_t *request) 210int drm_agp_alloc(drm_device_t *dev, struct drm_agp_buffer *request)
211{ 211{
212 drm_agp_mem_t *entry; 212 drm_agp_mem_t *entry;
213 DRM_AGP_MEM *memory; 213 DRM_AGP_MEM *memory;
@@ -246,8 +246,8 @@ int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp,
246{ 246{
247 drm_file_t *priv = filp->private_data; 247 drm_file_t *priv = filp->private_data;
248 drm_device_t *dev = priv->head->dev; 248 drm_device_t *dev = priv->head->dev;
249 drm_agp_buffer_t request; 249 struct drm_agp_buffer request;
250 drm_agp_buffer_t __user *argp = (void __user *)arg; 250 struct drm_agp_buffer __user *argp = (void __user *)arg;
251 int err; 251 int err;
252 252
253 if (copy_from_user(&request, argp, sizeof(request))) 253 if (copy_from_user(&request, argp, sizeof(request)))
@@ -305,7 +305,7 @@ static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t * dev,
305 * Verifies the AGP device is present and acquired, looks-up the AGP memory 305 * Verifies the AGP device is present and acquired, looks-up the AGP memory
306 * entry and passes it to the unbind_agp() function. 306 * entry and passes it to the unbind_agp() function.
307 */ 307 */
308int drm_agp_unbind(drm_device_t *dev, drm_agp_binding_t *request) 308int drm_agp_unbind(drm_device_t *dev, struct drm_agp_binding *request)
309{ 309{
310 drm_agp_mem_t *entry; 310 drm_agp_mem_t *entry;
311 int ret; 311 int ret;
@@ -328,10 +328,10 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
328{ 328{
329 drm_file_t *priv = filp->private_data; 329 drm_file_t *priv = filp->private_data;
330 drm_device_t *dev = priv->head->dev; 330 drm_device_t *dev = priv->head->dev;
331 drm_agp_binding_t request; 331 struct drm_agp_binding request;
332 332
333 if (copy_from_user 333 if (copy_from_user
334 (&request, (drm_agp_binding_t __user *) arg, sizeof(request))) 334 (&request, (struct drm_agp_binding __user *) arg, sizeof(request)))
335 return -EFAULT; 335 return -EFAULT;
336 336
337 return drm_agp_unbind(dev, &request); 337 return drm_agp_unbind(dev, &request);
@@ -350,7 +350,7 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp,
350 * is currently bound into the GATT. Looks-up the AGP memory entry and passes 350 * is currently bound into the GATT. Looks-up the AGP memory entry and passes
351 * it to bind_agp() function. 351 * it to bind_agp() function.
352 */ 352 */
353int drm_agp_bind(drm_device_t *dev, drm_agp_binding_t *request) 353int drm_agp_bind(drm_device_t *dev, struct drm_agp_binding *request)
354{ 354{
355 drm_agp_mem_t *entry; 355 drm_agp_mem_t *entry;
356 int retcode; 356 int retcode;
@@ -377,10 +377,10 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
377{ 377{
378 drm_file_t *priv = filp->private_data; 378 drm_file_t *priv = filp->private_data;
379 drm_device_t *dev = priv->head->dev; 379 drm_device_t *dev = priv->head->dev;
380 drm_agp_binding_t request; 380 struct drm_agp_binding request;
381 381
382 if (copy_from_user 382 if (copy_from_user
383 (&request, (drm_agp_binding_t __user *) arg, sizeof(request))) 383 (&request, (struct drm_agp_binding __user *) arg, sizeof(request)))
384 return -EFAULT; 384 return -EFAULT;
385 385
386 return drm_agp_bind(dev, &request); 386 return drm_agp_bind(dev, &request);
@@ -400,7 +400,7 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp,
400 * unbind_agp(). Frees it via free_agp() as well as the entry itself 400 * unbind_agp(). Frees it via free_agp() as well as the entry itself
401 * and unlinks from the doubly linked list it's inserted in. 401 * and unlinks from the doubly linked list it's inserted in.
402 */ 402 */
403int drm_agp_free(drm_device_t *dev, drm_agp_buffer_t *request) 403int drm_agp_free(drm_device_t *dev, struct drm_agp_buffer *request)
404{ 404{
405 drm_agp_mem_t *entry; 405 drm_agp_mem_t *entry;
406 406
@@ -424,10 +424,10 @@ int drm_agp_free_ioctl(struct inode *inode, struct file *filp,
424{ 424{
425 drm_file_t *priv = filp->private_data; 425 drm_file_t *priv = filp->private_data;
426 drm_device_t *dev = priv->head->dev; 426 drm_device_t *dev = priv->head->dev;
427 drm_agp_buffer_t request; 427 struct drm_agp_buffer request;
428 428
429 if (copy_from_user 429 if (copy_from_user
430 (&request, (drm_agp_buffer_t __user *) arg, sizeof(request))) 430 (&request, (struct drm_agp_buffer __user *) arg, sizeof(request)))
431 return -EFAULT; 431 return -EFAULT;
432 432
433 return drm_agp_free(dev, &request); 433 return drm_agp_free(dev, &request);
diff --git a/drivers/char/drm/drm_auth.c b/drivers/char/drm/drm_auth.c
index c7b19d35bcd6..16e6f0e93b20 100644
--- a/drivers/char/drm/drm_auth.c
+++ b/drivers/char/drm/drm_auth.c
@@ -144,7 +144,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
144 static DEFINE_SPINLOCK(lock); 144 static DEFINE_SPINLOCK(lock);
145 drm_file_t *priv = filp->private_data; 145 drm_file_t *priv = filp->private_data;
146 drm_device_t *dev = priv->head->dev; 146 drm_device_t *dev = priv->head->dev;
147 drm_auth_t auth; 147 struct drm_auth auth;
148 148
149 /* Find unique magic */ 149 /* Find unique magic */
150 if (priv->magic) { 150 if (priv->magic) {
@@ -162,7 +162,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
162 } 162 }
163 163
164 DRM_DEBUG("%u\n", auth.magic); 164 DRM_DEBUG("%u\n", auth.magic);
165 if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth))) 165 if (copy_to_user((struct drm_auth __user *) arg, &auth, sizeof(auth)))
166 return -EFAULT; 166 return -EFAULT;
167 return 0; 167 return 0;
168} 168}
@@ -183,10 +183,10 @@ int drm_authmagic(struct inode *inode, struct file *filp,
183{ 183{
184 drm_file_t *priv = filp->private_data; 184 drm_file_t *priv = filp->private_data;
185 drm_device_t *dev = priv->head->dev; 185 drm_device_t *dev = priv->head->dev;
186 drm_auth_t auth; 186 struct drm_auth auth;
187 drm_file_t *file; 187 drm_file_t *file;
188 188
189 if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth))) 189 if (copy_from_user(&auth, (struct drm_auth __user *) arg, sizeof(auth)))
190 return -EFAULT; 190 return -EFAULT;
191 DRM_DEBUG("%u\n", auth.magic); 191 DRM_DEBUG("%u\n", auth.magic);
192 if ((file = drm_find_file(dev, auth.magic))) { 192 if ((file = drm_find_file(dev, auth.magic))) {
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index dac057879594..6678db2abd8e 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -102,10 +102,10 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash,
102 * applicable and if supported by the kernel. 102 * applicable and if supported by the kernel.
103 */ 103 */
104static int drm_addmap_core(drm_device_t * dev, unsigned int offset, 104static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
105 unsigned int size, drm_map_type_t type, 105 unsigned int size, enum drm_map_type type,
106 drm_map_flags_t flags, drm_map_list_t ** maplist) 106 enum drm_map_flags flags, drm_map_list_t ** maplist)
107{ 107{
108 drm_map_t *map; 108 struct drm_map *map;
109 drm_map_list_t *list; 109 drm_map_list_t *list;
110 drm_dma_handle_t *dmah; 110 drm_dma_handle_t *dmah;
111 unsigned long user_token; 111 unsigned long user_token;
@@ -311,8 +311,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
311 } 311 }
312 312
313int drm_addmap(drm_device_t * dev, unsigned int offset, 313int drm_addmap(drm_device_t * dev, unsigned int offset,
314 unsigned int size, drm_map_type_t type, 314 unsigned int size, enum drm_map_type type,
315 drm_map_flags_t flags, drm_local_map_t ** map_ptr) 315 enum drm_map_flags flags, drm_local_map_t ** map_ptr)
316{ 316{
317 drm_map_list_t *list; 317 drm_map_list_t *list;
318 int rc; 318 int rc;
@@ -330,9 +330,9 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
330{ 330{
331 drm_file_t *priv = filp->private_data; 331 drm_file_t *priv = filp->private_data;
332 drm_device_t *dev = priv->head->dev; 332 drm_device_t *dev = priv->head->dev;
333 drm_map_t map; 333 struct drm_map map;
334 drm_map_list_t *maplist; 334 drm_map_list_t *maplist;
335 drm_map_t __user *argp = (void __user *)arg; 335 struct drm_map __user *argp = (void __user *)arg;
336 int err; 336 int err;
337 337
338 if (!(filp->f_mode & 3)) 338 if (!(filp->f_mode & 3))
@@ -351,7 +351,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
351 if (err) 351 if (err)
352 return err; 352 return err;
353 353
354 if (copy_to_user(argp, maplist->map, sizeof(drm_map_t))) 354 if (copy_to_user(argp, maplist->map, sizeof(struct drm_map)))
355 return -EFAULT; 355 return -EFAULT;
356 356
357 /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */ 357 /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */
@@ -367,7 +367,7 @@ int drm_addmap_ioctl(struct inode *inode, struct file *filp,
367 * \param inode device inode. 367 * \param inode device inode.
368 * \param filp file pointer. 368 * \param filp file pointer.
369 * \param cmd command. 369 * \param cmd command.
370 * \param arg pointer to a drm_map_t structure. 370 * \param arg pointer to a struct drm_map structure.
371 * \return zero on success or a negative value on error. 371 * \return zero on success or a negative value on error.
372 * 372 *
373 * Searches the map on drm_device::maplist, removes it from the list, see if 373 * Searches the map on drm_device::maplist, removes it from the list, see if
@@ -451,12 +451,12 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
451{ 451{
452 drm_file_t *priv = filp->private_data; 452 drm_file_t *priv = filp->private_data;
453 drm_device_t *dev = priv->head->dev; 453 drm_device_t *dev = priv->head->dev;
454 drm_map_t request; 454 struct drm_map request;
455 drm_local_map_t *map = NULL; 455 drm_local_map_t *map = NULL;
456 drm_map_list_t *r_list; 456 drm_map_list_t *r_list;
457 int ret; 457 int ret;
458 458
459 if (copy_from_user(&request, (drm_map_t __user *) arg, sizeof(request))) { 459 if (copy_from_user(&request, (struct drm_map __user *) arg, sizeof(request))) {
460 return -EFAULT; 460 return -EFAULT;
461 } 461 }
462 462
@@ -542,14 +542,14 @@ static void drm_cleanup_buf_error(drm_device_t * dev, drm_buf_entry_t * entry)
542 * Add AGP buffers for DMA transfers. 542 * Add AGP buffers for DMA transfers.
543 * 543 *
544 * \param dev drm_device_t to which the buffers are to be added. 544 * \param dev drm_device_t to which the buffers are to be added.
545 * \param request pointer to a drm_buf_desc_t describing the request. 545 * \param request pointer to a struct drm_buf_desc describing the request.
546 * \return zero on success or a negative number on failure. 546 * \return zero on success or a negative number on failure.
547 * 547 *
548 * After some sanity checks creates a drm_buf structure for each buffer and 548 * After some sanity checks creates a drm_buf structure for each buffer and
549 * reallocates the buffer list of the same size order to accommodate the new 549 * reallocates the buffer list of the same size order to accommodate the new
550 * buffers. 550 * buffers.
551 */ 551 */
552int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request) 552int drm_addbufs_agp(drm_device_t * dev, struct drm_buf_desc * request)
553{ 553{
554 drm_device_dma_t *dma = dev->dma; 554 drm_device_dma_t *dma = dev->dma;
555 drm_buf_entry_t *entry; 555 drm_buf_entry_t *entry;
@@ -719,7 +719,7 @@ int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request)
719EXPORT_SYMBOL(drm_addbufs_agp); 719EXPORT_SYMBOL(drm_addbufs_agp);
720#endif /* __OS_HAS_AGP */ 720#endif /* __OS_HAS_AGP */
721 721
722int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request) 722int drm_addbufs_pci(drm_device_t * dev, struct drm_buf_desc * request)
723{ 723{
724 drm_device_dma_t *dma = dev->dma; 724 drm_device_dma_t *dma = dev->dma;
725 int count; 725 int count;
@@ -945,7 +945,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request)
945} 945}
946EXPORT_SYMBOL(drm_addbufs_pci); 946EXPORT_SYMBOL(drm_addbufs_pci);
947 947
948static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request) 948static int drm_addbufs_sg(drm_device_t * dev, struct drm_buf_desc * request)
949{ 949{
950 drm_device_dma_t *dma = dev->dma; 950 drm_device_dma_t *dma = dev->dma;
951 drm_buf_entry_t *entry; 951 drm_buf_entry_t *entry;
@@ -1107,7 +1107,7 @@ static int drm_addbufs_sg(drm_device_t * dev, drm_buf_desc_t * request)
1107 return 0; 1107 return 0;
1108} 1108}
1109 1109
1110static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) 1110static int drm_addbufs_fb(drm_device_t * dev, struct drm_buf_desc * request)
1111{ 1111{
1112 drm_device_dma_t *dma = dev->dma; 1112 drm_device_dma_t *dma = dev->dma;
1113 drm_buf_entry_t *entry; 1113 drm_buf_entry_t *entry;
@@ -1274,7 +1274,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1274 * \param inode device inode. 1274 * \param inode device inode.
1275 * \param filp file pointer. 1275 * \param filp file pointer.
1276 * \param cmd command. 1276 * \param cmd command.
1277 * \param arg pointer to a drm_buf_desc_t request. 1277 * \param arg pointer to a struct drm_buf_desc request.
1278 * \return zero on success or a negative number on failure. 1278 * \return zero on success or a negative number on failure.
1279 * 1279 *
1280 * According with the memory type specified in drm_buf_desc::flags and the 1280 * According with the memory type specified in drm_buf_desc::flags and the
@@ -1285,7 +1285,7 @@ static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)
1285int drm_addbufs(struct inode *inode, struct file *filp, 1285int drm_addbufs(struct inode *inode, struct file *filp,
1286 unsigned int cmd, unsigned long arg) 1286 unsigned int cmd, unsigned long arg)
1287{ 1287{
1288 drm_buf_desc_t request; 1288 struct drm_buf_desc request;
1289 drm_file_t *priv = filp->private_data; 1289 drm_file_t *priv = filp->private_data;
1290 drm_device_t *dev = priv->head->dev; 1290 drm_device_t *dev = priv->head->dev;
1291 int ret; 1291 int ret;
@@ -1293,7 +1293,7 @@ int drm_addbufs(struct inode *inode, struct file *filp,
1293 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) 1293 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
1294 return -EINVAL; 1294 return -EINVAL;
1295 1295
1296 if (copy_from_user(&request, (drm_buf_desc_t __user *) arg, 1296 if (copy_from_user(&request, (struct drm_buf_desc __user *) arg,
1297 sizeof(request))) 1297 sizeof(request)))
1298 return -EFAULT; 1298 return -EFAULT;
1299 1299
@@ -1340,8 +1340,8 @@ int drm_infobufs(struct inode *inode, struct file *filp,
1340 drm_file_t *priv = filp->private_data; 1340 drm_file_t *priv = filp->private_data;
1341 drm_device_t *dev = priv->head->dev; 1341 drm_device_t *dev = priv->head->dev;
1342 drm_device_dma_t *dma = dev->dma; 1342 drm_device_dma_t *dma = dev->dma;
1343 drm_buf_info_t request; 1343 struct drm_buf_info request;
1344 drm_buf_info_t __user *argp = (void __user *)arg; 1344 struct drm_buf_info __user *argp = (void __user *)arg;
1345 int i; 1345 int i;
1346 int count; 1346 int count;
1347 1347
@@ -1372,7 +1372,7 @@ int drm_infobufs(struct inode *inode, struct file *filp,
1372 if (request.count >= count) { 1372 if (request.count >= count) {
1373 for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { 1373 for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
1374 if (dma->bufs[i].buf_count) { 1374 if (dma->bufs[i].buf_count) {
1375 drm_buf_desc_t __user *to = 1375 struct drm_buf_desc __user *to =
1376 &request.list[count]; 1376 &request.list[count];
1377 drm_buf_entry_t *from = &dma->bufs[i]; 1377 drm_buf_entry_t *from = &dma->bufs[i];
1378 drm_freelist_t *list = &dma->bufs[i].freelist; 1378 drm_freelist_t *list = &dma->bufs[i].freelist;
@@ -1428,7 +1428,7 @@ int drm_markbufs(struct inode *inode, struct file *filp,
1428 drm_file_t *priv = filp->private_data; 1428 drm_file_t *priv = filp->private_data;
1429 drm_device_t *dev = priv->head->dev; 1429 drm_device_t *dev = priv->head->dev;
1430 drm_device_dma_t *dma = dev->dma; 1430 drm_device_dma_t *dma = dev->dma;
1431 drm_buf_desc_t request; 1431 struct drm_buf_desc request;
1432 int order; 1432 int order;
1433 drm_buf_entry_t *entry; 1433 drm_buf_entry_t *entry;
1434 1434
@@ -1439,7 +1439,7 @@ int drm_markbufs(struct inode *inode, struct file *filp,
1439 return -EINVAL; 1439 return -EINVAL;
1440 1440
1441 if (copy_from_user(&request, 1441 if (copy_from_user(&request,
1442 (drm_buf_desc_t __user *) arg, sizeof(request))) 1442 (struct drm_buf_desc __user *) arg, sizeof(request)))
1443 return -EFAULT; 1443 return -EFAULT;
1444 1444
1445 DRM_DEBUG("%d, %d, %d\n", 1445 DRM_DEBUG("%d, %d, %d\n",
@@ -1478,7 +1478,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
1478 drm_file_t *priv = filp->private_data; 1478 drm_file_t *priv = filp->private_data;
1479 drm_device_t *dev = priv->head->dev; 1479 drm_device_t *dev = priv->head->dev;
1480 drm_device_dma_t *dma = dev->dma; 1480 drm_device_dma_t *dma = dev->dma;
1481 drm_buf_free_t request; 1481 struct drm_buf_free request;
1482 int i; 1482 int i;
1483 int idx; 1483 int idx;
1484 drm_buf_t *buf; 1484 drm_buf_t *buf;
@@ -1490,7 +1490,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
1490 return -EINVAL; 1490 return -EINVAL;
1491 1491
1492 if (copy_from_user(&request, 1492 if (copy_from_user(&request,
1493 (drm_buf_free_t __user *) arg, sizeof(request))) 1493 (struct drm_buf_free __user *) arg, sizeof(request)))
1494 return -EFAULT; 1494 return -EFAULT;
1495 1495
1496 DRM_DEBUG("%d\n", request.count); 1496 DRM_DEBUG("%d\n", request.count);
@@ -1534,12 +1534,12 @@ int drm_mapbufs(struct inode *inode, struct file *filp,
1534 drm_file_t *priv = filp->private_data; 1534 drm_file_t *priv = filp->private_data;
1535 drm_device_t *dev = priv->head->dev; 1535 drm_device_t *dev = priv->head->dev;
1536 drm_device_dma_t *dma = dev->dma; 1536 drm_device_dma_t *dma = dev->dma;
1537 drm_buf_map_t __user *argp = (void __user *)arg; 1537 struct drm_buf_map __user *argp = (void __user *)arg;
1538 int retcode = 0; 1538 int retcode = 0;
1539 const int zero = 0; 1539 const int zero = 0;
1540 unsigned long virtual; 1540 unsigned long virtual;
1541 unsigned long address; 1541 unsigned long address;
1542 drm_buf_map_t request; 1542 struct drm_buf_map request;
1543 int i; 1543 int i;
1544 1544
1545 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) 1545 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
@@ -1565,7 +1565,7 @@ int drm_mapbufs(struct inode *inode, struct file *filp,
1565 && (dma->flags & _DRM_DMA_USE_SG)) 1565 && (dma->flags & _DRM_DMA_USE_SG))
1566 || (drm_core_check_feature(dev, DRIVER_FB_DMA) 1566 || (drm_core_check_feature(dev, DRIVER_FB_DMA)
1567 && (dma->flags & _DRM_DMA_USE_FB))) { 1567 && (dma->flags & _DRM_DMA_USE_FB))) {
1568 drm_map_t *map = dev->agp_buffer_map; 1568 struct drm_map *map = dev->agp_buffer_map;
1569 unsigned long token = dev->agp_buffer_token; 1569 unsigned long token = dev->agp_buffer_token;
1570 1570
1571 if (!map) { 1571 if (!map) {
diff --git a/drivers/char/drm/drm_context.c b/drivers/char/drm/drm_context.c
index e1f882dc55aa..283f8f2895cb 100644
--- a/drivers/char/drm/drm_context.c
+++ b/drivers/char/drm/drm_context.c
@@ -100,7 +100,7 @@ static int drm_ctxbitmap_next(drm_device_t * dev)
100 if ((bit + 1) > dev->max_context) { 100 if ((bit + 1) > dev->max_context) {
101 dev->max_context = (bit + 1); 101 dev->max_context = (bit + 1);
102 if (dev->context_sareas) { 102 if (dev->context_sareas) {
103 drm_map_t **ctx_sareas; 103 struct drm_map **ctx_sareas;
104 104
105 ctx_sareas = drm_realloc(dev->context_sareas, 105 ctx_sareas = drm_realloc(dev->context_sareas,
106 (dev->max_context - 106 (dev->max_context -
@@ -214,9 +214,9 @@ int drm_getsareactx(struct inode *inode, struct file *filp,
214{ 214{
215 drm_file_t *priv = filp->private_data; 215 drm_file_t *priv = filp->private_data;
216 drm_device_t *dev = priv->head->dev; 216 drm_device_t *dev = priv->head->dev;
217 drm_ctx_priv_map_t __user *argp = (void __user *)arg; 217 struct drm_ctx_priv_map __user *argp = (void __user *)arg;
218 drm_ctx_priv_map_t request; 218 struct drm_ctx_priv_map request;
219 drm_map_t *map; 219 struct drm_map *map;
220 drm_map_list_t *_entry; 220 drm_map_list_t *_entry;
221 221
222 if (copy_from_user(&request, argp, sizeof(request))) 222 if (copy_from_user(&request, argp, sizeof(request)))
@@ -265,12 +265,13 @@ int drm_setsareactx(struct inode *inode, struct file *filp,
265{ 265{
266 drm_file_t *priv = filp->private_data; 266 drm_file_t *priv = filp->private_data;
267 drm_device_t *dev = priv->head->dev; 267 drm_device_t *dev = priv->head->dev;
268 drm_ctx_priv_map_t request; 268 struct drm_ctx_priv_map request;
269 drm_map_t *map = NULL; 269 struct drm_map *map = NULL;
270 drm_map_list_t *r_list = NULL; 270 drm_map_list_t *r_list = NULL;
271 271
272 if (copy_from_user(&request, 272 if (copy_from_user(&request,
273 (drm_ctx_priv_map_t __user *) arg, sizeof(request))) 273 (struct drm_ctx_priv_map __user *) arg,
274 sizeof(request)))
274 return -EFAULT; 275 return -EFAULT;
275 276
276 mutex_lock(&dev->struct_mutex); 277 mutex_lock(&dev->struct_mutex);
@@ -370,9 +371,9 @@ static int drm_context_switch_complete(drm_device_t * dev, int new)
370int drm_resctx(struct inode *inode, struct file *filp, 371int drm_resctx(struct inode *inode, struct file *filp,
371 unsigned int cmd, unsigned long arg) 372 unsigned int cmd, unsigned long arg)
372{ 373{
373 drm_ctx_res_t res; 374 struct drm_ctx_res res;
374 drm_ctx_t __user *argp = (void __user *)arg; 375 struct drm_ctx_res __user *argp = (void __user *)arg;
375 drm_ctx_t ctx; 376 struct drm_ctx ctx;
376 int i; 377 int i;
377 378
378 if (copy_from_user(&res, argp, sizeof(res))) 379 if (copy_from_user(&res, argp, sizeof(res)))
@@ -410,8 +411,8 @@ int drm_addctx(struct inode *inode, struct file *filp,
410 drm_file_t *priv = filp->private_data; 411 drm_file_t *priv = filp->private_data;
411 drm_device_t *dev = priv->head->dev; 412 drm_device_t *dev = priv->head->dev;
412 drm_ctx_list_t *ctx_entry; 413 drm_ctx_list_t *ctx_entry;
413 drm_ctx_t __user *argp = (void __user *)arg; 414 struct drm_ctx __user *argp = (void __user *)arg;
414 drm_ctx_t ctx; 415 struct drm_ctx ctx;
415 416
416 if (copy_from_user(&ctx, argp, sizeof(ctx))) 417 if (copy_from_user(&ctx, argp, sizeof(ctx)))
417 return -EFAULT; 418 return -EFAULT;
@@ -475,8 +476,8 @@ int drm_modctx(struct inode *inode, struct file *filp,
475int drm_getctx(struct inode *inode, struct file *filp, 476int drm_getctx(struct inode *inode, struct file *filp,
476 unsigned int cmd, unsigned long arg) 477 unsigned int cmd, unsigned long arg)
477{ 478{
478 drm_ctx_t __user *argp = (void __user *)arg; 479 struct drm_ctx __user *argp = (void __user *)arg;
479 drm_ctx_t ctx; 480 struct drm_ctx ctx;
480 481
481 if (copy_from_user(&ctx, argp, sizeof(ctx))) 482 if (copy_from_user(&ctx, argp, sizeof(ctx)))
482 return -EFAULT; 483 return -EFAULT;
@@ -505,9 +506,9 @@ int drm_switchctx(struct inode *inode, struct file *filp,
505{ 506{
506 drm_file_t *priv = filp->private_data; 507 drm_file_t *priv = filp->private_data;
507 drm_device_t *dev = priv->head->dev; 508 drm_device_t *dev = priv->head->dev;
508 drm_ctx_t ctx; 509 struct drm_ctx ctx;
509 510
510 if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) 511 if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
511 return -EFAULT; 512 return -EFAULT;
512 513
513 DRM_DEBUG("%d\n", ctx.handle); 514 DRM_DEBUG("%d\n", ctx.handle);
@@ -530,9 +531,9 @@ int drm_newctx(struct inode *inode, struct file *filp,
530{ 531{
531 drm_file_t *priv = filp->private_data; 532 drm_file_t *priv = filp->private_data;
532 drm_device_t *dev = priv->head->dev; 533 drm_device_t *dev = priv->head->dev;
533 drm_ctx_t ctx; 534 struct drm_ctx ctx;
534 535
535 if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) 536 if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
536 return -EFAULT; 537 return -EFAULT;
537 538
538 DRM_DEBUG("%d\n", ctx.handle); 539 DRM_DEBUG("%d\n", ctx.handle);
@@ -557,9 +558,9 @@ int drm_rmctx(struct inode *inode, struct file *filp,
557{ 558{
558 drm_file_t *priv = filp->private_data; 559 drm_file_t *priv = filp->private_data;
559 drm_device_t *dev = priv->head->dev; 560 drm_device_t *dev = priv->head->dev;
560 drm_ctx_t ctx; 561 struct drm_ctx ctx;
561 562
562 if (copy_from_user(&ctx, (drm_ctx_t __user *) arg, sizeof(ctx))) 563 if (copy_from_user(&ctx, (struct drm_ctx __user *) arg, sizeof(ctx)))
563 return -EFAULT; 564 return -EFAULT;
564 565
565 DRM_DEBUG("%d\n", ctx.handle); 566 DRM_DEBUG("%d\n", ctx.handle);
diff --git a/drivers/char/drm/drm_drawable.c b/drivers/char/drm/drm_drawable.c
index b33313be2547..87dabd994618 100644
--- a/drivers/char/drm/drm_drawable.c
+++ b/drivers/char/drm/drm_drawable.c
@@ -47,9 +47,9 @@ int drm_adddraw(DRM_IOCTL_ARGS)
47 int i, j; 47 int i, j;
48 u32 *bitfield = dev->drw_bitfield; 48 u32 *bitfield = dev->drw_bitfield;
49 unsigned int bitfield_length = dev->drw_bitfield_length; 49 unsigned int bitfield_length = dev->drw_bitfield_length;
50 drm_drawable_info_t **info = dev->drw_info; 50 struct drm_drawable_info **info = dev->drw_info;
51 unsigned int info_length = dev->drw_info_length; 51 unsigned int info_length = dev->drw_info_length;
52 drm_draw_t draw; 52 struct drm_draw draw;
53 53
54 for (i = 0, j = 0; i < bitfield_length; i++) { 54 for (i = 0, j = 0; i < bitfield_length; i++) {
55 if (bitfield[i] == ~0) 55 if (bitfield[i] == ~0)
@@ -120,7 +120,7 @@ done:
120 120
121 spin_unlock_irqrestore(&dev->drw_lock, irqflags); 121 spin_unlock_irqrestore(&dev->drw_lock, irqflags);
122 122
123 DRM_COPY_TO_USER_IOCTL((drm_draw_t __user *)data, draw, sizeof(draw)); 123 DRM_COPY_TO_USER_IOCTL((struct drm_draw __user *)data, draw, sizeof(draw));
124 124
125 return 0; 125 return 0;
126} 126}
@@ -131,16 +131,16 @@ done:
131int drm_rmdraw(DRM_IOCTL_ARGS) 131int drm_rmdraw(DRM_IOCTL_ARGS)
132{ 132{
133 DRM_DEVICE; 133 DRM_DEVICE;
134 drm_draw_t draw; 134 struct drm_draw draw;
135 int id, idx; 135 int id, idx;
136 unsigned int shift; 136 unsigned int shift;
137 unsigned long irqflags; 137 unsigned long irqflags;
138 u32 *bitfield = dev->drw_bitfield; 138 u32 *bitfield = dev->drw_bitfield;
139 unsigned int bitfield_length = dev->drw_bitfield_length; 139 unsigned int bitfield_length = dev->drw_bitfield_length;
140 drm_drawable_info_t **info = dev->drw_info; 140 struct drm_drawable_info **info = dev->drw_info;
141 unsigned int info_length = dev->drw_info_length; 141 unsigned int info_length = dev->drw_info_length;
142 142
143 DRM_COPY_FROM_USER_IOCTL(draw, (drm_draw_t __user *) data, 143 DRM_COPY_FROM_USER_IOCTL(draw, (struct drm_draw __user *) data,
144 sizeof(draw)); 144 sizeof(draw));
145 145
146 id = draw.handle - 1; 146 id = draw.handle - 1;
@@ -161,7 +161,7 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
161 161
162 if (info[id]) { 162 if (info[id]) {
163 drm_free(info[id]->rects, info[id]->num_rects * 163 drm_free(info[id]->rects, info[id]->num_rects *
164 sizeof(drm_clip_rect_t), DRM_MEM_BUFS); 164 sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
165 drm_free(info[id], sizeof(**info), DRM_MEM_BUFS); 165 drm_free(info[id], sizeof(**info), DRM_MEM_BUFS);
166 } 166 }
167 167
@@ -230,15 +230,15 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
230 230
231int drm_update_drawable_info(DRM_IOCTL_ARGS) { 231int drm_update_drawable_info(DRM_IOCTL_ARGS) {
232 DRM_DEVICE; 232 DRM_DEVICE;
233 drm_update_draw_t update; 233 struct drm_update_draw update;
234 unsigned int id, idx, shift; 234 unsigned int id, idx, shift;
235 u32 *bitfield = dev->drw_bitfield; 235 u32 *bitfield = dev->drw_bitfield;
236 unsigned long irqflags, bitfield_length = dev->drw_bitfield_length; 236 unsigned long irqflags, bitfield_length = dev->drw_bitfield_length;
237 drm_drawable_info_t *info; 237 struct drm_drawable_info *info;
238 drm_clip_rect_t *rects; 238 struct drm_clip_rect *rects;
239 int err; 239 int err;
240 240
241 DRM_COPY_FROM_USER_IOCTL(update, (drm_update_draw_t __user *) data, 241 DRM_COPY_FROM_USER_IOCTL(update, (struct drm_update_draw __user *) data,
242 sizeof(update)); 242 sizeof(update));
243 243
244 id = update.handle - 1; 244 id = update.handle - 1;
@@ -254,7 +254,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
254 info = dev->drw_info[id]; 254 info = dev->drw_info[id];
255 255
256 if (!info) { 256 if (!info) {
257 info = drm_calloc(1, sizeof(drm_drawable_info_t), DRM_MEM_BUFS); 257 info = drm_calloc(1, sizeof(struct drm_drawable_info), DRM_MEM_BUFS);
258 258
259 if (!info) { 259 if (!info) {
260 DRM_ERROR("Failed to allocate drawable info memory\n"); 260 DRM_ERROR("Failed to allocate drawable info memory\n");
@@ -265,7 +265,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
265 switch (update.type) { 265 switch (update.type) {
266 case DRM_DRAWABLE_CLIPRECTS: 266 case DRM_DRAWABLE_CLIPRECTS:
267 if (update.num != info->num_rects) { 267 if (update.num != info->num_rects) {
268 rects = drm_alloc(update.num * sizeof(drm_clip_rect_t), 268 rects = drm_alloc(update.num * sizeof(struct drm_clip_rect),
269 DRM_MEM_BUFS); 269 DRM_MEM_BUFS);
270 } else 270 } else
271 rects = info->rects; 271 rects = info->rects;
@@ -277,7 +277,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
277 } 277 }
278 278
279 if (update.num && DRM_COPY_FROM_USER(rects, 279 if (update.num && DRM_COPY_FROM_USER(rects,
280 (drm_clip_rect_t __user *) 280 (struct drm_clip_rect __user *)
281 (unsigned long)update.data, 281 (unsigned long)update.data,
282 update.num * 282 update.num *
283 sizeof(*rects))) { 283 sizeof(*rects))) {
@@ -290,7 +290,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS) {
290 290
291 if (rects != info->rects) { 291 if (rects != info->rects) {
292 drm_free(info->rects, info->num_rects * 292 drm_free(info->rects, info->num_rects *
293 sizeof(drm_clip_rect_t), DRM_MEM_BUFS); 293 sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
294 } 294 }
295 295
296 info->rects = rects; 296 info->rects = rects;
@@ -314,7 +314,7 @@ error:
314 drm_free(info, sizeof(*info), DRM_MEM_BUFS); 314 drm_free(info, sizeof(*info), DRM_MEM_BUFS);
315 else if (rects != dev->drw_info[id]->rects) 315 else if (rects != dev->drw_info[id]->rects)
316 drm_free(rects, update.num * 316 drm_free(rects, update.num *
317 sizeof(drm_clip_rect_t), DRM_MEM_BUFS); 317 sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
318 318
319 return err; 319 return err;
320} 320}
@@ -322,7 +322,7 @@ error:
322/** 322/**
323 * Caller must hold the drawable spinlock! 323 * Caller must hold the drawable spinlock!
324 */ 324 */
325drm_drawable_info_t *drm_get_drawable_info(drm_device_t *dev, drm_drawable_t id) { 325struct drm_drawable_info *drm_get_drawable_info(drm_device_t *dev, drm_drawable_t id) {
326 u32 *bitfield = dev->drw_bitfield; 326 u32 *bitfield = dev->drw_bitfield;
327 unsigned int idx, shift; 327 unsigned int idx, shift;
328 328
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index 63e091071eb2..4036c7cf7c05 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -154,11 +154,11 @@ int drm_lastclose(drm_device_t * dev)
154 /* Free drawable information memory */ 154 /* Free drawable information memory */
155 for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield); 155 for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield);
156 i++) { 156 i++) {
157 drm_drawable_info_t *info = drm_get_drawable_info(dev, i); 157 struct drm_drawable_info *info = drm_get_drawable_info(dev, i);
158 158
159 if (info) { 159 if (info) {
160 drm_free(info->rects, info->num_rects * 160 drm_free(info->rects, info->num_rects *
161 sizeof(drm_clip_rect_t), DRM_MEM_BUFS); 161 sizeof(struct drm_clip_rect), DRM_MEM_BUFS);
162 drm_free(info, sizeof(*info), DRM_MEM_BUFS); 162 drm_free(info, sizeof(*info), DRM_MEM_BUFS);
163 } 163 }
164 } 164 }
@@ -432,8 +432,8 @@ static int drm_version(struct inode *inode, struct file *filp,
432{ 432{
433 drm_file_t *priv = filp->private_data; 433 drm_file_t *priv = filp->private_data;
434 drm_device_t *dev = priv->head->dev; 434 drm_device_t *dev = priv->head->dev;
435 drm_version_t __user *argp = (void __user *)arg; 435 struct drm_version __user *argp = (void __user *)arg;
436 drm_version_t version; 436 struct drm_version version;
437 int len; 437 int len;
438 438
439 if (copy_from_user(&version, argp, sizeof(version))) 439 if (copy_from_user(&version, argp, sizeof(version)))
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
index 96b982f1f4a4..afc355318f6a 100644
--- a/drivers/char/drm/drm_ioctl.c
+++ b/drivers/char/drm/drm_ioctl.c
@@ -54,8 +54,8 @@ int drm_getunique(struct inode *inode, struct file *filp,
54{ 54{
55 drm_file_t *priv = filp->private_data; 55 drm_file_t *priv = filp->private_data;
56 drm_device_t *dev = priv->head->dev; 56 drm_device_t *dev = priv->head->dev;
57 drm_unique_t __user *argp = (void __user *)arg; 57 struct drm_unique __user *argp = (void __user *)arg;
58 drm_unique_t u; 58 struct drm_unique u;
59 59
60 if (copy_from_user(&u, argp, sizeof(u))) 60 if (copy_from_user(&u, argp, sizeof(u)))
61 return -EFAULT; 61 return -EFAULT;
@@ -88,13 +88,13 @@ int drm_setunique(struct inode *inode, struct file *filp,
88{ 88{
89 drm_file_t *priv = filp->private_data; 89 drm_file_t *priv = filp->private_data;
90 drm_device_t *dev = priv->head->dev; 90 drm_device_t *dev = priv->head->dev;
91 drm_unique_t u; 91 struct drm_unique u;
92 int domain, bus, slot, func, ret; 92 int domain, bus, slot, func, ret;
93 93
94 if (dev->unique_len || dev->unique) 94 if (dev->unique_len || dev->unique)
95 return -EBUSY; 95 return -EBUSY;
96 96
97 if (copy_from_user(&u, (drm_unique_t __user *) arg, sizeof(u))) 97 if (copy_from_user(&u, (struct drm_unique __user *) arg, sizeof(u)))
98 return -EFAULT; 98 return -EFAULT;
99 99
100 if (!u.unique_len || u.unique_len > 1024) 100 if (!u.unique_len || u.unique_len > 1024)
@@ -186,8 +186,8 @@ int drm_getmap(struct inode *inode, struct file *filp,
186{ 186{
187 drm_file_t *priv = filp->private_data; 187 drm_file_t *priv = filp->private_data;
188 drm_device_t *dev = priv->head->dev; 188 drm_device_t *dev = priv->head->dev;
189 drm_map_t __user *argp = (void __user *)arg; 189 struct drm_map __user *argp = (void __user *)arg;
190 drm_map_t map; 190 struct drm_map map;
191 drm_map_list_t *r_list = NULL; 191 drm_map_list_t *r_list = NULL;
192 struct list_head *list; 192 struct list_head *list;
193 int idx; 193 int idx;
@@ -247,8 +247,8 @@ int drm_getclient(struct inode *inode, struct file *filp,
247{ 247{
248 drm_file_t *priv = filp->private_data; 248 drm_file_t *priv = filp->private_data;
249 drm_device_t *dev = priv->head->dev; 249 drm_device_t *dev = priv->head->dev;
250 drm_client_t __user *argp = (drm_client_t __user *)arg; 250 struct drm_client __user *argp = (struct drm_client __user *)arg;
251 drm_client_t client; 251 struct drm_client client;
252 drm_file_t *pt; 252 drm_file_t *pt;
253 int idx; 253 int idx;
254 int i; 254 int i;
@@ -296,7 +296,7 @@ int drm_getstats(struct inode *inode, struct file *filp,
296{ 296{
297 drm_file_t *priv = filp->private_data; 297 drm_file_t *priv = filp->private_data;
298 drm_device_t *dev = priv->head->dev; 298 drm_device_t *dev = priv->head->dev;
299 drm_stats_t stats; 299 struct drm_stats stats;
300 int i; 300 int i;
301 301
302 memset(&stats, 0, sizeof(stats)); 302 memset(&stats, 0, sizeof(stats));
@@ -316,7 +316,7 @@ int drm_getstats(struct inode *inode, struct file *filp,
316 316
317 mutex_unlock(&dev->struct_mutex); 317 mutex_unlock(&dev->struct_mutex);
318 318
319 if (copy_to_user((drm_stats_t __user *) arg, &stats, sizeof(stats))) 319 if (copy_to_user((struct drm_stats __user *) arg, &stats, sizeof(stats)))
320 return -EFAULT; 320 return -EFAULT;
321 return 0; 321 return 0;
322} 322}
@@ -335,10 +335,10 @@ int drm_getstats(struct inode *inode, struct file *filp,
335int drm_setversion(DRM_IOCTL_ARGS) 335int drm_setversion(DRM_IOCTL_ARGS)
336{ 336{
337 DRM_DEVICE; 337 DRM_DEVICE;
338 drm_set_version_t sv; 338 struct drm_set_version sv;
339 drm_set_version_t retv; 339 struct drm_set_version retv;
340 int if_version; 340 int if_version;
341 drm_set_version_t __user *argp = (void __user *)data; 341 struct drm_set_version __user *argp = (void __user *)data;
342 int ret; 342 int ret;
343 343
344 if (copy_from_user(&sv, argp, sizeof(sv))) 344 if (copy_from_user(&sv, argp, sizeof(sv)))
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c
index ae3053ce7b2c..6b2b3d626ced 100644
--- a/drivers/char/drm/drm_irq.c
+++ b/drivers/char/drm/drm_irq.c
@@ -55,8 +55,8 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp,
55{ 55{
56 drm_file_t *priv = filp->private_data; 56 drm_file_t *priv = filp->private_data;
57 drm_device_t *dev = priv->head->dev; 57 drm_device_t *dev = priv->head->dev;
58 drm_irq_busid_t __user *argp = (void __user *)arg; 58 struct drm_irq_busid __user *argp = (void __user *)arg;
59 drm_irq_busid_t p; 59 struct drm_irq_busid p;
60 60
61 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) 61 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
62 return -EINVAL; 62 return -EINVAL;
@@ -199,11 +199,11 @@ int drm_control(struct inode *inode, struct file *filp,
199{ 199{
200 drm_file_t *priv = filp->private_data; 200 drm_file_t *priv = filp->private_data;
201 drm_device_t *dev = priv->head->dev; 201 drm_device_t *dev = priv->head->dev;
202 drm_control_t ctl; 202 struct drm_control ctl;
203 203
204 /* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */ 204 /* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */
205 205
206 if (copy_from_user(&ctl, (drm_control_t __user *) arg, sizeof(ctl))) 206 if (copy_from_user(&ctl, (struct drm_control __user *) arg, sizeof(ctl)))
207 return -EFAULT; 207 return -EFAULT;
208 208
209 switch (ctl.func) { 209 switch (ctl.func) {
@@ -246,8 +246,8 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)
246{ 246{
247 drm_file_t *priv = filp->private_data; 247 drm_file_t *priv = filp->private_data;
248 drm_device_t *dev = priv->head->dev; 248 drm_device_t *dev = priv->head->dev;
249 drm_wait_vblank_t __user *argp = (void __user *)data; 249 union drm_wait_vblank __user *argp = (void __user *)data;
250 drm_wait_vblank_t vblwait; 250 union drm_wait_vblank vblwait;
251 struct timeval now; 251 struct timeval now;
252 int ret = 0; 252 int ret = 0;
253 unsigned int flags, seq; 253 unsigned int flags, seq;
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c
index befd1af19dfe..62f12e745249 100644
--- a/drivers/char/drm/drm_lock.c
+++ b/drivers/char/drm/drm_lock.c
@@ -54,12 +54,12 @@ int drm_lock(struct inode *inode, struct file *filp,
54 drm_file_t *priv = filp->private_data; 54 drm_file_t *priv = filp->private_data;
55 drm_device_t *dev = priv->head->dev; 55 drm_device_t *dev = priv->head->dev;
56 DECLARE_WAITQUEUE(entry, current); 56 DECLARE_WAITQUEUE(entry, current);
57 drm_lock_t lock; 57 struct drm_lock lock;
58 int ret = 0; 58 int ret = 0;
59 59
60 ++priv->lock_count; 60 ++priv->lock_count;
61 61
62 if (copy_from_user(&lock, (drm_lock_t __user *) arg, sizeof(lock))) 62 if (copy_from_user(&lock, (struct drm_lock __user *) arg, sizeof(lock)))
63 return -EFAULT; 63 return -EFAULT;
64 64
65 if (lock.context == DRM_KERNEL_CONTEXT) { 65 if (lock.context == DRM_KERNEL_CONTEXT) {
@@ -154,10 +154,10 @@ int drm_unlock(struct inode *inode, struct file *filp,
154{ 154{
155 drm_file_t *priv = filp->private_data; 155 drm_file_t *priv = filp->private_data;
156 drm_device_t *dev = priv->head->dev; 156 drm_device_t *dev = priv->head->dev;
157 drm_lock_t lock; 157 struct drm_lock lock;
158 unsigned long irqflags; 158 unsigned long irqflags;
159 159
160 if (copy_from_user(&lock, (drm_lock_t __user *) arg, sizeof(lock))) 160 if (copy_from_user(&lock, (struct drm_lock __user *) arg, sizeof(lock)))
161 return -EFAULT; 161 return -EFAULT;
162 162
163 if (lock.context == DRM_KERNEL_CONTEXT) { 163 if (lock.context == DRM_KERNEL_CONTEXT) {
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c
index 1b1735ab3fbf..0bd935768ce2 100644
--- a/drivers/char/drm/drm_proc.c
+++ b/drivers/char/drm/drm_proc.c
@@ -207,7 +207,7 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
207{ 207{
208 drm_device_t *dev = (drm_device_t *) data; 208 drm_device_t *dev = (drm_device_t *) data;
209 int len = 0; 209 int len = 0;
210 drm_map_t *map; 210 struct drm_map *map;
211 drm_map_list_t *r_list; 211 drm_map_list_t *r_list;
212 212
213 /* Hardcoded from _DRM_FRAME_BUFFER, 213 /* Hardcoded from _DRM_FRAME_BUFFER,
diff --git a/drivers/char/drm/drm_sarea.h b/drivers/char/drm/drm_sarea.h
index e94297b751b8..6964d1e9bb3a 100644
--- a/drivers/char/drm/drm_sarea.h
+++ b/drivers/char/drm/drm_sarea.h
@@ -67,9 +67,9 @@ typedef struct drm_sarea_frame {
67/** SAREA */ 67/** SAREA */
68typedef struct drm_sarea { 68typedef struct drm_sarea {
69 /** first thing is always the DRM locking structure */ 69 /** first thing is always the DRM locking structure */
70 drm_hw_lock_t lock; 70 struct drm_hw_lock lock;
71 /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ 71 /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
72 drm_hw_lock_t drawable_lock; 72 struct drm_hw_lock drawable_lock;
73 drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ 73 drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
74 drm_sarea_frame_t frame; /**< frame */ 74 drm_sarea_frame_t frame; /**< frame */
75 drm_context_t dummy_context; 75 drm_context_t dummy_context;
diff --git a/drivers/char/drm/drm_scatter.c b/drivers/char/drm/drm_scatter.c
index 06ef7ddbe67d..6d8947a274ef 100644
--- a/drivers/char/drm/drm_scatter.c
+++ b/drivers/char/drm/drm_scatter.c
@@ -67,8 +67,8 @@ int drm_sg_alloc(struct inode *inode, struct file *filp,
67{ 67{
68 drm_file_t *priv = filp->private_data; 68 drm_file_t *priv = filp->private_data;
69 drm_device_t *dev = priv->head->dev; 69 drm_device_t *dev = priv->head->dev;
70 drm_scatter_gather_t __user *argp = (void __user *)arg; 70 struct drm_scatter_gather __user *argp = (void __user *)arg;
71 drm_scatter_gather_t request; 71 struct drm_scatter_gather request;
72 drm_sg_mem_t *entry; 72 drm_sg_mem_t *entry;
73 unsigned long pages, i, j; 73 unsigned long pages, i, j;
74 74
@@ -203,14 +203,14 @@ int drm_sg_free(struct inode *inode, struct file *filp,
203{ 203{
204 drm_file_t *priv = filp->private_data; 204 drm_file_t *priv = filp->private_data;
205 drm_device_t *dev = priv->head->dev; 205 drm_device_t *dev = priv->head->dev;
206 drm_scatter_gather_t request; 206 struct drm_scatter_gather request;
207 drm_sg_mem_t *entry; 207 drm_sg_mem_t *entry;
208 208
209 if (!drm_core_check_feature(dev, DRIVER_SG)) 209 if (!drm_core_check_feature(dev, DRIVER_SG))
210 return -EINVAL; 210 return -EINVAL;
211 211
212 if (copy_from_user(&request, 212 if (copy_from_user(&request,
213 (drm_scatter_gather_t __user *) arg, 213 (struct drm_scatter_gather __user *) arg,
214 sizeof(request))) 214 sizeof(request)))
215 return -EFAULT; 215 return -EFAULT;
216 216
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 948e60d272df..13bdb1393c36 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -81,7 +81,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
81{ 81{
82 drm_file_t *priv = vma->vm_file->private_data; 82 drm_file_t *priv = vma->vm_file->private_data;
83 drm_device_t *dev = priv->head->dev; 83 drm_device_t *dev = priv->head->dev;
84 drm_map_t *map = NULL; 84 struct drm_map *map = NULL;
85 drm_map_list_t *r_list; 85 drm_map_list_t *r_list;
86 drm_hash_item_t *hash; 86 drm_hash_item_t *hash;
87 87
@@ -163,7 +163,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma,
163static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, 163static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
164 unsigned long address) 164 unsigned long address)
165{ 165{
166 drm_map_t *map = (drm_map_t *) vma->vm_private_data; 166 struct drm_map *map = (struct drm_map *) vma->vm_private_data;
167 unsigned long offset; 167 unsigned long offset;
168 unsigned long i; 168 unsigned long i;
169 struct page *page; 169 struct page *page;
@@ -197,7 +197,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
197 drm_file_t *priv = vma->vm_file->private_data; 197 drm_file_t *priv = vma->vm_file->private_data;
198 drm_device_t *dev = priv->head->dev; 198 drm_device_t *dev = priv->head->dev;
199 drm_vma_entry_t *pt, *temp; 199 drm_vma_entry_t *pt, *temp;
200 drm_map_t *map; 200 struct drm_map *map;
201 drm_map_list_t *r_list; 201 drm_map_list_t *r_list;
202 int found_maps = 0; 202 int found_maps = 0;
203 203
@@ -310,7 +310,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma,
310static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma, 310static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma,
311 unsigned long address) 311 unsigned long address)
312{ 312{
313 drm_map_t *map = (drm_map_t *) vma->vm_private_data; 313 struct drm_map *map = (struct drm_map *) vma->vm_private_data;
314 drm_file_t *priv = vma->vm_file->private_data; 314 drm_file_t *priv = vma->vm_file->private_data;
315 drm_device_t *dev = priv->head->dev; 315 drm_device_t *dev = priv->head->dev;
316 drm_sg_mem_t *entry = dev->sg; 316 drm_sg_mem_t *entry = dev->sg;
@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
512 return 0; 512 return 0;
513} 513}
514 514
515unsigned long drm_core_get_map_ofs(drm_map_t * map) 515unsigned long drm_core_get_map_ofs(struct drm_map * map)
516{ 516{
517 return map->offset; 517 return map->offset;
518} 518}
@@ -547,7 +547,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
547{ 547{
548 drm_file_t *priv = filp->private_data; 548 drm_file_t *priv = filp->private_data;
549 drm_device_t *dev = priv->head->dev; 549 drm_device_t *dev = priv->head->dev;
550 drm_map_t *map = NULL; 550 struct drm_map *map = NULL;
551 unsigned long offset = 0; 551 unsigned long offset = 0;
552 drm_hash_item_t *hash; 552 drm_hash_item_t *hash;
553 553
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index 9ba114657c5e..977c74857383 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -397,11 +397,11 @@ static int i915_emit_cmds(drm_device_t * dev, int __user * buffer, int dwords)
397} 397}
398 398
399static int i915_emit_box(drm_device_t * dev, 399static int i915_emit_box(drm_device_t * dev,
400 drm_clip_rect_t __user * boxes, 400 struct drm_clip_rect __user * boxes,
401 int i, int DR1, int DR4) 401 int i, int DR1, int DR4)
402{ 402{
403 drm_i915_private_t *dev_priv = dev->dev_private; 403 drm_i915_private_t *dev_priv = dev->dev_private;
404 drm_clip_rect_t box; 404 struct drm_clip_rect box;
405 RING_LOCALS; 405 RING_LOCALS;
406 406
407 if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) { 407 if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) {
@@ -493,7 +493,7 @@ static int i915_dispatch_batchbuffer(drm_device_t * dev,
493 drm_i915_batchbuffer_t * batch) 493 drm_i915_batchbuffer_t * batch)
494{ 494{
495 drm_i915_private_t *dev_priv = dev->dev_private; 495 drm_i915_private_t *dev_priv = dev->dev_private;
496 drm_clip_rect_t __user *boxes = batch->cliprects; 496 struct drm_clip_rect __user *boxes = batch->cliprects;
497 int nbox = batch->num_cliprects; 497 int nbox = batch->num_cliprects;
498 int i = 0, count; 498 int i = 0, count;
499 RING_LOCALS; 499 RING_LOCALS;
@@ -625,7 +625,7 @@ static int i915_batchbuffer(DRM_IOCTL_ARGS)
625 625
626 if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects, 626 if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects,
627 batch.num_cliprects * 627 batch.num_cliprects *
628 sizeof(drm_clip_rect_t))) 628 sizeof(struct drm_clip_rect)))
629 return DRM_ERR(EFAULT); 629 return DRM_ERR(EFAULT);
630 630
631 ret = i915_dispatch_batchbuffer(dev, &batch); 631 ret = i915_dispatch_batchbuffer(dev, &batch);
@@ -655,7 +655,7 @@ static int i915_cmdbuffer(DRM_IOCTL_ARGS)
655 if (cmdbuf.num_cliprects && 655 if (cmdbuf.num_cliprects &&
656 DRM_VERIFYAREA_READ(cmdbuf.cliprects, 656 DRM_VERIFYAREA_READ(cmdbuf.cliprects,
657 cmdbuf.num_cliprects * 657 cmdbuf.num_cliprects *
658 sizeof(drm_clip_rect_t))) { 658 sizeof(struct drm_clip_rect))) {
659 DRM_ERROR("Fault accessing cliprects\n"); 659 DRM_ERROR("Fault accessing cliprects\n");
660 return DRM_ERR(EFAULT); 660 return DRM_ERR(EFAULT);
661 } 661 }
diff --git a/drivers/char/drm/i915_drm.h b/drivers/char/drm/i915_drm.h
index 7b7b68b96f31..05c66cf03a9e 100644
--- a/drivers/char/drm/i915_drm.h
+++ b/drivers/char/drm/i915_drm.h
@@ -64,7 +64,7 @@ typedef struct _drm_i915_init {
64} drm_i915_init_t; 64} drm_i915_init_t;
65 65
66typedef struct _drm_i915_sarea { 66typedef struct _drm_i915_sarea {
67 drm_tex_region_t texList[I915_NR_TEX_REGIONS + 1]; 67 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
68 int last_upload; /* last time texture was uploaded */ 68 int last_upload; /* last time texture was uploaded */
69 int last_enqueue; /* last time a buffer was enqueued */ 69 int last_enqueue; /* last time a buffer was enqueued */
70 int last_dispatch; /* age of the most recently dispatched buffer */ 70 int last_dispatch; /* age of the most recently dispatched buffer */
@@ -170,7 +170,7 @@ typedef struct _drm_i915_batchbuffer {
170 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ 170 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
171 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ 171 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
172 int num_cliprects; /* mulitpass with multiple cliprects? */ 172 int num_cliprects; /* mulitpass with multiple cliprects? */
173 drm_clip_rect_t __user *cliprects; /* pointer to userspace cliprects */ 173 struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
174} drm_i915_batchbuffer_t; 174} drm_i915_batchbuffer_t;
175 175
176/* As above, but pass a pointer to userspace buffer which can be 176/* As above, but pass a pointer to userspace buffer which can be
@@ -182,7 +182,7 @@ typedef struct _drm_i915_cmdbuffer {
182 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ 182 int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
183 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ 183 int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
184 int num_cliprects; /* mulitpass with multiple cliprects? */ 184 int num_cliprects; /* mulitpass with multiple cliprects? */
185 drm_clip_rect_t __user *cliprects; /* pointer to userspace cliprects */ 185 struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
186} drm_i915_cmdbuffer_t; 186} drm_i915_cmdbuffer_t;
187 187
188/* Userspace can request & wait on irq's: 188/* Userspace can request & wait on irq's:
@@ -259,7 +259,7 @@ typedef struct drm_i915_vblank_pipe {
259 */ 259 */
260typedef struct drm_i915_vblank_swap { 260typedef struct drm_i915_vblank_swap {
261 drm_drawable_t drawable; 261 drm_drawable_t drawable;
262 drm_vblank_seq_type_t seqtype; 262 enum drm_vblank_seq_type seqtype;
263 unsigned int sequence; 263 unsigned int sequence;
264} drm_i915_vblank_swap_t; 264} drm_i915_vblank_swap_t;
265 265
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index b92062a239f1..a5989315ec8c 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -50,7 +50,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
50 int nhits, nrects, slice[2], upper[2], lower[2], i; 50 int nhits, nrects, slice[2], upper[2], lower[2], i;
51 unsigned counter[2] = { atomic_read(&dev->vbl_received), 51 unsigned counter[2] = { atomic_read(&dev->vbl_received),
52 atomic_read(&dev->vbl_received2) }; 52 atomic_read(&dev->vbl_received2) };
53 drm_drawable_info_t *drw; 53 struct drm_drawable_info *drw;
54 drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv; 54 drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv;
55 u32 cpp = dev_priv->cpp; 55 u32 cpp = dev_priv->cpp;
56 u32 cmd = (cpp == 4) ? (XY_SRC_COPY_BLT_CMD | 56 u32 cmd = (cpp == 4) ? (XY_SRC_COPY_BLT_CMD |
@@ -95,7 +95,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
95 list_for_each(hit, &hits) { 95 list_for_each(hit, &hits) {
96 drm_i915_vbl_swap_t *swap_cmp = 96 drm_i915_vbl_swap_t *swap_cmp =
97 list_entry(hit, drm_i915_vbl_swap_t, head); 97 list_entry(hit, drm_i915_vbl_swap_t, head);
98 drm_drawable_info_t *drw_cmp = 98 struct drm_drawable_info *drw_cmp =
99 drm_get_drawable_info(dev, swap_cmp->drw_id); 99 drm_get_drawable_info(dev, swap_cmp->drw_id);
100 100
101 if (drw_cmp && 101 if (drw_cmp &&
@@ -160,7 +160,7 @@ static void i915_vblank_tasklet(drm_device_t *dev)
160 list_for_each(hit, &hits) { 160 list_for_each(hit, &hits) {
161 drm_i915_vbl_swap_t *swap_hit = 161 drm_i915_vbl_swap_t *swap_hit =
162 list_entry(hit, drm_i915_vbl_swap_t, head); 162 list_entry(hit, drm_i915_vbl_swap_t, head);
163 drm_clip_rect_t *rect; 163 struct drm_clip_rect *rect;
164 int num_rects, pipe; 164 int num_rects, pipe;
165 unsigned short top, bottom; 165 unsigned short top, bottom;
166 166
diff --git a/drivers/char/drm/i915_mem.c b/drivers/char/drm/i915_mem.c
index 52c67324df58..c0ee1dae82c3 100644
--- a/drivers/char/drm/i915_mem.c
+++ b/drivers/char/drm/i915_mem.c
@@ -47,7 +47,7 @@ static void mark_block(drm_device_t * dev, struct mem_block *p, int in_use)
47{ 47{
48 drm_i915_private_t *dev_priv = dev->dev_private; 48 drm_i915_private_t *dev_priv = dev->dev_private;
49 drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv; 49 drm_i915_sarea_t *sarea_priv = dev_priv->sarea_priv;
50 drm_tex_region_t *list; 50 struct drm_tex_region *list;
51 unsigned shift, nr; 51 unsigned shift, nr;
52 unsigned start; 52 unsigned start;
53 unsigned end; 53 unsigned end;
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c
index 28fbf3dda28d..4a517cc133b7 100644
--- a/drivers/char/drm/r300_cmdbuf.c
+++ b/drivers/char/drm/r300_cmdbuf.c
@@ -55,7 +55,7 @@ static const int r300_cliprect_cntl[4] = {
55static int r300_emit_cliprects(drm_radeon_private_t *dev_priv, 55static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
56 drm_radeon_kcmd_buffer_t *cmdbuf, int n) 56 drm_radeon_kcmd_buffer_t *cmdbuf, int n)
57{ 57{
58 drm_clip_rect_t box; 58 struct drm_clip_rect box;
59 int nr; 59 int nr;
60 int i; 60 int i;
61 RING_LOCALS; 61 RING_LOCALS;
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 7dd980055229..cfc5aa16de22 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -2171,7 +2171,7 @@ int radeon_wait_ring(drm_radeon_private_t * dev_priv, int n)
2171} 2171}
2172 2172
2173static int radeon_cp_get_buffers(DRMFILE filp, drm_device_t * dev, 2173static int radeon_cp_get_buffers(DRMFILE filp, drm_device_t * dev,
2174 drm_dma_t * d) 2174 struct drm_dma * d)
2175{ 2175{
2176 int i; 2176 int i;
2177 drm_buf_t *buf; 2177 drm_buf_t *buf;
@@ -2200,8 +2200,8 @@ int radeon_cp_buffers(DRM_IOCTL_ARGS)
2200 DRM_DEVICE; 2200 DRM_DEVICE;
2201 drm_device_dma_t *dma = dev->dma; 2201 drm_device_dma_t *dma = dev->dma;
2202 int ret = 0; 2202 int ret = 0;
2203 drm_dma_t __user *argp = (void __user *)data; 2203 struct drm_dma __user *argp = (void __user *)data;
2204 drm_dma_t d; 2204 struct drm_dma d;
2205 2205
2206 LOCK_TEST_WITH_RETURN(dev, filp); 2206 LOCK_TEST_WITH_RETURN(dev, filp);
2207 2207
diff --git a/drivers/char/drm/radeon_drm.h b/drivers/char/drm/radeon_drm.h
index 04de7a15df99..5a8e23f916fc 100644
--- a/drivers/char/drm/radeon_drm.h
+++ b/drivers/char/drm/radeon_drm.h
@@ -417,7 +417,7 @@ typedef struct {
417 417
418 /* The current cliprects, or a subset thereof. 418 /* The current cliprects, or a subset thereof.
419 */ 419 */
420 drm_clip_rect_t boxes[RADEON_NR_SAREA_CLIPRECTS]; 420 struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
421 unsigned int nbox; 421 unsigned int nbox;
422 422
423 /* Counters for client-side throttling of rendering clients. 423 /* Counters for client-side throttling of rendering clients.
@@ -426,7 +426,7 @@ typedef struct {
426 unsigned int last_dispatch; 426 unsigned int last_dispatch;
427 unsigned int last_clear; 427 unsigned int last_clear;
428 428
429 drm_tex_region_t tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS + 429 struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
430 1]; 430 1];
431 unsigned int tex_age[RADEON_NR_TEX_HEAPS]; 431 unsigned int tex_age[RADEON_NR_TEX_HEAPS];
432 int ctx_owner; 432 int ctx_owner;
@@ -604,7 +604,7 @@ typedef struct drm_radeon_cmd_buffer {
604 int bufsz; 604 int bufsz;
605 char __user *buf; 605 char __user *buf;
606 int nbox; 606 int nbox;
607 drm_clip_rect_t __user *boxes; 607 struct drm_clip_rect __user *boxes;
608} drm_radeon_cmd_buffer_t; 608} drm_radeon_cmd_buffer_t;
609 609
610typedef struct drm_radeon_tex_image { 610typedef struct drm_radeon_tex_image {
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index 4422ae3a68bc..e4b4e4be9bb5 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -303,7 +303,7 @@ typedef struct drm_radeon_kcmd_buffer {
303 int bufsz; 303 int bufsz;
304 char *buf; 304 char *buf;
305 int nbox; 305 int nbox;
306 drm_clip_rect_t __user *boxes; 306 struct drm_clip_rect __user *boxes;
307} drm_radeon_kcmd_buffer_t; 307} drm_radeon_kcmd_buffer_t;
308 308
309extern int radeon_no_wb; 309extern int radeon_no_wb;
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 5b89e471bc71..348a89e05812 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -421,7 +421,7 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t *
421 */ 421 */
422 422
423static __inline__ void radeon_emit_clip_rect(drm_radeon_private_t * dev_priv, 423static __inline__ void radeon_emit_clip_rect(drm_radeon_private_t * dev_priv,
424 drm_clip_rect_t * box) 424 struct drm_clip_rect * box)
425{ 425{
426 RING_LOCALS; 426 RING_LOCALS;
427 427
@@ -852,7 +852,7 @@ static void radeon_cp_dispatch_clear(drm_device_t * dev,
852 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; 852 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
853 drm_radeon_depth_clear_t *depth_clear = &dev_priv->depth_clear; 853 drm_radeon_depth_clear_t *depth_clear = &dev_priv->depth_clear;
854 int nbox = sarea_priv->nbox; 854 int nbox = sarea_priv->nbox;
855 drm_clip_rect_t *pbox = sarea_priv->boxes; 855 struct drm_clip_rect *pbox = sarea_priv->boxes;
856 unsigned int flags = clear->flags; 856 unsigned int flags = clear->flags;
857 u32 rb3d_cntl = 0, rb3d_stencilrefmask = 0; 857 u32 rb3d_cntl = 0, rb3d_stencilrefmask = 0;
858 int i; 858 int i;
@@ -1340,7 +1340,7 @@ static void radeon_cp_dispatch_swap(drm_device_t * dev)
1340 drm_radeon_private_t *dev_priv = dev->dev_private; 1340 drm_radeon_private_t *dev_priv = dev->dev_private;
1341 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; 1341 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
1342 int nbox = sarea_priv->nbox; 1342 int nbox = sarea_priv->nbox;
1343 drm_clip_rect_t *pbox = sarea_priv->boxes; 1343 struct drm_clip_rect *pbox = sarea_priv->boxes;
1344 int i; 1344 int i;
1345 RING_LOCALS; 1345 RING_LOCALS;
1346 DRM_DEBUG("\n"); 1346 DRM_DEBUG("\n");
@@ -2760,10 +2760,10 @@ static int radeon_emit_packet3_cliprect(drm_device_t *dev,
2760 int orig_nbox) 2760 int orig_nbox)
2761{ 2761{
2762 drm_radeon_private_t *dev_priv = dev->dev_private; 2762 drm_radeon_private_t *dev_priv = dev->dev_private;
2763 drm_clip_rect_t box; 2763 struct drm_clip_rect box;
2764 unsigned int cmdsz; 2764 unsigned int cmdsz;
2765 int ret; 2765 int ret;
2766 drm_clip_rect_t __user *boxes = cmdbuf->boxes; 2766 struct drm_clip_rect __user *boxes = cmdbuf->boxes;
2767 int i = 0; 2767 int i = 0;
2768 RING_LOCALS; 2768 RING_LOCALS;
2769 2769
diff --git a/drivers/char/drm/via_drm.h b/drivers/char/drm/via_drm.h
index e4ee97d7156f..8f53c76062e9 100644
--- a/drivers/char/drm/via_drm.h
+++ b/drivers/char/drm/via_drm.h
@@ -40,7 +40,7 @@
40#define VIA_NR_XVMC_LOCKS 5 40#define VIA_NR_XVMC_LOCKS 5
41#define VIA_MAX_CACHELINE_SIZE 64 41#define VIA_MAX_CACHELINE_SIZE 64
42#define XVMCLOCKPTR(saPriv,lockNo) \ 42#define XVMCLOCKPTR(saPriv,lockNo) \
43 ((volatile drm_hw_lock_t *)(((((unsigned long) (saPriv)->XvMCLockArea) + \ 43 ((volatile struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
44 (VIA_MAX_CACHELINE_SIZE - 1)) & \ 44 (VIA_MAX_CACHELINE_SIZE - 1)) & \
45 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \ 45 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
46 VIA_MAX_CACHELINE_SIZE*(lockNo))) 46 VIA_MAX_CACHELINE_SIZE*(lockNo)))
@@ -182,7 +182,7 @@ typedef struct _drm_via_tex_region {
182typedef struct _drm_via_sarea { 182typedef struct _drm_via_sarea {
183 unsigned int dirty; 183 unsigned int dirty;
184 unsigned int nbox; 184 unsigned int nbox;
185 drm_clip_rect_t boxes[VIA_NR_SAREA_CLIPRECTS]; 185 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
186 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1]; 186 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
187 int texAge; /* last time texture was uploaded */ 187 int texAge; /* last time texture was uploaded */
188 int ctxOwner; /* last context to upload state */ 188 int ctxOwner; /* last context to upload state */