aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-07-11 02:17:42 -0400
committerDave Airlie <airlied@linux.ie>2007-07-11 02:17:42 -0400
commit056219e2fa6664ec83bc258ebcf30f1a7919d423 (patch)
tree0c74c9fd648755cf3aa3a2ff7fd46024e137af1f /drivers/char/drm
parenteddca551a3e7be2fed54282f255f18efe9ead131 (diff)
drm: drop drm_buf_t typedef
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drmP.h20
-rw-r--r--drivers/char/drm/drm_bufs.c18
-rw-r--r--drivers/char/drm/drm_dma.c2
-rw-r--r--drivers/char/drm/i810_dma.c26
-rw-r--r--drivers/char/drm/i810_drv.h2
-rw-r--r--drivers/char/drm/i830_dma.c24
-rw-r--r--drivers/char/drm/i830_drv.h2
-rw-r--r--drivers/char/drm/mga_dma.c10
-rw-r--r--drivers/char/drm/mga_drv.h4
-rw-r--r--drivers/char/drm/mga_state.c12
-rw-r--r--drivers/char/drm/r128_cce.c10
-rw-r--r--drivers/char/drm/r128_drv.h2
-rw-r--r--drivers/char/drm/r128_state.c14
-rw-r--r--drivers/char/drm/r300_cmdbuf.c4
-rw-r--r--drivers/char/drm/radeon_cp.c12
-rw-r--r--drivers/char/drm/radeon_drv.h4
-rw-r--r--drivers/char/drm/radeon_state.c20
-rw-r--r--drivers/char/drm/savage_bci.c10
-rw-r--r--drivers/char/drm/savage_drv.h4
-rw-r--r--drivers/char/drm/savage_state.c8
20 files changed, 104 insertions, 104 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 63ee0538813f..83d7d14a6153 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -294,7 +294,7 @@ typedef struct drm_vma_entry {
294/** 294/**
295 * DMA buffer. 295 * DMA buffer.
296 */ 296 */
297typedef struct drm_buf { 297struct drm_buf {
298 int idx; /**< Index into master buflist */ 298 int idx; /**< Index into master buflist */
299 int total; /**< Buffer size */ 299 int total; /**< Buffer size */
300 int order; /**< log-base-2(total) */ 300 int order; /**< log-base-2(total) */
@@ -320,15 +320,15 @@ typedef struct drm_buf {
320 320
321 int dev_priv_size; /**< Size of buffer private storage */ 321 int dev_priv_size; /**< Size of buffer private storage */
322 void *dev_private; /**< Per-buffer private storage */ 322 void *dev_private; /**< Per-buffer private storage */
323} drm_buf_t; 323};
324 324
325/** bufs is one longer than it has to be */ 325/** bufs is one longer than it has to be */
326typedef struct drm_waitlist { 326typedef struct drm_waitlist {
327 int count; /**< Number of possible buffers */ 327 int count; /**< Number of possible buffers */
328 drm_buf_t **bufs; /**< List of pointers to buffers */ 328 struct drm_buf **bufs; /**< List of pointers to buffers */
329 drm_buf_t **rp; /**< Read pointer */ 329 struct drm_buf **rp; /**< Read pointer */
330 drm_buf_t **wp; /**< Write pointer */ 330 struct drm_buf **wp; /**< Write pointer */
331 drm_buf_t **end; /**< End pointer */ 331 struct drm_buf **end; /**< End pointer */
332 spinlock_t read_lock; 332 spinlock_t read_lock;
333 spinlock_t write_lock; 333 spinlock_t write_lock;
334} drm_waitlist_t; 334} drm_waitlist_t;
@@ -336,7 +336,7 @@ typedef struct drm_waitlist {
336typedef struct drm_freelist { 336typedef struct drm_freelist {
337 int initialized; /**< Freelist in use */ 337 int initialized; /**< Freelist in use */
338 atomic_t count; /**< Number of free buffers */ 338 atomic_t count; /**< Number of free buffers */
339 drm_buf_t *next; /**< End pointer */ 339 struct drm_buf *next; /**< End pointer */
340 340
341 wait_queue_head_t waiting; /**< Processes waiting on free bufs */ 341 wait_queue_head_t waiting; /**< Processes waiting on free bufs */
342 int low_mark; /**< Low water mark */ 342 int low_mark; /**< Low water mark */
@@ -357,7 +357,7 @@ typedef struct drm_dma_handle {
357typedef struct drm_buf_entry { 357typedef struct drm_buf_entry {
358 int buf_size; /**< size */ 358 int buf_size; /**< size */
359 int buf_count; /**< number of buffers */ 359 int buf_count; /**< number of buffers */
360 drm_buf_t *buflist; /**< buffer list */ 360 struct drm_buf *buflist; /**< buffer list */
361 int seg_count; 361 int seg_count;
362 int page_order; 362 int page_order;
363 drm_dma_handle_t **seglist; 363 drm_dma_handle_t **seglist;
@@ -421,7 +421,7 @@ typedef struct drm_device_dma {
421 421
422 drm_buf_entry_t bufs[DRM_MAX_ORDER + 1]; /**< buffers, grouped by their size order */ 422 drm_buf_entry_t bufs[DRM_MAX_ORDER + 1]; /**< buffers, grouped by their size order */
423 int buf_count; /**< total number of buffers */ 423 int buf_count; /**< total number of buffers */
424 drm_buf_t **buflist; /**< Vector of pointers into drm_device_dma::bufs */ 424 struct drm_buf **buflist; /**< Vector of pointers into drm_device_dma::bufs */
425 int seg_count; 425 int seg_count;
426 int page_count; /**< number of pages */ 426 int page_count; /**< number of pages */
427 unsigned long *pagelist; /**< page list */ 427 unsigned long *pagelist; /**< page list */
@@ -964,7 +964,7 @@ extern unsigned long drm_get_resource_len(struct drm_device *dev,
964 /* DMA support (drm_dma.h) */ 964 /* DMA support (drm_dma.h) */
965extern int drm_dma_setup(struct drm_device *dev); 965extern int drm_dma_setup(struct drm_device *dev);
966extern void drm_dma_takedown(struct drm_device *dev); 966extern void drm_dma_takedown(struct drm_device *dev);
967extern void drm_free_buffer(struct drm_device *dev, drm_buf_t * buf); 967extern void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf);
968extern void drm_core_reclaim_buffers(struct drm_device *dev, struct file *filp); 968extern void drm_core_reclaim_buffers(struct drm_device *dev, struct file *filp);
969 969
970 /* IRQ support (drm_irq.h) */ 970 /* IRQ support (drm_irq.h) */
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index d12e2876a2ab..bdd301519769 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -554,7 +554,7 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
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;
556 drm_agp_mem_t *agp_entry; 556 drm_agp_mem_t *agp_entry;
557 drm_buf_t *buf; 557 struct drm_buf *buf;
558 unsigned long offset; 558 unsigned long offset;
559 unsigned long agp_offset; 559 unsigned long agp_offset;
560 int count; 560 int count;
@@ -565,7 +565,7 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
565 int total; 565 int total;
566 int byte_count; 566 int byte_count;
567 int i, valid; 567 int i, valid;
568 drm_buf_t **temp_buflist; 568 struct drm_buf **temp_buflist;
569 569
570 if (!dma) 570 if (!dma)
571 return -EINVAL; 571 return -EINVAL;
@@ -729,14 +729,14 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
729 int page_order; 729 int page_order;
730 drm_buf_entry_t *entry; 730 drm_buf_entry_t *entry;
731 drm_dma_handle_t *dmah; 731 drm_dma_handle_t *dmah;
732 drm_buf_t *buf; 732 struct drm_buf *buf;
733 int alignment; 733 int alignment;
734 unsigned long offset; 734 unsigned long offset;
735 int i; 735 int i;
736 int byte_count; 736 int byte_count;
737 int page_count; 737 int page_count;
738 unsigned long *temp_pagelist; 738 unsigned long *temp_pagelist;
739 drm_buf_t **temp_buflist; 739 struct drm_buf **temp_buflist;
740 740
741 if (!drm_core_check_feature(dev, DRIVER_PCI_DMA)) 741 if (!drm_core_check_feature(dev, DRIVER_PCI_DMA))
742 return -EINVAL; 742 return -EINVAL;
@@ -949,7 +949,7 @@ static int drm_addbufs_sg(struct drm_device * 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;
952 drm_buf_t *buf; 952 struct drm_buf *buf;
953 unsigned long offset; 953 unsigned long offset;
954 unsigned long agp_offset; 954 unsigned long agp_offset;
955 int count; 955 int count;
@@ -960,7 +960,7 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
960 int total; 960 int total;
961 int byte_count; 961 int byte_count;
962 int i; 962 int i;
963 drm_buf_t **temp_buflist; 963 struct drm_buf **temp_buflist;
964 964
965 if (!drm_core_check_feature(dev, DRIVER_SG)) 965 if (!drm_core_check_feature(dev, DRIVER_SG))
966 return -EINVAL; 966 return -EINVAL;
@@ -1111,7 +1111,7 @@ static int drm_addbufs_fb(struct drm_device * 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;
1114 drm_buf_t *buf; 1114 struct drm_buf *buf;
1115 unsigned long offset; 1115 unsigned long offset;
1116 unsigned long agp_offset; 1116 unsigned long agp_offset;
1117 int count; 1117 int count;
@@ -1122,7 +1122,7 @@ static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request
1122 int total; 1122 int total;
1123 int byte_count; 1123 int byte_count;
1124 int i; 1124 int i;
1125 drm_buf_t **temp_buflist; 1125 struct drm_buf **temp_buflist;
1126 1126
1127 if (!drm_core_check_feature(dev, DRIVER_FB_DMA)) 1127 if (!drm_core_check_feature(dev, DRIVER_FB_DMA))
1128 return -EINVAL; 1128 return -EINVAL;
@@ -1481,7 +1481,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
1481 struct drm_buf_free 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 struct drm_buf *buf;
1485 1485
1486 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) 1486 if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
1487 return -EINVAL; 1487 return -EINVAL;
diff --git a/drivers/char/drm/drm_dma.c b/drivers/char/drm/drm_dma.c
index 2cffb7b597fd..739a6a7a95d0 100644
--- a/drivers/char/drm/drm_dma.c
+++ b/drivers/char/drm/drm_dma.c
@@ -129,7 +129,7 @@ void drm_dma_takedown(struct drm_device *dev)
129 * 129 *
130 * Resets the fields of \p buf. 130 * Resets the fields of \p buf.
131 */ 131 */
132void drm_free_buffer(struct drm_device *dev, drm_buf_t * buf) 132void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf)
133{ 133{
134 if (!buf) 134 if (!buf)
135 return; 135 return;
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index ca82cddb4a22..b4a98fa2e2d4 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -45,7 +45,7 @@
45#define I810_BUF_UNMAPPED 0 45#define I810_BUF_UNMAPPED 0
46#define I810_BUF_MAPPED 1 46#define I810_BUF_MAPPED 1
47 47
48static drm_buf_t *i810_freelist_get(struct drm_device * dev) 48static struct drm_buf *i810_freelist_get(struct drm_device * dev)
49{ 49{
50 drm_device_dma_t *dma = dev->dma; 50 drm_device_dma_t *dma = dev->dma;
51 int i; 51 int i;
@@ -54,7 +54,7 @@ static drm_buf_t *i810_freelist_get(struct drm_device * dev)
54 /* Linear search might not be the best solution */ 54 /* Linear search might not be the best solution */
55 55
56 for (i = 0; i < dma->buf_count; i++) { 56 for (i = 0; i < dma->buf_count; i++) {
57 drm_buf_t *buf = dma->buflist[i]; 57 struct drm_buf *buf = dma->buflist[i];
58 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 58 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
59 /* In use is already a pointer */ 59 /* In use is already a pointer */
60 used = cmpxchg(buf_priv->in_use, I810_BUF_FREE, 60 used = cmpxchg(buf_priv->in_use, I810_BUF_FREE,
@@ -70,7 +70,7 @@ static drm_buf_t *i810_freelist_get(struct drm_device * dev)
70 * yet, the hardware updates in use for us once its on the ring buffer. 70 * yet, the hardware updates in use for us once its on the ring buffer.
71 */ 71 */
72 72
73static int i810_freelist_put(struct drm_device * dev, drm_buf_t * buf) 73static int i810_freelist_put(struct drm_device * dev, struct drm_buf * buf)
74{ 74{
75 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 75 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
76 int used; 76 int used;
@@ -90,7 +90,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
90 struct drm_file *priv = filp->private_data; 90 struct drm_file *priv = filp->private_data;
91 struct drm_device *dev; 91 struct drm_device *dev;
92 drm_i810_private_t *dev_priv; 92 drm_i810_private_t *dev_priv;
93 drm_buf_t *buf; 93 struct drm_buf *buf;
94 drm_i810_buf_priv_t *buf_priv; 94 drm_i810_buf_priv_t *buf_priv;
95 95
96 lock_kernel(); 96 lock_kernel();
@@ -120,7 +120,7 @@ static const struct file_operations i810_buffer_fops = {
120 .fasync = drm_fasync, 120 .fasync = drm_fasync,
121}; 121};
122 122
123static int i810_map_buffer(drm_buf_t * buf, struct file *filp) 123static int i810_map_buffer(struct drm_buf * buf, struct file *filp)
124{ 124{
125 struct drm_file *priv = filp->private_data; 125 struct drm_file *priv = filp->private_data;
126 struct drm_device *dev = priv->head->dev; 126 struct drm_device *dev = priv->head->dev;
@@ -152,7 +152,7 @@ static int i810_map_buffer(drm_buf_t * buf, struct file *filp)
152 return retcode; 152 return retcode;
153} 153}
154 154
155static int i810_unmap_buffer(drm_buf_t * buf) 155static int i810_unmap_buffer(struct drm_buf * buf)
156{ 156{
157 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 157 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
158 int retcode = 0; 158 int retcode = 0;
@@ -175,7 +175,7 @@ static int i810_unmap_buffer(drm_buf_t * buf)
175static int i810_dma_get_buffer(struct drm_device * dev, drm_i810_dma_t * d, 175static int i810_dma_get_buffer(struct drm_device * dev, drm_i810_dma_t * d,
176 struct file *filp) 176 struct file *filp)
177{ 177{
178 drm_buf_t *buf; 178 struct drm_buf *buf;
179 drm_i810_buf_priv_t *buf_priv; 179 drm_i810_buf_priv_t *buf_priv;
180 int retcode = 0; 180 int retcode = 0;
181 181
@@ -233,7 +233,7 @@ static int i810_dma_cleanup(struct drm_device * dev)
233 dev->dev_private = NULL; 233 dev->dev_private = NULL;
234 234
235 for (i = 0; i < dma->buf_count; i++) { 235 for (i = 0; i < dma->buf_count; i++) {
236 drm_buf_t *buf = dma->buflist[i]; 236 struct drm_buf *buf = dma->buflist[i];
237 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 237 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
238 238
239 if (buf_priv->kernel_virtual && buf->total) 239 if (buf_priv->kernel_virtual && buf->total)
@@ -301,7 +301,7 @@ static int i810_freelist_init(struct drm_device * dev, drm_i810_private_t * dev_
301 } 301 }
302 302
303 for (i = 0; i < dma->buf_count; i++) { 303 for (i = 0; i < dma->buf_count; i++) {
304 drm_buf_t *buf = dma->buflist[i]; 304 struct drm_buf *buf = dma->buflist[i];
305 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 305 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
306 306
307 buf_priv->in_use = hw_status++; 307 buf_priv->in_use = hw_status++;
@@ -788,7 +788,7 @@ static void i810_dma_dispatch_swap(struct drm_device * dev)
788} 788}
789 789
790static void i810_dma_dispatch_vertex(struct drm_device * dev, 790static void i810_dma_dispatch_vertex(struct drm_device * dev,
791 drm_buf_t * buf, int discard, int used) 791 struct drm_buf * buf, int discard, int used)
792{ 792{
793 drm_i810_private_t *dev_priv = dev->dev_private; 793 drm_i810_private_t *dev_priv = dev->dev_private;
794 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 794 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
@@ -952,7 +952,7 @@ static int i810_flush_queue(struct drm_device * dev)
952 i810_wait_ring(dev, dev_priv->ring.Size - 8); 952 i810_wait_ring(dev, dev_priv->ring.Size - 8);
953 953
954 for (i = 0; i < dma->buf_count; i++) { 954 for (i = 0; i < dma->buf_count; i++) {
955 drm_buf_t *buf = dma->buflist[i]; 955 struct drm_buf *buf = dma->buflist[i];
956 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 956 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
957 957
958 int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE, 958 int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE,
@@ -983,7 +983,7 @@ static void i810_reclaim_buffers(struct drm_device * dev, struct file *filp)
983 i810_flush_queue(dev); 983 i810_flush_queue(dev);
984 984
985 for (i = 0; i < dma->buf_count; i++) { 985 for (i = 0; i < dma->buf_count; i++) {
986 drm_buf_t *buf = dma->buflist[i]; 986 struct drm_buf *buf = dma->buflist[i];
987 drm_i810_buf_priv_t *buf_priv = buf->dev_private; 987 drm_i810_buf_priv_t *buf_priv = buf->dev_private;
988 988
989 if (buf->filp == filp && buf_priv) { 989 if (buf->filp == filp && buf_priv) {
@@ -1142,7 +1142,7 @@ static int i810_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
1142 return 0; 1142 return 0;
1143} 1143}
1144 1144
1145static void i810_dma_dispatch_mc(struct drm_device * dev, drm_buf_t * buf, int used, 1145static void i810_dma_dispatch_mc(struct drm_device * dev, struct drm_buf * buf, int used,
1146 unsigned int last_render) 1146 unsigned int last_render)
1147{ 1147{
1148 drm_i810_private_t *dev_priv = dev->dev_private; 1148 drm_i810_private_t *dev_priv = dev->dev_private;
diff --git a/drivers/char/drm/i810_drv.h b/drivers/char/drm/i810_drv.h
index 591a23d9b838..648833844c7f 100644
--- a/drivers/char/drm/i810_drv.h
+++ b/drivers/char/drm/i810_drv.h
@@ -88,7 +88,7 @@ typedef struct drm_i810_private {
88 88
89 dma_addr_t dma_status_page; 89 dma_addr_t dma_status_page;
90 90
91 drm_buf_t *mmap_buffer; 91 struct drm_buf *mmap_buffer;
92 92
93 u32 front_di1, back_di1, zi1; 93 u32 front_di1, back_di1, zi1;
94 94
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
index 57ce074a5597..021a0711485a 100644
--- a/drivers/char/drm/i830_dma.c
+++ b/drivers/char/drm/i830_dma.c
@@ -47,7 +47,7 @@
47#define I830_BUF_UNMAPPED 0 47#define I830_BUF_UNMAPPED 0
48#define I830_BUF_MAPPED 1 48#define I830_BUF_MAPPED 1
49 49
50static drm_buf_t *i830_freelist_get(struct drm_device * dev) 50static struct drm_buf *i830_freelist_get(struct drm_device * dev)
51{ 51{
52 drm_device_dma_t *dma = dev->dma; 52 drm_device_dma_t *dma = dev->dma;
53 int i; 53 int i;
@@ -56,7 +56,7 @@ static drm_buf_t *i830_freelist_get(struct drm_device * dev)
56 /* Linear search might not be the best solution */ 56 /* Linear search might not be the best solution */
57 57
58 for (i = 0; i < dma->buf_count; i++) { 58 for (i = 0; i < dma->buf_count; i++) {
59 drm_buf_t *buf = dma->buflist[i]; 59 struct drm_buf *buf = dma->buflist[i];
60 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 60 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
61 /* In use is already a pointer */ 61 /* In use is already a pointer */
62 used = cmpxchg(buf_priv->in_use, I830_BUF_FREE, 62 used = cmpxchg(buf_priv->in_use, I830_BUF_FREE,
@@ -72,7 +72,7 @@ static drm_buf_t *i830_freelist_get(struct drm_device * dev)
72 * yet, the hardware updates in use for us once its on the ring buffer. 72 * yet, the hardware updates in use for us once its on the ring buffer.
73 */ 73 */
74 74
75static int i830_freelist_put(struct drm_device * dev, drm_buf_t * buf) 75static int i830_freelist_put(struct drm_device * dev, struct drm_buf * buf)
76{ 76{
77 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 77 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
78 int used; 78 int used;
@@ -92,7 +92,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
92 struct drm_file *priv = filp->private_data; 92 struct drm_file *priv = filp->private_data;
93 struct drm_device *dev; 93 struct drm_device *dev;
94 drm_i830_private_t *dev_priv; 94 drm_i830_private_t *dev_priv;
95 drm_buf_t *buf; 95 struct drm_buf *buf;
96 drm_i830_buf_priv_t *buf_priv; 96 drm_i830_buf_priv_t *buf_priv;
97 97
98 lock_kernel(); 98 lock_kernel();
@@ -122,7 +122,7 @@ static const struct file_operations i830_buffer_fops = {
122 .fasync = drm_fasync, 122 .fasync = drm_fasync,
123}; 123};
124 124
125static int i830_map_buffer(drm_buf_t * buf, struct file *filp) 125static int i830_map_buffer(struct drm_buf * buf, struct file *filp)
126{ 126{
127 struct drm_file *priv = filp->private_data; 127 struct drm_file *priv = filp->private_data;
128 struct drm_device *dev = priv->head->dev; 128 struct drm_device *dev = priv->head->dev;
@@ -156,7 +156,7 @@ static int i830_map_buffer(drm_buf_t * buf, struct file *filp)
156 return retcode; 156 return retcode;
157} 157}
158 158
159static int i830_unmap_buffer(drm_buf_t * buf) 159static int i830_unmap_buffer(struct drm_buf * buf)
160{ 160{
161 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 161 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
162 int retcode = 0; 162 int retcode = 0;
@@ -179,7 +179,7 @@ static int i830_unmap_buffer(drm_buf_t * buf)
179static int i830_dma_get_buffer(struct drm_device * dev, drm_i830_dma_t * d, 179static int i830_dma_get_buffer(struct drm_device * dev, drm_i830_dma_t * d,
180 struct file *filp) 180 struct file *filp)
181{ 181{
182 drm_buf_t *buf; 182 struct drm_buf *buf;
183 drm_i830_buf_priv_t *buf_priv; 183 drm_i830_buf_priv_t *buf_priv;
184 int retcode = 0; 184 int retcode = 0;
185 185
@@ -238,7 +238,7 @@ static int i830_dma_cleanup(struct drm_device * dev)
238 dev->dev_private = NULL; 238 dev->dev_private = NULL;
239 239
240 for (i = 0; i < dma->buf_count; i++) { 240 for (i = 0; i < dma->buf_count; i++) {
241 drm_buf_t *buf = dma->buflist[i]; 241 struct drm_buf *buf = dma->buflist[i];
242 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 242 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
243 if (buf_priv->kernel_virtual && buf->total) 243 if (buf_priv->kernel_virtual && buf->total)
244 drm_core_ioremapfree(&buf_priv->map, dev); 244 drm_core_ioremapfree(&buf_priv->map, dev);
@@ -309,7 +309,7 @@ static int i830_freelist_init(struct drm_device * dev, drm_i830_private_t * dev_
309 } 309 }
310 310
311 for (i = 0; i < dma->buf_count; i++) { 311 for (i = 0; i < dma->buf_count; i++) {
312 drm_buf_t *buf = dma->buflist[i]; 312 struct drm_buf *buf = dma->buflist[i];
313 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 313 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
314 314
315 buf_priv->in_use = hw_status++; 315 buf_priv->in_use = hw_status++;
@@ -1087,7 +1087,7 @@ static void i830_dma_dispatch_flip(struct drm_device * dev)
1087} 1087}
1088 1088
1089static void i830_dma_dispatch_vertex(struct drm_device * dev, 1089static void i830_dma_dispatch_vertex(struct drm_device * dev,
1090 drm_buf_t * buf, int discard, int used) 1090 struct drm_buf * buf, int discard, int used)
1091{ 1091{
1092 drm_i830_private_t *dev_priv = dev->dev_private; 1092 drm_i830_private_t *dev_priv = dev->dev_private;
1093 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 1093 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
@@ -1232,7 +1232,7 @@ static int i830_flush_queue(struct drm_device * dev)
1232 i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); 1232 i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__);
1233 1233
1234 for (i = 0; i < dma->buf_count; i++) { 1234 for (i = 0; i < dma->buf_count; i++) {
1235 drm_buf_t *buf = dma->buflist[i]; 1235 struct drm_buf *buf = dma->buflist[i];
1236 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 1236 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
1237 1237
1238 int used = cmpxchg(buf_priv->in_use, I830_BUF_HARDWARE, 1238 int used = cmpxchg(buf_priv->in_use, I830_BUF_HARDWARE,
@@ -1263,7 +1263,7 @@ static void i830_reclaim_buffers(struct drm_device * dev, struct file *filp)
1263 i830_flush_queue(dev); 1263 i830_flush_queue(dev);
1264 1264
1265 for (i = 0; i < dma->buf_count; i++) { 1265 for (i = 0; i < dma->buf_count; i++) {
1266 drm_buf_t *buf = dma->buflist[i]; 1266 struct drm_buf *buf = dma->buflist[i];
1267 drm_i830_buf_priv_t *buf_priv = buf->dev_private; 1267 drm_i830_buf_priv_t *buf_priv = buf->dev_private;
1268 1268
1269 if (buf->filp == filp && buf_priv) { 1269 if (buf->filp == filp && buf_priv) {
diff --git a/drivers/char/drm/i830_drv.h b/drivers/char/drm/i830_drv.h
index bf2170318dd3..ddda67956dea 100644
--- a/drivers/char/drm/i830_drv.h
+++ b/drivers/char/drm/i830_drv.h
@@ -95,7 +95,7 @@ typedef struct drm_i830_private {
95 95
96 dma_addr_t dma_status_page; 96 dma_addr_t dma_status_page;
97 97
98 drm_buf_t *mmap_buffer; 98 struct drm_buf *mmap_buffer;
99 99
100 u32 front_di1, back_di1, zi1; 100 u32 front_di1, back_di1, zi1;
101 101
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index 61feb6d06811..b5d41dcb29e7 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -248,7 +248,7 @@ static void mga_freelist_print(struct drm_device * dev)
248static int mga_freelist_init(struct drm_device * dev, drm_mga_private_t * dev_priv) 248static int mga_freelist_init(struct drm_device * dev, drm_mga_private_t * dev_priv)
249{ 249{
250 drm_device_dma_t *dma = dev->dma; 250 drm_device_dma_t *dma = dev->dma;
251 drm_buf_t *buf; 251 struct drm_buf *buf;
252 drm_mga_buf_priv_t *buf_priv; 252 drm_mga_buf_priv_t *buf_priv;
253 drm_mga_freelist_t *entry; 253 drm_mga_freelist_t *entry;
254 int i; 254 int i;
@@ -314,7 +314,7 @@ static void mga_freelist_cleanup(struct drm_device * dev)
314static void mga_freelist_reset(struct drm_device * dev) 314static void mga_freelist_reset(struct drm_device * dev)
315{ 315{
316 drm_device_dma_t *dma = dev->dma; 316 drm_device_dma_t *dma = dev->dma;
317 drm_buf_t *buf; 317 struct drm_buf *buf;
318 drm_mga_buf_priv_t *buf_priv; 318 drm_mga_buf_priv_t *buf_priv;
319 int i; 319 int i;
320 320
@@ -326,7 +326,7 @@ static void mga_freelist_reset(struct drm_device * dev)
326} 326}
327#endif 327#endif
328 328
329static drm_buf_t *mga_freelist_get(struct drm_device * dev) 329static struct drm_buf *mga_freelist_get(struct drm_device * dev)
330{ 330{
331 drm_mga_private_t *dev_priv = dev->dev_private; 331 drm_mga_private_t *dev_priv = dev->dev_private;
332 drm_mga_freelist_t *next; 332 drm_mga_freelist_t *next;
@@ -359,7 +359,7 @@ static drm_buf_t *mga_freelist_get(struct drm_device * dev)
359 return NULL; 359 return NULL;
360} 360}
361 361
362int mga_freelist_put(struct drm_device * dev, drm_buf_t * buf) 362int mga_freelist_put(struct drm_device * dev, struct drm_buf * buf)
363{ 363{
364 drm_mga_private_t *dev_priv = dev->dev_private; 364 drm_mga_private_t *dev_priv = dev->dev_private;
365 drm_mga_buf_priv_t *buf_priv = buf->dev_private; 365 drm_mga_buf_priv_t *buf_priv = buf->dev_private;
@@ -1088,7 +1088,7 @@ int mga_dma_reset(DRM_IOCTL_ARGS)
1088 1088
1089static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d) 1089static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d)
1090{ 1090{
1091 drm_buf_t *buf; 1091 struct drm_buf *buf;
1092 int i; 1092 int i;
1093 1093
1094 for (i = d->granted_count; i < d->request_count; i++) { 1094 for (i = d->granted_count; i < d->request_count; i++) {
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
index bf3852125cc5..49253affa475 100644
--- a/drivers/char/drm/mga_drv.h
+++ b/drivers/char/drm/mga_drv.h
@@ -65,7 +65,7 @@ typedef struct drm_mga_freelist {
65 struct drm_mga_freelist *next; 65 struct drm_mga_freelist *next;
66 struct drm_mga_freelist *prev; 66 struct drm_mga_freelist *prev;
67 drm_mga_age_t age; 67 drm_mga_age_t age;
68 drm_buf_t *buf; 68 struct drm_buf *buf;
69} drm_mga_freelist_t; 69} drm_mga_freelist_t;
70 70
71typedef struct { 71typedef struct {
@@ -168,7 +168,7 @@ extern void mga_do_dma_flush(drm_mga_private_t * dev_priv);
168extern void mga_do_dma_wrap_start(drm_mga_private_t * dev_priv); 168extern void mga_do_dma_wrap_start(drm_mga_private_t * dev_priv);
169extern void mga_do_dma_wrap_end(drm_mga_private_t * dev_priv); 169extern void mga_do_dma_wrap_end(drm_mga_private_t * dev_priv);
170 170
171extern int mga_freelist_put(struct drm_device * dev, drm_buf_t * buf); 171extern int mga_freelist_put(struct drm_device * dev, struct drm_buf * buf);
172 172
173 /* mga_warp.c */ 173 /* mga_warp.c */
174extern unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv); 174extern unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv);
diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c
index 6d5ab9ff69c7..62f7acac2f59 100644
--- a/drivers/char/drm/mga_state.c
+++ b/drivers/char/drm/mga_state.c
@@ -622,7 +622,7 @@ static void mga_dma_dispatch_swap(struct drm_device * dev)
622 DRM_DEBUG("%s... done.\n", __FUNCTION__); 622 DRM_DEBUG("%s... done.\n", __FUNCTION__);
623} 623}
624 624
625static void mga_dma_dispatch_vertex(struct drm_device * dev, drm_buf_t * buf) 625static void mga_dma_dispatch_vertex(struct drm_device * dev, struct drm_buf * buf)
626{ 626{
627 drm_mga_private_t *dev_priv = dev->dev_private; 627 drm_mga_private_t *dev_priv = dev->dev_private;
628 drm_mga_buf_priv_t *buf_priv = buf->dev_private; 628 drm_mga_buf_priv_t *buf_priv = buf->dev_private;
@@ -669,7 +669,7 @@ static void mga_dma_dispatch_vertex(struct drm_device * dev, drm_buf_t * buf)
669 FLUSH_DMA(); 669 FLUSH_DMA();
670} 670}
671 671
672static void mga_dma_dispatch_indices(struct drm_device * dev, drm_buf_t * buf, 672static void mga_dma_dispatch_indices(struct drm_device * dev, struct drm_buf * buf,
673 unsigned int start, unsigned int end) 673 unsigned int start, unsigned int end)
674{ 674{
675 drm_mga_private_t *dev_priv = dev->dev_private; 675 drm_mga_private_t *dev_priv = dev->dev_private;
@@ -718,7 +718,7 @@ static void mga_dma_dispatch_indices(struct drm_device * dev, drm_buf_t * buf,
718/* This copies a 64 byte aligned agp region to the frambuffer with a 718/* This copies a 64 byte aligned agp region to the frambuffer with a
719 * standard blit, the ioctl needs to do checking. 719 * standard blit, the ioctl needs to do checking.
720 */ 720 */
721static void mga_dma_dispatch_iload(struct drm_device * dev, drm_buf_t * buf, 721static void mga_dma_dispatch_iload(struct drm_device * dev, struct drm_buf * buf,
722 unsigned int dstorg, unsigned int length) 722 unsigned int dstorg, unsigned int length)
723{ 723{
724 drm_mga_private_t *dev_priv = dev->dev_private; 724 drm_mga_private_t *dev_priv = dev->dev_private;
@@ -881,7 +881,7 @@ static int mga_dma_vertex(DRM_IOCTL_ARGS)
881 DRM_DEVICE; 881 DRM_DEVICE;
882 drm_mga_private_t *dev_priv = dev->dev_private; 882 drm_mga_private_t *dev_priv = dev->dev_private;
883 drm_device_dma_t *dma = dev->dma; 883 drm_device_dma_t *dma = dev->dma;
884 drm_buf_t *buf; 884 struct drm_buf *buf;
885 drm_mga_buf_priv_t *buf_priv; 885 drm_mga_buf_priv_t *buf_priv;
886 drm_mga_vertex_t vertex; 886 drm_mga_vertex_t vertex;
887 887
@@ -921,7 +921,7 @@ static int mga_dma_indices(DRM_IOCTL_ARGS)
921 DRM_DEVICE; 921 DRM_DEVICE;
922 drm_mga_private_t *dev_priv = dev->dev_private; 922 drm_mga_private_t *dev_priv = dev->dev_private;
923 drm_device_dma_t *dma = dev->dma; 923 drm_device_dma_t *dma = dev->dma;
924 drm_buf_t *buf; 924 struct drm_buf *buf;
925 drm_mga_buf_priv_t *buf_priv; 925 drm_mga_buf_priv_t *buf_priv;
926 drm_mga_indices_t indices; 926 drm_mga_indices_t indices;
927 927
@@ -961,7 +961,7 @@ static int mga_dma_iload(DRM_IOCTL_ARGS)
961 DRM_DEVICE; 961 DRM_DEVICE;
962 drm_device_dma_t *dma = dev->dma; 962 drm_device_dma_t *dma = dev->dma;
963 drm_mga_private_t *dev_priv = dev->dev_private; 963 drm_mga_private_t *dev_priv = dev->dev_private;
964 drm_buf_t *buf; 964 struct drm_buf *buf;
965 drm_mga_buf_priv_t *buf_priv; 965 drm_mga_buf_priv_t *buf_priv;
966 drm_mga_iload_t iload; 966 drm_mga_iload_t iload;
967 DRM_DEBUG("\n"); 967 DRM_DEBUG("\n");
diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
index d1e762e4eb54..70ba703992ef 100644
--- a/drivers/char/drm/r128_cce.c
+++ b/drivers/char/drm/r128_cce.c
@@ -773,7 +773,7 @@ static int r128_freelist_init(struct drm_device * dev)
773{ 773{
774 drm_device_dma_t *dma = dev->dma; 774 drm_device_dma_t *dma = dev->dma;
775 drm_r128_private_t *dev_priv = dev->dev_private; 775 drm_r128_private_t *dev_priv = dev->dev_private;
776 drm_buf_t *buf; 776 struct drm_buf *buf;
777 drm_r128_buf_priv_t *buf_priv; 777 drm_r128_buf_priv_t *buf_priv;
778 drm_r128_freelist_t *entry; 778 drm_r128_freelist_t *entry;
779 int i; 779 int i;
@@ -815,12 +815,12 @@ static int r128_freelist_init(struct drm_device * dev)
815} 815}
816#endif 816#endif
817 817
818static drm_buf_t *r128_freelist_get(struct drm_device * dev) 818static struct drm_buf *r128_freelist_get(struct drm_device * dev)
819{ 819{
820 drm_device_dma_t *dma = dev->dma; 820 drm_device_dma_t *dma = dev->dma;
821 drm_r128_private_t *dev_priv = dev->dev_private; 821 drm_r128_private_t *dev_priv = dev->dev_private;
822 drm_r128_buf_priv_t *buf_priv; 822 drm_r128_buf_priv_t *buf_priv;
823 drm_buf_t *buf; 823 struct drm_buf *buf;
824 int i, t; 824 int i, t;
825 825
826 /* FIXME: Optimize -- use freelist code */ 826 /* FIXME: Optimize -- use freelist code */
@@ -859,7 +859,7 @@ void r128_freelist_reset(struct drm_device * dev)
859 int i; 859 int i;
860 860
861 for (i = 0; i < dma->buf_count; i++) { 861 for (i = 0; i < dma->buf_count; i++) {
862 drm_buf_t *buf = dma->buflist[i]; 862 struct drm_buf *buf = dma->buflist[i];
863 drm_r128_buf_priv_t *buf_priv = buf->dev_private; 863 drm_r128_buf_priv_t *buf_priv = buf->dev_private;
864 buf_priv->age = 0; 864 buf_priv->age = 0;
865 } 865 }
@@ -889,7 +889,7 @@ int r128_wait_ring(drm_r128_private_t * dev_priv, int n)
889static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d) 889static int r128_cce_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d)
890{ 890{
891 int i; 891 int i;
892 drm_buf_t *buf; 892 struct drm_buf *buf;
893 893
894 for (i = d->granted_count; i < d->request_count; i++) { 894 for (i = d->granted_count; i < d->request_count; i++) {
895 buf = r128_freelist_get(dev); 895 buf = r128_freelist_get(dev);
diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h
index 1e3deaba2b03..8eb302e0101f 100644
--- a/drivers/char/drm/r128_drv.h
+++ b/drivers/char/drm/r128_drv.h
@@ -57,7 +57,7 @@
57 57
58typedef struct drm_r128_freelist { 58typedef struct drm_r128_freelist {
59 unsigned int age; 59 unsigned int age;
60 drm_buf_t *buf; 60 struct drm_buf *buf;
61 struct drm_r128_freelist *next; 61 struct drm_r128_freelist *next;
62 struct drm_r128_freelist *prev; 62 struct drm_r128_freelist *prev;
63} drm_r128_freelist_t; 63} drm_r128_freelist_t;
diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c
index 21d445e8e418..1fdfeb876a8e 100644
--- a/drivers/char/drm/r128_state.c
+++ b/drivers/char/drm/r128_state.c
@@ -567,7 +567,7 @@ static void r128_cce_dispatch_flip(struct drm_device * dev)
567 ADVANCE_RING(); 567 ADVANCE_RING();
568} 568}
569 569
570static void r128_cce_dispatch_vertex(struct drm_device * dev, drm_buf_t * buf) 570static void r128_cce_dispatch_vertex(struct drm_device * dev, struct drm_buf * buf)
571{ 571{
572 drm_r128_private_t *dev_priv = dev->dev_private; 572 drm_r128_private_t *dev_priv = dev->dev_private;
573 drm_r128_buf_priv_t *buf_priv = buf->dev_private; 573 drm_r128_buf_priv_t *buf_priv = buf->dev_private;
@@ -638,7 +638,7 @@ static void r128_cce_dispatch_vertex(struct drm_device * dev, drm_buf_t * buf)
638} 638}
639 639
640static void r128_cce_dispatch_indirect(struct drm_device * dev, 640static void r128_cce_dispatch_indirect(struct drm_device * dev,
641 drm_buf_t * buf, int start, int end) 641 struct drm_buf * buf, int start, int end)
642{ 642{
643 drm_r128_private_t *dev_priv = dev->dev_private; 643 drm_r128_private_t *dev_priv = dev->dev_private;
644 drm_r128_buf_priv_t *buf_priv = buf->dev_private; 644 drm_r128_buf_priv_t *buf_priv = buf->dev_private;
@@ -693,7 +693,7 @@ static void r128_cce_dispatch_indirect(struct drm_device * dev,
693} 693}
694 694
695static void r128_cce_dispatch_indices(struct drm_device * dev, 695static void r128_cce_dispatch_indices(struct drm_device * dev,
696 drm_buf_t * buf, 696 struct drm_buf * buf,
697 int start, int end, int count) 697 int start, int end, int count)
698{ 698{
699 drm_r128_private_t *dev_priv = dev->dev_private; 699 drm_r128_private_t *dev_priv = dev->dev_private;
@@ -781,7 +781,7 @@ static int r128_cce_dispatch_blit(DRMFILE filp,
781{ 781{
782 drm_r128_private_t *dev_priv = dev->dev_private; 782 drm_r128_private_t *dev_priv = dev->dev_private;
783 drm_device_dma_t *dma = dev->dma; 783 drm_device_dma_t *dma = dev->dma;
784 drm_buf_t *buf; 784 struct drm_buf *buf;
785 drm_r128_buf_priv_t *buf_priv; 785 drm_r128_buf_priv_t *buf_priv;
786 u32 *data; 786 u32 *data;
787 int dword_shift, dwords; 787 int dword_shift, dwords;
@@ -1355,7 +1355,7 @@ static int r128_cce_vertex(DRM_IOCTL_ARGS)
1355 DRM_DEVICE; 1355 DRM_DEVICE;
1356 drm_r128_private_t *dev_priv = dev->dev_private; 1356 drm_r128_private_t *dev_priv = dev->dev_private;
1357 drm_device_dma_t *dma = dev->dma; 1357 drm_device_dma_t *dma = dev->dma;
1358 drm_buf_t *buf; 1358 struct drm_buf *buf;
1359 drm_r128_buf_priv_t *buf_priv; 1359 drm_r128_buf_priv_t *buf_priv;
1360 drm_r128_vertex_t vertex; 1360 drm_r128_vertex_t vertex;
1361 1361
@@ -1414,7 +1414,7 @@ static int r128_cce_indices(DRM_IOCTL_ARGS)
1414 DRM_DEVICE; 1414 DRM_DEVICE;
1415 drm_r128_private_t *dev_priv = dev->dev_private; 1415 drm_r128_private_t *dev_priv = dev->dev_private;
1416 drm_device_dma_t *dma = dev->dma; 1416 drm_device_dma_t *dma = dev->dma;
1417 drm_buf_t *buf; 1417 struct drm_buf *buf;
1418 drm_r128_buf_priv_t *buf_priv; 1418 drm_r128_buf_priv_t *buf_priv;
1419 drm_r128_indices_t elts; 1419 drm_r128_indices_t elts;
1420 int count; 1420 int count;
@@ -1572,7 +1572,7 @@ static int r128_cce_indirect(DRM_IOCTL_ARGS)
1572 DRM_DEVICE; 1572 DRM_DEVICE;
1573 drm_r128_private_t *dev_priv = dev->dev_private; 1573 drm_r128_private_t *dev_priv = dev->dev_private;
1574 drm_device_dma_t *dma = dev->dma; 1574 drm_device_dma_t *dma = dev->dma;
1575 drm_buf_t *buf; 1575 struct drm_buf *buf;
1576 drm_r128_buf_priv_t *buf_priv; 1576 drm_r128_buf_priv_t *buf_priv;
1577 drm_r128_indirect_t indirect; 1577 drm_r128_indirect_t indirect;
1578#if 0 1578#if 0
diff --git a/drivers/char/drm/r300_cmdbuf.c b/drivers/char/drm/r300_cmdbuf.c
index 0035e199c320..f8456f93b793 100644
--- a/drivers/char/drm/r300_cmdbuf.c
+++ b/drivers/char/drm/r300_cmdbuf.c
@@ -706,7 +706,7 @@ static __inline__ void r300_pacify(drm_radeon_private_t *dev_priv)
706 * The actual age emit is done by r300_do_cp_cmdbuf, which is why you must 706 * The actual age emit is done by r300_do_cp_cmdbuf, which is why you must
707 * be careful about how this function is called. 707 * be careful about how this function is called.
708 */ 708 */
709static void r300_discard_buffer(struct drm_device * dev, drm_buf_t * buf) 709static void r300_discard_buffer(struct drm_device * dev, struct drm_buf * buf)
710{ 710{
711 drm_radeon_private_t *dev_priv = dev->dev_private; 711 drm_radeon_private_t *dev_priv = dev->dev_private;
712 drm_radeon_buf_priv_t *buf_priv = buf->dev_private; 712 drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
@@ -786,7 +786,7 @@ int r300_do_cp_cmdbuf(struct drm_device *dev,
786{ 786{
787 drm_radeon_private_t *dev_priv = dev->dev_private; 787 drm_radeon_private_t *dev_priv = dev->dev_private;
788 drm_device_dma_t *dma = dev->dma; 788 drm_device_dma_t *dma = dev->dma;
789 drm_buf_t *buf = NULL; 789 struct drm_buf *buf = NULL;
790 int emit_dispatch_age = 0; 790 int emit_dispatch_age = 0;
791 int ret = 0; 791 int ret = 0;
792 792
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index d75a0ee5f47c..9e80af7aeeac 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -2046,12 +2046,12 @@ int radeon_fullscreen(DRM_IOCTL_ARGS)
2046 * they can't get the lock. 2046 * they can't get the lock.
2047 */ 2047 */
2048 2048
2049drm_buf_t *radeon_freelist_get(struct drm_device * dev) 2049struct drm_buf *radeon_freelist_get(struct drm_device * dev)
2050{ 2050{
2051 drm_device_dma_t *dma = dev->dma; 2051 drm_device_dma_t *dma = dev->dma;
2052 drm_radeon_private_t *dev_priv = dev->dev_private; 2052 drm_radeon_private_t *dev_priv = dev->dev_private;
2053 drm_radeon_buf_priv_t *buf_priv; 2053 drm_radeon_buf_priv_t *buf_priv;
2054 drm_buf_t *buf; 2054 struct drm_buf *buf;
2055 int i, t; 2055 int i, t;
2056 int start; 2056 int start;
2057 2057
@@ -2086,12 +2086,12 @@ drm_buf_t *radeon_freelist_get(struct drm_device * dev)
2086} 2086}
2087 2087
2088#if 0 2088#if 0
2089drm_buf_t *radeon_freelist_get(struct drm_device * dev) 2089struct drm_buf *radeon_freelist_get(struct drm_device * dev)
2090{ 2090{
2091 drm_device_dma_t *dma = dev->dma; 2091 drm_device_dma_t *dma = dev->dma;
2092 drm_radeon_private_t *dev_priv = dev->dev_private; 2092 drm_radeon_private_t *dev_priv = dev->dev_private;
2093 drm_radeon_buf_priv_t *buf_priv; 2093 drm_radeon_buf_priv_t *buf_priv;
2094 drm_buf_t *buf; 2094 struct drm_buf *buf;
2095 int i, t; 2095 int i, t;
2096 int start; 2096 int start;
2097 u32 done_age = DRM_READ32(dev_priv->ring_rptr, RADEON_SCRATCHOFF(1)); 2097 u32 done_age = DRM_READ32(dev_priv->ring_rptr, RADEON_SCRATCHOFF(1));
@@ -2128,7 +2128,7 @@ void radeon_freelist_reset(struct drm_device * dev)
2128 2128
2129 dev_priv->last_buf = 0; 2129 dev_priv->last_buf = 0;
2130 for (i = 0; i < dma->buf_count; i++) { 2130 for (i = 0; i < dma->buf_count; i++) {
2131 drm_buf_t *buf = dma->buflist[i]; 2131 struct drm_buf *buf = dma->buflist[i];
2132 drm_radeon_buf_priv_t *buf_priv = buf->dev_private; 2132 drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
2133 buf_priv->age = 0; 2133 buf_priv->age = 0;
2134 } 2134 }
@@ -2174,7 +2174,7 @@ static int radeon_cp_get_buffers(DRMFILE filp, struct drm_device * dev,
2174 struct drm_dma * d) 2174 struct drm_dma * d)
2175{ 2175{
2176 int i; 2176 int i;
2177 drm_buf_t *buf; 2177 struct drm_buf *buf;
2178 2178
2179 for (i = d->granted_count; i < d->request_count; i++) { 2179 for (i = d->granted_count; i < d->request_count; i++) {
2180 buf = radeon_freelist_get(dev); 2180 buf = radeon_freelist_get(dev);
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index abcae05c2873..59b1a6c111e1 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -155,7 +155,7 @@ enum radeon_chip_flags {
155 155
156typedef struct drm_radeon_freelist { 156typedef struct drm_radeon_freelist {
157 unsigned int age; 157 unsigned int age;
158 drm_buf_t *buf; 158 struct drm_buf *buf;
159 struct drm_radeon_freelist *next; 159 struct drm_radeon_freelist *next;
160 struct drm_radeon_freelist *prev; 160 struct drm_radeon_freelist *prev;
161} drm_radeon_freelist_t; 161} drm_radeon_freelist_t;
@@ -337,7 +337,7 @@ extern int radeon_fullscreen(DRM_IOCTL_ARGS);
337extern int radeon_cp_buffers(DRM_IOCTL_ARGS); 337extern int radeon_cp_buffers(DRM_IOCTL_ARGS);
338 338
339extern void radeon_freelist_reset(struct drm_device * dev); 339extern void radeon_freelist_reset(struct drm_device * dev);
340extern drm_buf_t *radeon_freelist_get(struct drm_device * dev); 340extern struct drm_buf *radeon_freelist_get(struct drm_device * dev);
341 341
342extern int radeon_wait_ring(drm_radeon_private_t * dev_priv, int n); 342extern int radeon_wait_ring(drm_radeon_private_t * dev_priv, int n);
343 343
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 2f325c79915e..3de58c3f97b0 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -1492,7 +1492,7 @@ typedef struct {
1492} drm_radeon_tcl_prim_t; 1492} drm_radeon_tcl_prim_t;
1493 1493
1494static void radeon_cp_dispatch_vertex(struct drm_device * dev, 1494static void radeon_cp_dispatch_vertex(struct drm_device * dev,
1495 drm_buf_t * buf, 1495 struct drm_buf * buf,
1496 drm_radeon_tcl_prim_t * prim) 1496 drm_radeon_tcl_prim_t * prim)
1497{ 1497{
1498 drm_radeon_private_t *dev_priv = dev->dev_private; 1498 drm_radeon_private_t *dev_priv = dev->dev_private;
@@ -1537,7 +1537,7 @@ static void radeon_cp_dispatch_vertex(struct drm_device * dev,
1537 } while (i < nbox); 1537 } while (i < nbox);
1538} 1538}
1539 1539
1540static void radeon_cp_discard_buffer(struct drm_device * dev, drm_buf_t * buf) 1540static void radeon_cp_discard_buffer(struct drm_device * dev, struct drm_buf * buf)
1541{ 1541{
1542 drm_radeon_private_t *dev_priv = dev->dev_private; 1542 drm_radeon_private_t *dev_priv = dev->dev_private;
1543 drm_radeon_buf_priv_t *buf_priv = buf->dev_private; 1543 drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
@@ -1555,7 +1555,7 @@ static void radeon_cp_discard_buffer(struct drm_device * dev, drm_buf_t * buf)
1555} 1555}
1556 1556
1557static void radeon_cp_dispatch_indirect(struct drm_device * dev, 1557static void radeon_cp_dispatch_indirect(struct drm_device * dev,
1558 drm_buf_t * buf, int start, int end) 1558 struct drm_buf * buf, int start, int end)
1559{ 1559{
1560 drm_radeon_private_t *dev_priv = dev->dev_private; 1560 drm_radeon_private_t *dev_priv = dev->dev_private;
1561 RING_LOCALS; 1561 RING_LOCALS;
@@ -1589,7 +1589,7 @@ static void radeon_cp_dispatch_indirect(struct drm_device * dev,
1589} 1589}
1590 1590
1591static void radeon_cp_dispatch_indices(struct drm_device * dev, 1591static void radeon_cp_dispatch_indices(struct drm_device * dev,
1592 drm_buf_t * elt_buf, 1592 struct drm_buf * elt_buf,
1593 drm_radeon_tcl_prim_t * prim) 1593 drm_radeon_tcl_prim_t * prim)
1594{ 1594{
1595 drm_radeon_private_t *dev_priv = dev->dev_private; 1595 drm_radeon_private_t *dev_priv = dev->dev_private;
@@ -1653,7 +1653,7 @@ static int radeon_cp_dispatch_texture(DRMFILE filp,
1653{ 1653{
1654 drm_radeon_private_t *dev_priv = dev->dev_private; 1654 drm_radeon_private_t *dev_priv = dev->dev_private;
1655 struct drm_file *filp_priv; 1655 struct drm_file *filp_priv;
1656 drm_buf_t *buf; 1656 struct drm_buf *buf;
1657 u32 format; 1657 u32 format;
1658 u32 *buffer; 1658 u32 *buffer;
1659 const u8 __user *data; 1659 const u8 __user *data;
@@ -2209,7 +2209,7 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)
2209 struct drm_file *filp_priv; 2209 struct drm_file *filp_priv;
2210 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; 2210 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
2211 drm_device_dma_t *dma = dev->dma; 2211 drm_device_dma_t *dma = dev->dma;
2212 drm_buf_t *buf; 2212 struct drm_buf *buf;
2213 drm_radeon_vertex_t vertex; 2213 drm_radeon_vertex_t vertex;
2214 drm_radeon_tcl_prim_t prim; 2214 drm_radeon_tcl_prim_t prim;
2215 2215
@@ -2292,7 +2292,7 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)
2292 struct drm_file *filp_priv; 2292 struct drm_file *filp_priv;
2293 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; 2293 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
2294 drm_device_dma_t *dma = dev->dma; 2294 drm_device_dma_t *dma = dev->dma;
2295 drm_buf_t *buf; 2295 struct drm_buf *buf;
2296 drm_radeon_indices_t elts; 2296 drm_radeon_indices_t elts;
2297 drm_radeon_tcl_prim_t prim; 2297 drm_radeon_tcl_prim_t prim;
2298 int count; 2298 int count;
@@ -2439,7 +2439,7 @@ static int radeon_cp_indirect(DRM_IOCTL_ARGS)
2439 DRM_DEVICE; 2439 DRM_DEVICE;
2440 drm_radeon_private_t *dev_priv = dev->dev_private; 2440 drm_radeon_private_t *dev_priv = dev->dev_private;
2441 drm_device_dma_t *dma = dev->dma; 2441 drm_device_dma_t *dma = dev->dma;
2442 drm_buf_t *buf; 2442 struct drm_buf *buf;
2443 drm_radeon_indirect_t indirect; 2443 drm_radeon_indirect_t indirect;
2444 RING_LOCALS; 2444 RING_LOCALS;
2445 2445
@@ -2510,7 +2510,7 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)
2510 struct drm_file *filp_priv; 2510 struct drm_file *filp_priv;
2511 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv; 2511 drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
2512 drm_device_dma_t *dma = dev->dma; 2512 drm_device_dma_t *dma = dev->dma;
2513 drm_buf_t *buf; 2513 struct drm_buf *buf;
2514 drm_radeon_vertex2_t vertex; 2514 drm_radeon_vertex2_t vertex;
2515 int i; 2515 int i;
2516 unsigned char laststate; 2516 unsigned char laststate;
@@ -2851,7 +2851,7 @@ static int radeon_cp_cmdbuf(DRM_IOCTL_ARGS)
2851 drm_radeon_private_t *dev_priv = dev->dev_private; 2851 drm_radeon_private_t *dev_priv = dev->dev_private;
2852 struct drm_file *filp_priv; 2852 struct drm_file *filp_priv;
2853 drm_device_dma_t *dma = dev->dma; 2853 drm_device_dma_t *dma = dev->dma;
2854 drm_buf_t *buf = NULL; 2854 struct drm_buf *buf = NULL;
2855 int idx; 2855 int idx;
2856 drm_radeon_kcmd_buffer_t cmdbuf; 2856 drm_radeon_kcmd_buffer_t cmdbuf;
2857 drm_radeon_cmd_header_t header; 2857 drm_radeon_cmd_header_t header;
diff --git a/drivers/char/drm/savage_bci.c b/drivers/char/drm/savage_bci.c
index 1061e7bb6854..2964c63a1a45 100644
--- a/drivers/char/drm/savage_bci.c
+++ b/drivers/char/drm/savage_bci.c
@@ -207,7 +207,7 @@ static int savage_freelist_init(struct drm_device * dev)
207{ 207{
208 drm_savage_private_t *dev_priv = dev->dev_private; 208 drm_savage_private_t *dev_priv = dev->dev_private;
209 drm_device_dma_t *dma = dev->dma; 209 drm_device_dma_t *dma = dev->dma;
210 drm_buf_t *buf; 210 struct drm_buf *buf;
211 drm_savage_buf_priv_t *entry; 211 drm_savage_buf_priv_t *entry;
212 int i; 212 int i;
213 DRM_DEBUG("count=%d\n", dma->buf_count); 213 DRM_DEBUG("count=%d\n", dma->buf_count);
@@ -236,7 +236,7 @@ static int savage_freelist_init(struct drm_device * dev)
236 return 0; 236 return 0;
237} 237}
238 238
239static drm_buf_t *savage_freelist_get(struct drm_device * dev) 239static struct drm_buf *savage_freelist_get(struct drm_device * dev)
240{ 240{
241 drm_savage_private_t *dev_priv = dev->dev_private; 241 drm_savage_private_t *dev_priv = dev->dev_private;
242 drm_savage_buf_priv_t *tail = dev_priv->tail.prev; 242 drm_savage_buf_priv_t *tail = dev_priv->tail.prev;
@@ -269,7 +269,7 @@ static drm_buf_t *savage_freelist_get(struct drm_device * dev)
269 return NULL; 269 return NULL;
270} 270}
271 271
272void savage_freelist_put(struct drm_device * dev, drm_buf_t * buf) 272void savage_freelist_put(struct drm_device * dev, struct drm_buf * buf)
273{ 273{
274 drm_savage_private_t *dev_priv = dev->dev_private; 274 drm_savage_private_t *dev_priv = dev->dev_private;
275 drm_savage_buf_priv_t *entry = buf->dev_private, *prev, *next; 275 drm_savage_buf_priv_t *entry = buf->dev_private, *prev, *next;
@@ -1009,7 +1009,7 @@ static int savage_bci_event_wait(DRM_IOCTL_ARGS)
1009 1009
1010static int savage_bci_get_buffers(DRMFILE filp, struct drm_device *dev, struct drm_dma *d) 1010static int savage_bci_get_buffers(DRMFILE filp, struct drm_device *dev, struct drm_dma *d)
1011{ 1011{
1012 drm_buf_t *buf; 1012 struct drm_buf *buf;
1013 int i; 1013 int i;
1014 1014
1015 for (i = d->granted_count; i < d->request_count; i++) { 1015 for (i = d->granted_count; i < d->request_count; i++) {
@@ -1085,7 +1085,7 @@ void savage_reclaim_buffers(struct drm_device *dev, DRMFILE filp)
1085 /*i830_flush_queue(dev); */ 1085 /*i830_flush_queue(dev); */
1086 1086
1087 for (i = 0; i < dma->buf_count; i++) { 1087 for (i = 0; i < dma->buf_count; i++) {
1088 drm_buf_t *buf = dma->buflist[i]; 1088 struct drm_buf *buf = dma->buflist[i];
1089 drm_savage_buf_priv_t *buf_priv = buf->dev_private; 1089 drm_savage_buf_priv_t *buf_priv = buf->dev_private;
1090 1090
1091 if (buf->filp == filp && buf_priv && 1091 if (buf->filp == filp && buf_priv &&
diff --git a/drivers/char/drm/savage_drv.h b/drivers/char/drm/savage_drv.h
index da8afb37b3c9..5fd54de4280e 100644
--- a/drivers/char/drm/savage_drv.h
+++ b/drivers/char/drm/savage_drv.h
@@ -58,7 +58,7 @@ typedef struct drm_savage_buf_priv {
58 struct drm_savage_buf_priv *next; 58 struct drm_savage_buf_priv *next;
59 struct drm_savage_buf_priv *prev; 59 struct drm_savage_buf_priv *prev;
60 drm_savage_age_t age; 60 drm_savage_age_t age;
61 drm_buf_t *buf; 61 struct drm_buf *buf;
62} drm_savage_buf_priv_t; 62} drm_savage_buf_priv_t;
63 63
64typedef struct drm_savage_dma_page { 64typedef struct drm_savage_dma_page {
@@ -203,7 +203,7 @@ extern int savage_bci_buffers(DRM_IOCTL_ARGS);
203/* BCI functions */ 203/* BCI functions */
204extern uint16_t savage_bci_emit_event(drm_savage_private_t * dev_priv, 204extern uint16_t savage_bci_emit_event(drm_savage_private_t * dev_priv,
205 unsigned int flags); 205 unsigned int flags);
206extern void savage_freelist_put(struct drm_device * dev, drm_buf_t * buf); 206extern void savage_freelist_put(struct drm_device * dev, struct drm_buf * buf);
207extern void savage_dma_reset(drm_savage_private_t * dev_priv); 207extern void savage_dma_reset(drm_savage_private_t * dev_priv);
208extern void savage_dma_wait(drm_savage_private_t * dev_priv, unsigned int page); 208extern void savage_dma_wait(drm_savage_private_t * dev_priv, unsigned int page);
209extern uint32_t *savage_dma_alloc(drm_savage_private_t * dev_priv, 209extern uint32_t *savage_dma_alloc(drm_savage_private_t * dev_priv,
diff --git a/drivers/char/drm/savage_state.c b/drivers/char/drm/savage_state.c
index 73fa9ef43c57..a30f4546cdb8 100644
--- a/drivers/char/drm/savage_state.c
+++ b/drivers/char/drm/savage_state.c
@@ -277,7 +277,7 @@ static int savage_dispatch_state(drm_savage_private_t * dev_priv,
277 277
278static int savage_dispatch_dma_prim(drm_savage_private_t * dev_priv, 278static int savage_dispatch_dma_prim(drm_savage_private_t * dev_priv,
279 const drm_savage_cmd_header_t * cmd_header, 279 const drm_savage_cmd_header_t * cmd_header,
280 const drm_buf_t * dmabuf) 280 const struct drm_buf * dmabuf)
281{ 281{
282 unsigned char reorder = 0; 282 unsigned char reorder = 0;
283 unsigned int prim = cmd_header->prim.prim; 283 unsigned int prim = cmd_header->prim.prim;
@@ -536,7 +536,7 @@ static int savage_dispatch_vb_prim(drm_savage_private_t * dev_priv,
536static int savage_dispatch_dma_idx(drm_savage_private_t * dev_priv, 536static int savage_dispatch_dma_idx(drm_savage_private_t * dev_priv,
537 const drm_savage_cmd_header_t * cmd_header, 537 const drm_savage_cmd_header_t * cmd_header,
538 const uint16_t *idx, 538 const uint16_t *idx,
539 const drm_buf_t * dmabuf) 539 const struct drm_buf * dmabuf)
540{ 540{
541 unsigned char reorder = 0; 541 unsigned char reorder = 0;
542 unsigned int prim = cmd_header->idx.prim; 542 unsigned int prim = cmd_header->idx.prim;
@@ -892,7 +892,7 @@ static int savage_dispatch_swap(drm_savage_private_t * dev_priv,
892static int savage_dispatch_draw(drm_savage_private_t * dev_priv, 892static int savage_dispatch_draw(drm_savage_private_t * dev_priv,
893 const drm_savage_cmd_header_t *start, 893 const drm_savage_cmd_header_t *start,
894 const drm_savage_cmd_header_t *end, 894 const drm_savage_cmd_header_t *end,
895 const drm_buf_t * dmabuf, 895 const struct drm_buf * dmabuf,
896 const unsigned int *vtxbuf, 896 const unsigned int *vtxbuf,
897 unsigned int vb_size, unsigned int vb_stride, 897 unsigned int vb_size, unsigned int vb_stride,
898 unsigned int nbox, 898 unsigned int nbox,
@@ -958,7 +958,7 @@ int savage_bci_cmdbuf(DRM_IOCTL_ARGS)
958 DRM_DEVICE; 958 DRM_DEVICE;
959 drm_savage_private_t *dev_priv = dev->dev_private; 959 drm_savage_private_t *dev_priv = dev->dev_private;
960 drm_device_dma_t *dma = dev->dma; 960 drm_device_dma_t *dma = dev->dma;
961 drm_buf_t *dmabuf; 961 struct drm_buf *dmabuf;
962 drm_savage_cmdbuf_t cmdbuf; 962 drm_savage_cmdbuf_t cmdbuf;
963 drm_savage_cmd_header_t *kcmd_addr = NULL; 963 drm_savage_cmd_header_t *kcmd_addr = NULL;
964 drm_savage_cmd_header_t *first_draw_cmd; 964 drm_savage_cmd_header_t *first_draw_cmd;