summaryrefslogtreecommitdiff
path: root/linux/drm_vm.h
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-12-10 23:29:37 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-12-10 23:29:37 +0000
commitf18a6d836b5e0081dff9217b44e88e74c421c576 (patch)
tree6f104249c42e776ff94465464394c7c0f5f771cf /linux/drm_vm.h
parent727abee235478a66c90a8cd097f85307e232524a (diff)
Diffstat (limited to 'linux/drm_vm.h')
-rw-r--r--linux/drm_vm.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/linux/drm_vm.h b/linux/drm_vm.h
index 30b5b226..6803a57b 100644
--- a/linux/drm_vm.h
+++ b/linux/drm_vm.h
@@ -353,7 +353,12 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
unlock_kernel();
vma->vm_ops = &DRM(vm_dma_ops);
+
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
@@ -479,17 +484,29 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
vma->vm_private_data = (void *)map;
- vma->vm_flags |= VM_LOCKED;
+#if LINUX_VERSION_CODE <= 0x020414
+ vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
default:
return -EINVAL; /* This should never happen. */
}
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);