diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 15:15:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 15:15:50 -0400 |
commit | c2dc1ad582196208a2f990eb0230eb922046c684 (patch) | |
tree | f2c7d03a9f8007af0a43111423dbf96ccef77db4 /drivers/char/drm/i830_dma.c | |
parent | 5b37696fda07b8acf37beba3853f83106397ccdf (diff) | |
parent | ff4135aeb1f9a0201f8e22400ebc1d570df9016e (diff) |
Merge branch 'drm-patches' of ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-patches' of ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm: remove core typedefs from the ioc32 wrappers
drm: remove sarea typedefs
drm: detypedef the hashtab and more of sman
drm: de-typedef sman
drm: detypedeffing continues...
drm: detypef waitlist/freelist/buf_entry/device_dma/drm_queue structs
drm: drop drm_vma_entry_t, drm_magic_entry_t
drm: drop drm_buf_t typedef
drm: fixup other drivers for typedef removals
drm: remove drm_file_t, drm_device_t and drm_head_t typedefs
drm: remove a bunch of typedefs on the userspace interface
r300: updates register header
radeon: add support for vblank on crtc2
drm: cleanup list initialisation
drm: fix typo on code drm getsarea
drm: remove DRM_GETSAREA and replace with drm_getsarea function
drm: cleanup use of Linux list handling macros
Diffstat (limited to 'drivers/char/drm/i830_dma.c')
-rw-r--r-- | drivers/char/drm/i830_dma.c | 157 |
1 files changed, 78 insertions, 79 deletions
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 3314a9fea9e5..dc20c1a7834e 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c | |||
@@ -47,16 +47,16 @@ | |||
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 | ||
50 | static drm_buf_t *i830_freelist_get(drm_device_t * dev) | 50 | static struct drm_buf *i830_freelist_get(struct drm_device * dev) |
51 | { | 51 | { |
52 | drm_device_dma_t *dma = dev->dma; | 52 | struct drm_device_dma *dma = dev->dma; |
53 | int i; | 53 | int i; |
54 | int used; | 54 | int used; |
55 | 55 | ||
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(drm_device_t * 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 | ||
75 | static int i830_freelist_put(drm_device_t * dev, drm_buf_t * buf) | 75 | static 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; |
@@ -89,10 +89,10 @@ static int i830_freelist_put(drm_device_t * dev, drm_buf_t * buf) | |||
89 | 89 | ||
90 | static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | 90 | static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) |
91 | { | 91 | { |
92 | drm_file_t *priv = filp->private_data; | 92 | struct drm_file *priv = filp->private_data; |
93 | drm_device_t *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,10 +122,10 @@ static const struct file_operations i830_buffer_fops = { | |||
122 | .fasync = drm_fasync, | 122 | .fasync = drm_fasync, |
123 | }; | 123 | }; |
124 | 124 | ||
125 | static int i830_map_buffer(drm_buf_t * buf, struct file *filp) | 125 | static int i830_map_buffer(struct drm_buf * buf, struct file *filp) |
126 | { | 126 | { |
127 | drm_file_t *priv = filp->private_data; | 127 | struct drm_file *priv = filp->private_data; |
128 | drm_device_t *dev = priv->head->dev; | 128 | struct drm_device *dev = priv->head->dev; |
129 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; | 129 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; |
130 | drm_i830_private_t *dev_priv = dev->dev_private; | 130 | drm_i830_private_t *dev_priv = dev->dev_private; |
131 | const struct file_operations *old_fops; | 131 | const struct file_operations *old_fops; |
@@ -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 | ||
159 | static int i830_unmap_buffer(drm_buf_t * buf) | 159 | static 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; |
@@ -176,10 +176,10 @@ static int i830_unmap_buffer(drm_buf_t * buf) | |||
176 | return retcode; | 176 | return retcode; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int i830_dma_get_buffer(drm_device_t * dev, drm_i830_dma_t * d, | 179 | static 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 | ||
@@ -206,9 +206,9 @@ static int i830_dma_get_buffer(drm_device_t * dev, drm_i830_dma_t * d, | |||
206 | return retcode; | 206 | return retcode; |
207 | } | 207 | } |
208 | 208 | ||
209 | static int i830_dma_cleanup(drm_device_t * dev) | 209 | static int i830_dma_cleanup(struct drm_device * dev) |
210 | { | 210 | { |
211 | drm_device_dma_t *dma = dev->dma; | 211 | struct drm_device_dma *dma = dev->dma; |
212 | 212 | ||
213 | /* Make sure interrupts are disabled here because the uninstall ioctl | 213 | /* Make sure interrupts are disabled here because the uninstall ioctl |
214 | * may not have been called from userspace and after dev_private | 214 | * may not have been called from userspace and after dev_private |
@@ -238,7 +238,7 @@ static int i830_dma_cleanup(drm_device_t * 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); |
@@ -247,7 +247,7 @@ static int i830_dma_cleanup(drm_device_t * dev) | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | int i830_wait_ring(drm_device_t * dev, int n, const char *caller) | 250 | int i830_wait_ring(struct drm_device * dev, int n, const char *caller) |
251 | { | 251 | { |
252 | drm_i830_private_t *dev_priv = dev->dev_private; | 252 | drm_i830_private_t *dev_priv = dev->dev_private; |
253 | drm_i830_ring_buffer_t *ring = &(dev_priv->ring); | 253 | drm_i830_ring_buffer_t *ring = &(dev_priv->ring); |
@@ -281,7 +281,7 @@ int i830_wait_ring(drm_device_t * dev, int n, const char *caller) | |||
281 | return iters; | 281 | return iters; |
282 | } | 282 | } |
283 | 283 | ||
284 | static void i830_kernel_lost_context(drm_device_t * dev) | 284 | static void i830_kernel_lost_context(struct drm_device * dev) |
285 | { | 285 | { |
286 | drm_i830_private_t *dev_priv = dev->dev_private; | 286 | drm_i830_private_t *dev_priv = dev->dev_private; |
287 | drm_i830_ring_buffer_t *ring = &(dev_priv->ring); | 287 | drm_i830_ring_buffer_t *ring = &(dev_priv->ring); |
@@ -296,9 +296,9 @@ static void i830_kernel_lost_context(drm_device_t * dev) | |||
296 | dev_priv->sarea_priv->perf_boxes |= I830_BOX_RING_EMPTY; | 296 | dev_priv->sarea_priv->perf_boxes |= I830_BOX_RING_EMPTY; |
297 | } | 297 | } |
298 | 298 | ||
299 | static int i830_freelist_init(drm_device_t * dev, drm_i830_private_t * dev_priv) | 299 | static int i830_freelist_init(struct drm_device * dev, drm_i830_private_t * dev_priv) |
300 | { | 300 | { |
301 | drm_device_dma_t *dma = dev->dma; | 301 | struct drm_device_dma *dma = dev->dma; |
302 | int my_idx = 36; | 302 | int my_idx = 36; |
303 | u32 *hw_status = (u32 *) (dev_priv->hw_status_page + my_idx); | 303 | u32 *hw_status = (u32 *) (dev_priv->hw_status_page + my_idx); |
304 | int i; | 304 | int i; |
@@ -309,7 +309,7 @@ static int i830_freelist_init(drm_device_t * dev, drm_i830_private_t * dev_priv) | |||
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++; |
@@ -330,16 +330,15 @@ static int i830_freelist_init(drm_device_t * dev, drm_i830_private_t * dev_priv) | |||
330 | return 0; | 330 | return 0; |
331 | } | 331 | } |
332 | 332 | ||
333 | static int i830_dma_initialize(drm_device_t * dev, | 333 | static int i830_dma_initialize(struct drm_device * dev, |
334 | drm_i830_private_t * dev_priv, | 334 | drm_i830_private_t * dev_priv, |
335 | drm_i830_init_t * init) | 335 | drm_i830_init_t * init) |
336 | { | 336 | { |
337 | struct list_head *list; | 337 | struct drm_map_list *r_list; |
338 | 338 | ||
339 | memset(dev_priv, 0, sizeof(drm_i830_private_t)); | 339 | memset(dev_priv, 0, sizeof(drm_i830_private_t)); |
340 | 340 | ||
341 | list_for_each(list, &dev->maplist->head) { | 341 | list_for_each_entry(r_list, &dev->maplist, head) { |
342 | drm_map_list_t *r_list = list_entry(list, drm_map_list_t, head); | ||
343 | if (r_list->map && | 342 | if (r_list->map && |
344 | r_list->map->type == _DRM_SHM && | 343 | r_list->map->type == _DRM_SHM && |
345 | r_list->map->flags & _DRM_CONTAINS_LOCK) { | 344 | r_list->map->flags & _DRM_CONTAINS_LOCK) { |
@@ -455,8 +454,8 @@ static int i830_dma_initialize(drm_device_t * dev, | |||
455 | static int i830_dma_init(struct inode *inode, struct file *filp, | 454 | static int i830_dma_init(struct inode *inode, struct file *filp, |
456 | unsigned int cmd, unsigned long arg) | 455 | unsigned int cmd, unsigned long arg) |
457 | { | 456 | { |
458 | drm_file_t *priv = filp->private_data; | 457 | struct drm_file *priv = filp->private_data; |
459 | drm_device_t *dev = priv->head->dev; | 458 | struct drm_device *dev = priv->head->dev; |
460 | drm_i830_private_t *dev_priv; | 459 | drm_i830_private_t *dev_priv; |
461 | drm_i830_init_t init; | 460 | drm_i830_init_t init; |
462 | int retcode = 0; | 461 | int retcode = 0; |
@@ -490,7 +489,7 @@ static int i830_dma_init(struct inode *inode, struct file *filp, | |||
490 | /* Most efficient way to verify state for the i830 is as it is | 489 | /* Most efficient way to verify state for the i830 is as it is |
491 | * emitted. Non-conformant state is silently dropped. | 490 | * emitted. Non-conformant state is silently dropped. |
492 | */ | 491 | */ |
493 | static void i830EmitContextVerified(drm_device_t * dev, unsigned int *code) | 492 | static void i830EmitContextVerified(struct drm_device * dev, unsigned int *code) |
494 | { | 493 | { |
495 | drm_i830_private_t *dev_priv = dev->dev_private; | 494 | drm_i830_private_t *dev_priv = dev->dev_private; |
496 | int i, j = 0; | 495 | int i, j = 0; |
@@ -535,7 +534,7 @@ static void i830EmitContextVerified(drm_device_t * dev, unsigned int *code) | |||
535 | ADVANCE_LP_RING(); | 534 | ADVANCE_LP_RING(); |
536 | } | 535 | } |
537 | 536 | ||
538 | static void i830EmitTexVerified(drm_device_t * dev, unsigned int *code) | 537 | static void i830EmitTexVerified(struct drm_device * dev, unsigned int *code) |
539 | { | 538 | { |
540 | drm_i830_private_t *dev_priv = dev->dev_private; | 539 | drm_i830_private_t *dev_priv = dev->dev_private; |
541 | int i, j = 0; | 540 | int i, j = 0; |
@@ -569,7 +568,7 @@ static void i830EmitTexVerified(drm_device_t * dev, unsigned int *code) | |||
569 | printk("rejected packet %x\n", code[0]); | 568 | printk("rejected packet %x\n", code[0]); |
570 | } | 569 | } |
571 | 570 | ||
572 | static void i830EmitTexBlendVerified(drm_device_t * dev, | 571 | static void i830EmitTexBlendVerified(struct drm_device * dev, |
573 | unsigned int *code, unsigned int num) | 572 | unsigned int *code, unsigned int num) |
574 | { | 573 | { |
575 | drm_i830_private_t *dev_priv = dev->dev_private; | 574 | drm_i830_private_t *dev_priv = dev->dev_private; |
@@ -594,7 +593,7 @@ static void i830EmitTexBlendVerified(drm_device_t * dev, | |||
594 | ADVANCE_LP_RING(); | 593 | ADVANCE_LP_RING(); |
595 | } | 594 | } |
596 | 595 | ||
597 | static void i830EmitTexPalette(drm_device_t * dev, | 596 | static void i830EmitTexPalette(struct drm_device * dev, |
598 | unsigned int *palette, int number, int is_shared) | 597 | unsigned int *palette, int number, int is_shared) |
599 | { | 598 | { |
600 | drm_i830_private_t *dev_priv = dev->dev_private; | 599 | drm_i830_private_t *dev_priv = dev->dev_private; |
@@ -621,7 +620,7 @@ static void i830EmitTexPalette(drm_device_t * dev, | |||
621 | 620 | ||
622 | /* Need to do some additional checking when setting the dest buffer. | 621 | /* Need to do some additional checking when setting the dest buffer. |
623 | */ | 622 | */ |
624 | static void i830EmitDestVerified(drm_device_t * dev, unsigned int *code) | 623 | static void i830EmitDestVerified(struct drm_device * dev, unsigned int *code) |
625 | { | 624 | { |
626 | drm_i830_private_t *dev_priv = dev->dev_private; | 625 | drm_i830_private_t *dev_priv = dev->dev_private; |
627 | unsigned int tmp; | 626 | unsigned int tmp; |
@@ -682,7 +681,7 @@ static void i830EmitDestVerified(drm_device_t * dev, unsigned int *code) | |||
682 | ADVANCE_LP_RING(); | 681 | ADVANCE_LP_RING(); |
683 | } | 682 | } |
684 | 683 | ||
685 | static void i830EmitStippleVerified(drm_device_t * dev, unsigned int *code) | 684 | static void i830EmitStippleVerified(struct drm_device * dev, unsigned int *code) |
686 | { | 685 | { |
687 | drm_i830_private_t *dev_priv = dev->dev_private; | 686 | drm_i830_private_t *dev_priv = dev->dev_private; |
688 | RING_LOCALS; | 687 | RING_LOCALS; |
@@ -693,7 +692,7 @@ static void i830EmitStippleVerified(drm_device_t * dev, unsigned int *code) | |||
693 | ADVANCE_LP_RING(); | 692 | ADVANCE_LP_RING(); |
694 | } | 693 | } |
695 | 694 | ||
696 | static void i830EmitState(drm_device_t * dev) | 695 | static void i830EmitState(struct drm_device * dev) |
697 | { | 696 | { |
698 | drm_i830_private_t *dev_priv = dev->dev_private; | 697 | drm_i830_private_t *dev_priv = dev->dev_private; |
699 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; | 698 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; |
@@ -796,7 +795,7 @@ static void i830EmitState(drm_device_t * dev) | |||
796 | * Performance monitoring functions | 795 | * Performance monitoring functions |
797 | */ | 796 | */ |
798 | 797 | ||
799 | static void i830_fill_box(drm_device_t * dev, | 798 | static void i830_fill_box(struct drm_device * dev, |
800 | int x, int y, int w, int h, int r, int g, int b) | 799 | int x, int y, int w, int h, int r, int g, int b) |
801 | { | 800 | { |
802 | drm_i830_private_t *dev_priv = dev->dev_private; | 801 | drm_i830_private_t *dev_priv = dev->dev_private; |
@@ -834,7 +833,7 @@ static void i830_fill_box(drm_device_t * dev, | |||
834 | ADVANCE_LP_RING(); | 833 | ADVANCE_LP_RING(); |
835 | } | 834 | } |
836 | 835 | ||
837 | static void i830_cp_performance_boxes(drm_device_t * dev) | 836 | static void i830_cp_performance_boxes(struct drm_device * dev) |
838 | { | 837 | { |
839 | drm_i830_private_t *dev_priv = dev->dev_private; | 838 | drm_i830_private_t *dev_priv = dev->dev_private; |
840 | 839 | ||
@@ -879,7 +878,7 @@ static void i830_cp_performance_boxes(drm_device_t * dev) | |||
879 | dev_priv->sarea_priv->perf_boxes = 0; | 878 | dev_priv->sarea_priv->perf_boxes = 0; |
880 | } | 879 | } |
881 | 880 | ||
882 | static void i830_dma_dispatch_clear(drm_device_t * dev, int flags, | 881 | static void i830_dma_dispatch_clear(struct drm_device * dev, int flags, |
883 | unsigned int clear_color, | 882 | unsigned int clear_color, |
884 | unsigned int clear_zval, | 883 | unsigned int clear_zval, |
885 | unsigned int clear_depthmask) | 884 | unsigned int clear_depthmask) |
@@ -887,7 +886,7 @@ static void i830_dma_dispatch_clear(drm_device_t * dev, int flags, | |||
887 | drm_i830_private_t *dev_priv = dev->dev_private; | 886 | drm_i830_private_t *dev_priv = dev->dev_private; |
888 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; | 887 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; |
889 | int nbox = sarea_priv->nbox; | 888 | int nbox = sarea_priv->nbox; |
890 | drm_clip_rect_t *pbox = sarea_priv->boxes; | 889 | struct drm_clip_rect *pbox = sarea_priv->boxes; |
891 | int pitch = dev_priv->pitch; | 890 | int pitch = dev_priv->pitch; |
892 | int cpp = dev_priv->cpp; | 891 | int cpp = dev_priv->cpp; |
893 | int i; | 892 | int i; |
@@ -974,12 +973,12 @@ static void i830_dma_dispatch_clear(drm_device_t * dev, int flags, | |||
974 | } | 973 | } |
975 | } | 974 | } |
976 | 975 | ||
977 | static void i830_dma_dispatch_swap(drm_device_t * dev) | 976 | static void i830_dma_dispatch_swap(struct drm_device * dev) |
978 | { | 977 | { |
979 | drm_i830_private_t *dev_priv = dev->dev_private; | 978 | drm_i830_private_t *dev_priv = dev->dev_private; |
980 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; | 979 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; |
981 | int nbox = sarea_priv->nbox; | 980 | int nbox = sarea_priv->nbox; |
982 | drm_clip_rect_t *pbox = sarea_priv->boxes; | 981 | struct drm_clip_rect *pbox = sarea_priv->boxes; |
983 | int pitch = dev_priv->pitch; | 982 | int pitch = dev_priv->pitch; |
984 | int cpp = dev_priv->cpp; | 983 | int cpp = dev_priv->cpp; |
985 | int i; | 984 | int i; |
@@ -1044,7 +1043,7 @@ static void i830_dma_dispatch_swap(drm_device_t * dev) | |||
1044 | } | 1043 | } |
1045 | } | 1044 | } |
1046 | 1045 | ||
1047 | static void i830_dma_dispatch_flip(drm_device_t * dev) | 1046 | static void i830_dma_dispatch_flip(struct drm_device * dev) |
1048 | { | 1047 | { |
1049 | drm_i830_private_t *dev_priv = dev->dev_private; | 1048 | drm_i830_private_t *dev_priv = dev->dev_private; |
1050 | RING_LOCALS; | 1049 | RING_LOCALS; |
@@ -1087,13 +1086,13 @@ static void i830_dma_dispatch_flip(drm_device_t * dev) | |||
1087 | dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; | 1086 | dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; |
1088 | } | 1087 | } |
1089 | 1088 | ||
1090 | static void i830_dma_dispatch_vertex(drm_device_t * dev, | 1089 | static void i830_dma_dispatch_vertex(struct drm_device * dev, |
1091 | drm_buf_t * buf, int discard, int used) | 1090 | struct drm_buf * buf, int discard, int used) |
1092 | { | 1091 | { |
1093 | drm_i830_private_t *dev_priv = dev->dev_private; | 1092 | drm_i830_private_t *dev_priv = dev->dev_private; |
1094 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; | 1093 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; |
1095 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; | 1094 | drm_i830_sarea_t *sarea_priv = dev_priv->sarea_priv; |
1096 | drm_clip_rect_t *box = sarea_priv->boxes; | 1095 | struct drm_clip_rect *box = sarea_priv->boxes; |
1097 | int nbox = sarea_priv->nbox; | 1096 | int nbox = sarea_priv->nbox; |
1098 | unsigned long address = (unsigned long)buf->bus_address; | 1097 | unsigned long address = (unsigned long)buf->bus_address; |
1099 | unsigned long start = address - dev->agp->base; | 1098 | unsigned long start = address - dev->agp->base; |
@@ -1199,7 +1198,7 @@ static void i830_dma_dispatch_vertex(drm_device_t * dev, | |||
1199 | } | 1198 | } |
1200 | } | 1199 | } |
1201 | 1200 | ||
1202 | static void i830_dma_quiescent(drm_device_t * dev) | 1201 | static void i830_dma_quiescent(struct drm_device * dev) |
1203 | { | 1202 | { |
1204 | drm_i830_private_t *dev_priv = dev->dev_private; | 1203 | drm_i830_private_t *dev_priv = dev->dev_private; |
1205 | RING_LOCALS; | 1204 | RING_LOCALS; |
@@ -1216,10 +1215,10 @@ static void i830_dma_quiescent(drm_device_t * dev) | |||
1216 | i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); | 1215 | i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); |
1217 | } | 1216 | } |
1218 | 1217 | ||
1219 | static int i830_flush_queue(drm_device_t * dev) | 1218 | static int i830_flush_queue(struct drm_device * dev) |
1220 | { | 1219 | { |
1221 | drm_i830_private_t *dev_priv = dev->dev_private; | 1220 | drm_i830_private_t *dev_priv = dev->dev_private; |
1222 | drm_device_dma_t *dma = dev->dma; | 1221 | struct drm_device_dma *dma = dev->dma; |
1223 | int i, ret = 0; | 1222 | int i, ret = 0; |
1224 | RING_LOCALS; | 1223 | RING_LOCALS; |
1225 | 1224 | ||
@@ -1233,7 +1232,7 @@ static int i830_flush_queue(drm_device_t * dev) | |||
1233 | i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); | 1232 | i830_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__); |
1234 | 1233 | ||
1235 | for (i = 0; i < dma->buf_count; i++) { | 1234 | for (i = 0; i < dma->buf_count; i++) { |
1236 | drm_buf_t *buf = dma->buflist[i]; | 1235 | struct drm_buf *buf = dma->buflist[i]; |
1237 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; | 1236 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; |
1238 | 1237 | ||
1239 | int used = cmpxchg(buf_priv->in_use, I830_BUF_HARDWARE, | 1238 | int used = cmpxchg(buf_priv->in_use, I830_BUF_HARDWARE, |
@@ -1249,9 +1248,9 @@ static int i830_flush_queue(drm_device_t * dev) | |||
1249 | } | 1248 | } |
1250 | 1249 | ||
1251 | /* Must be called with the lock held */ | 1250 | /* Must be called with the lock held */ |
1252 | static void i830_reclaim_buffers(drm_device_t * dev, struct file *filp) | 1251 | static void i830_reclaim_buffers(struct drm_device * dev, struct file *filp) |
1253 | { | 1252 | { |
1254 | drm_device_dma_t *dma = dev->dma; | 1253 | struct drm_device_dma *dma = dev->dma; |
1255 | int i; | 1254 | int i; |
1256 | 1255 | ||
1257 | if (!dma) | 1256 | if (!dma) |
@@ -1264,7 +1263,7 @@ static void i830_reclaim_buffers(drm_device_t * dev, struct file *filp) | |||
1264 | i830_flush_queue(dev); | 1263 | i830_flush_queue(dev); |
1265 | 1264 | ||
1266 | for (i = 0; i < dma->buf_count; i++) { | 1265 | for (i = 0; i < dma->buf_count; i++) { |
1267 | drm_buf_t *buf = dma->buflist[i]; | 1266 | struct drm_buf *buf = dma->buflist[i]; |
1268 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; | 1267 | drm_i830_buf_priv_t *buf_priv = buf->dev_private; |
1269 | 1268 | ||
1270 | if (buf->filp == filp && buf_priv) { | 1269 | if (buf->filp == filp && buf_priv) { |
@@ -1282,8 +1281,8 @@ static void i830_reclaim_buffers(drm_device_t * dev, struct file *filp) | |||
1282 | static int i830_flush_ioctl(struct inode *inode, struct file *filp, | 1281 | static int i830_flush_ioctl(struct inode *inode, struct file *filp, |
1283 | unsigned int cmd, unsigned long arg) | 1282 | unsigned int cmd, unsigned long arg) |
1284 | { | 1283 | { |
1285 | drm_file_t *priv = filp->private_data; | 1284 | struct drm_file *priv = filp->private_data; |
1286 | drm_device_t *dev = priv->head->dev; | 1285 | struct drm_device *dev = priv->head->dev; |
1287 | 1286 | ||
1288 | LOCK_TEST_WITH_RETURN(dev, filp); | 1287 | LOCK_TEST_WITH_RETURN(dev, filp); |
1289 | 1288 | ||
@@ -1294,9 +1293,9 @@ static int i830_flush_ioctl(struct inode *inode, struct file *filp, | |||
1294 | static int i830_dma_vertex(struct inode *inode, struct file *filp, | 1293 | static int i830_dma_vertex(struct inode *inode, struct file *filp, |
1295 | unsigned int cmd, unsigned long arg) | 1294 | unsigned int cmd, unsigned long arg) |
1296 | { | 1295 | { |
1297 | drm_file_t *priv = filp->private_data; | 1296 | struct drm_file *priv = filp->private_data; |
1298 | drm_device_t *dev = priv->head->dev; | 1297 | struct drm_device *dev = priv->head->dev; |
1299 | drm_device_dma_t *dma = dev->dma; | 1298 | struct drm_device_dma *dma = dev->dma; |
1300 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; | 1299 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; |
1301 | u32 *hw_status = dev_priv->hw_status_page; | 1300 | u32 *hw_status = dev_priv->hw_status_page; |
1302 | drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) | 1301 | drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) |
@@ -1328,8 +1327,8 @@ static int i830_dma_vertex(struct inode *inode, struct file *filp, | |||
1328 | static int i830_clear_bufs(struct inode *inode, struct file *filp, | 1327 | static int i830_clear_bufs(struct inode *inode, struct file *filp, |
1329 | unsigned int cmd, unsigned long arg) | 1328 | unsigned int cmd, unsigned long arg) |
1330 | { | 1329 | { |
1331 | drm_file_t *priv = filp->private_data; | 1330 | struct drm_file *priv = filp->private_data; |
1332 | drm_device_t *dev = priv->head->dev; | 1331 | struct drm_device *dev = priv->head->dev; |
1333 | drm_i830_clear_t clear; | 1332 | drm_i830_clear_t clear; |
1334 | 1333 | ||
1335 | if (copy_from_user | 1334 | if (copy_from_user |
@@ -1352,8 +1351,8 @@ static int i830_clear_bufs(struct inode *inode, struct file *filp, | |||
1352 | static int i830_swap_bufs(struct inode *inode, struct file *filp, | 1351 | static int i830_swap_bufs(struct inode *inode, struct file *filp, |
1353 | unsigned int cmd, unsigned long arg) | 1352 | unsigned int cmd, unsigned long arg) |
1354 | { | 1353 | { |
1355 | drm_file_t *priv = filp->private_data; | 1354 | struct drm_file *priv = filp->private_data; |
1356 | drm_device_t *dev = priv->head->dev; | 1355 | struct drm_device *dev = priv->head->dev; |
1357 | 1356 | ||
1358 | DRM_DEBUG("i830_swap_bufs\n"); | 1357 | DRM_DEBUG("i830_swap_bufs\n"); |
1359 | 1358 | ||
@@ -1365,7 +1364,7 @@ static int i830_swap_bufs(struct inode *inode, struct file *filp, | |||
1365 | 1364 | ||
1366 | /* Not sure why this isn't set all the time: | 1365 | /* Not sure why this isn't set all the time: |
1367 | */ | 1366 | */ |
1368 | static void i830_do_init_pageflip(drm_device_t * dev) | 1367 | static void i830_do_init_pageflip(struct drm_device * dev) |
1369 | { | 1368 | { |
1370 | drm_i830_private_t *dev_priv = dev->dev_private; | 1369 | drm_i830_private_t *dev_priv = dev->dev_private; |
1371 | 1370 | ||
@@ -1375,7 +1374,7 @@ static void i830_do_init_pageflip(drm_device_t * dev) | |||
1375 | dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; | 1374 | dev_priv->sarea_priv->pf_current_page = dev_priv->current_page; |
1376 | } | 1375 | } |
1377 | 1376 | ||
1378 | static int i830_do_cleanup_pageflip(drm_device_t * dev) | 1377 | static int i830_do_cleanup_pageflip(struct drm_device * dev) |
1379 | { | 1378 | { |
1380 | drm_i830_private_t *dev_priv = dev->dev_private; | 1379 | drm_i830_private_t *dev_priv = dev->dev_private; |
1381 | 1380 | ||
@@ -1390,8 +1389,8 @@ static int i830_do_cleanup_pageflip(drm_device_t * dev) | |||
1390 | static int i830_flip_bufs(struct inode *inode, struct file *filp, | 1389 | static int i830_flip_bufs(struct inode *inode, struct file *filp, |
1391 | unsigned int cmd, unsigned long arg) | 1390 | unsigned int cmd, unsigned long arg) |
1392 | { | 1391 | { |
1393 | drm_file_t *priv = filp->private_data; | 1392 | struct drm_file *priv = filp->private_data; |
1394 | drm_device_t *dev = priv->head->dev; | 1393 | struct drm_device *dev = priv->head->dev; |
1395 | drm_i830_private_t *dev_priv = dev->dev_private; | 1394 | drm_i830_private_t *dev_priv = dev->dev_private; |
1396 | 1395 | ||
1397 | DRM_DEBUG("%s\n", __FUNCTION__); | 1396 | DRM_DEBUG("%s\n", __FUNCTION__); |
@@ -1408,8 +1407,8 @@ static int i830_flip_bufs(struct inode *inode, struct file *filp, | |||
1408 | static int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, | 1407 | static int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, |
1409 | unsigned long arg) | 1408 | unsigned long arg) |
1410 | { | 1409 | { |
1411 | drm_file_t *priv = filp->private_data; | 1410 | struct drm_file *priv = filp->private_data; |
1412 | drm_device_t *dev = priv->head->dev; | 1411 | struct drm_device *dev = priv->head->dev; |
1413 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; | 1412 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; |
1414 | u32 *hw_status = dev_priv->hw_status_page; | 1413 | u32 *hw_status = dev_priv->hw_status_page; |
1415 | drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) | 1414 | drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) |
@@ -1422,8 +1421,8 @@ static int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1422 | static int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, | 1421 | static int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, |
1423 | unsigned long arg) | 1422 | unsigned long arg) |
1424 | { | 1423 | { |
1425 | drm_file_t *priv = filp->private_data; | 1424 | struct drm_file *priv = filp->private_data; |
1426 | drm_device_t *dev = priv->head->dev; | 1425 | struct drm_device *dev = priv->head->dev; |
1427 | int retcode = 0; | 1426 | int retcode = 0; |
1428 | drm_i830_dma_t d; | 1427 | drm_i830_dma_t d; |
1429 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; | 1428 | drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private; |
@@ -1444,7 +1443,7 @@ static int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1444 | DRM_DEBUG("i830_dma: %d returning %d, granted = %d\n", | 1443 | DRM_DEBUG("i830_dma: %d returning %d, granted = %d\n", |
1445 | current->pid, retcode, d.granted); | 1444 | current->pid, retcode, d.granted); |
1446 | 1445 | ||
1447 | if (copy_to_user((drm_dma_t __user *) arg, &d, sizeof(d))) | 1446 | if (copy_to_user((void __user *) arg, &d, sizeof(d))) |
1448 | return -EFAULT; | 1447 | return -EFAULT; |
1449 | sarea_priv->last_dispatch = (int)hw_status[5]; | 1448 | sarea_priv->last_dispatch = (int)hw_status[5]; |
1450 | 1449 | ||
@@ -1467,8 +1466,8 @@ static int i830_docopy(struct inode *inode, struct file *filp, unsigned int cmd, | |||
1467 | static int i830_getparam(struct inode *inode, struct file *filp, | 1466 | static int i830_getparam(struct inode *inode, struct file *filp, |
1468 | unsigned int cmd, unsigned long arg) | 1467 | unsigned int cmd, unsigned long arg) |
1469 | { | 1468 | { |
1470 | drm_file_t *priv = filp->private_data; | 1469 | struct drm_file *priv = filp->private_data; |
1471 | drm_device_t *dev = priv->head->dev; | 1470 | struct drm_device *dev = priv->head->dev; |
1472 | drm_i830_private_t *dev_priv = dev->dev_private; | 1471 | drm_i830_private_t *dev_priv = dev->dev_private; |
1473 | drm_i830_getparam_t param; | 1472 | drm_i830_getparam_t param; |
1474 | int value; | 1473 | int value; |
@@ -1501,8 +1500,8 @@ static int i830_getparam(struct inode *inode, struct file *filp, | |||
1501 | static int i830_setparam(struct inode *inode, struct file *filp, | 1500 | static int i830_setparam(struct inode *inode, struct file *filp, |
1502 | unsigned int cmd, unsigned long arg) | 1501 | unsigned int cmd, unsigned long arg) |
1503 | { | 1502 | { |
1504 | drm_file_t *priv = filp->private_data; | 1503 | struct drm_file *priv = filp->private_data; |
1505 | drm_device_t *dev = priv->head->dev; | 1504 | struct drm_device *dev = priv->head->dev; |
1506 | drm_i830_private_t *dev_priv = dev->dev_private; | 1505 | drm_i830_private_t *dev_priv = dev->dev_private; |
1507 | drm_i830_setparam_t param; | 1506 | drm_i830_setparam_t param; |
1508 | 1507 | ||
@@ -1526,7 +1525,7 @@ static int i830_setparam(struct inode *inode, struct file *filp, | |||
1526 | return 0; | 1525 | return 0; |
1527 | } | 1526 | } |
1528 | 1527 | ||
1529 | int i830_driver_load(drm_device_t *dev, unsigned long flags) | 1528 | int i830_driver_load(struct drm_device *dev, unsigned long flags) |
1530 | { | 1529 | { |
1531 | /* i830 has 4 more counters */ | 1530 | /* i830 has 4 more counters */ |
1532 | dev->counters += 4; | 1531 | dev->counters += 4; |
@@ -1538,12 +1537,12 @@ int i830_driver_load(drm_device_t *dev, unsigned long flags) | |||
1538 | return 0; | 1537 | return 0; |
1539 | } | 1538 | } |
1540 | 1539 | ||
1541 | void i830_driver_lastclose(drm_device_t * dev) | 1540 | void i830_driver_lastclose(struct drm_device * dev) |
1542 | { | 1541 | { |
1543 | i830_dma_cleanup(dev); | 1542 | i830_dma_cleanup(dev); |
1544 | } | 1543 | } |
1545 | 1544 | ||
1546 | void i830_driver_preclose(drm_device_t * dev, DRMFILE filp) | 1545 | void i830_driver_preclose(struct drm_device * dev, DRMFILE filp) |
1547 | { | 1546 | { |
1548 | if (dev->dev_private) { | 1547 | if (dev->dev_private) { |
1549 | drm_i830_private_t *dev_priv = dev->dev_private; | 1548 | drm_i830_private_t *dev_priv = dev->dev_private; |
@@ -1553,12 +1552,12 @@ void i830_driver_preclose(drm_device_t * dev, DRMFILE filp) | |||
1553 | } | 1552 | } |
1554 | } | 1553 | } |
1555 | 1554 | ||
1556 | void i830_driver_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) | 1555 | void i830_driver_reclaim_buffers_locked(struct drm_device * dev, struct file *filp) |
1557 | { | 1556 | { |
1558 | i830_reclaim_buffers(dev, filp); | 1557 | i830_reclaim_buffers(dev, filp); |
1559 | } | 1558 | } |
1560 | 1559 | ||
1561 | int i830_driver_dma_quiescent(drm_device_t * dev) | 1560 | int i830_driver_dma_quiescent(struct drm_device * dev) |
1562 | { | 1561 | { |
1563 | i830_dma_quiescent(dev); | 1562 | i830_dma_quiescent(dev); |
1564 | return 0; | 1563 | return 0; |
@@ -1594,7 +1593,7 @@ int i830_max_ioctl = DRM_ARRAY_SIZE(i830_ioctls); | |||
1594 | * \returns | 1593 | * \returns |
1595 | * A value of 1 is always retured to indictate every i8xx is AGP. | 1594 | * A value of 1 is always retured to indictate every i8xx is AGP. |
1596 | */ | 1595 | */ |
1597 | int i830_driver_device_is_agp(drm_device_t * dev) | 1596 | int i830_driver_device_is_agp(struct drm_device * dev) |
1598 | { | 1597 | { |
1599 | return 1; | 1598 | return 1; |
1600 | } | 1599 | } |