Some ia64 platforms may not support write combining on all type of memory, so
we need to consult the EFI memory map before we try to set the write combine
attribute of a page. This patch will try to map a page write combined if
it's not an AGP page and the EFI memory map says it's ok, otherwise it falls
back to a regular, uncached mapping. Can someone please apply this to the
drm tree?
Thanks,
Jesse
Index: drm_vm.c
===================================================================
RCS file: /cvs/dri/drm/linux-core/drm_vm.c,v
retrieving revision 1.49
diff -u -p -r1.49 drm_vm.c
--- drm_vm.c 12 Jan 2005 16:07:49 -0000 1.49
+++ drm_vm.c 4 Mar 2005 19:03:31 -0000
@@ -639,9 +639,13 @@ int drm_mmap(struct file *filp, struct v
vma->vm_flags |= VM_IO; /* not in core dump */
}
#if defined(__ia64__)
- if (map->type != _DRM_AGP)
+ if (efi_range_is_wc(vma->vm_start, vma->vm_end -
+ vma->vm_start) && (map->type != _DRM_AGP))
vma->vm_page_prot =
- pgprot_writecombine(vma->vm_page_prot);
+ pgprot_writecombine(vma->vm_page_prot);
+ else
+ vma->vm_page_prot =
+ pgprot_noncached(vma->vm_page_prot);
#endif
offset = dev->driver->get_reg_ofs(dev);
#ifdef __sparc__