summaryrefslogtreecommitdiff
path: root/linux-core/i810_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/i810_dma.c')
-rw-r--r--linux-core/i810_dma.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 4c90496a..8a5503ea 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -182,7 +182,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL;
if(VM_DONTCOPY != 0) {
- down(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
old_fops = filp->f_op;
filp->f_op = &i810_buffer_fops;
dev_priv->mmap_buffer = buf;
@@ -198,7 +202,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
retcode = (signed int)buf_priv->virtual;
buf_priv->virtual = 0;
}
- up(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
} else {
buf_priv->virtual = buf_priv->kernel_virtual;
buf_priv->currently_mapped = I810_BUF_MAPPED;
@@ -214,7 +222,11 @@ static int i810_unmap_buffer(drm_buf_t *buf)
if(VM_DONTCOPY != 0) {
if(buf_priv->currently_mapped != I810_BUF_MAPPED)
return -EINVAL;
- down(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
#if LINUX_VERSION_CODE < 0x020399
retcode = do_munmap((unsigned long)buf_priv->virtual,
(size_t) buf->total);
@@ -223,7 +235,11 @@ static int i810_unmap_buffer(drm_buf_t *buf)
(unsigned long)buf_priv->virtual,
(size_t) buf->total);
#endif
- up(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE <= 0x020402
+ up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
}
buf_priv->currently_mapped = I810_BUF_UNMAPPED;
buf_priv->virtual = 0;