summaryrefslogtreecommitdiff
path: root/linux-core/drm_vm.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2002-10-22 23:38:53 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2002-10-22 23:38:53 +0000
commitb3a20ce219b353aa3e2b7f3b47ffd28b279557c7 (patch)
tree711b5b132bafc64ecb8fad9c1ff7e461781e869e /linux-core/drm_vm.c
parentff4baa69da278b7f616063f37fbd27febf3eb211 (diff)
final part of XFree86 4.2.99.2 merge
Diffstat (limited to 'linux-core/drm_vm.c')
-rw-r--r--linux-core/drm_vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 52dfd594..683c0857 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -71,7 +71,7 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
* Find the right map
*/
- if(!dev->agp->cant_use_aperture) goto vm_nopage_error;
+ if(!dev->agp || !dev->agp->cant_use_aperture) goto vm_nopage_error;
list_for_each(list, &dev->maplist->head) {
r_list = (drm_map_list_t *)list;
@@ -408,7 +408,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
vma->vm_flags &= VM_MAYWRITE;
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
#else
/* Ye gads this is ugly. With more thought
@@ -435,7 +435,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
case _DRM_FRAME_BUFFER:
case _DRM_REGISTERS:
if (VM_OFFSET(vma) >= __pa(high_memory)) {
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;