summaryrefslogtreecommitdiff
path: root/linux/i810_dma.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-08-26 20:02:26 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-08-26 20:02:26 +0000
commitc3d2e90cc79c1b942e184c2dfb708965b38bb344 (patch)
tree846393b13f57e987a9085302901e7568e731a1a4 /linux/i810_dma.c
parentc9d387a04851a543dcb0e683dd17006752a07fc3 (diff)
merged trunk into branchr200-0-1-20020822r200-0-1-branch
Diffstat (limited to 'linux/i810_dma.c')
-rw-r--r--linux/i810_dma.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index a2899b5f..f4eef3a3 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -37,6 +37,7 @@
#include "i810_drm.h"
#include "i810_drv.h"
#include <linux/interrupt.h> /* For task queue support */
+#include <linux/delay.h>
#define I810_BUF_FREE 2
#define I810_BUF_CLIENT 1
@@ -129,14 +130,14 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
}
static struct file_operations i810_buffer_fops = {
- open: DRM(open),
- flush: DRM(flush),
- release: DRM(release),
- ioctl: DRM(ioctl),
- mmap: i810_mmap_buffers,
- read: DRM(read),
- fasync: DRM(fasync),
- poll: DRM(poll),
+ .open = DRM(open),
+ .flush = DRM(flush),
+ .release = DRM(release),
+ .ioctl = DRM(ioctl),
+ .mmap = i810_mmap_buffers,
+ .read = DRM(read),
+ .fasync = DRM(fasync),
+ .poll = DRM(poll),
};
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
@@ -270,20 +271,24 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
static void i810_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
@@ -337,8 +342,6 @@ static int i810_wait_ring(drm_device_t *dev, int n)
end = jiffies + (HZ*3);
while (ring->space < n) {
- int i;
-
ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
ring->space = ring->head - (ring->tail+8);
if (ring->space < 0) ring->space += ring->Size;