From 385f927692beb395ae3866538b2b0f8f8e436eba Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 27 Mar 2005 06:58:12 +0000 Subject: 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? From: Jesse Barnes --- linux-core/drm_vm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 47693b03..02520c76 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -34,6 +34,9 @@ */ #include "drmP.h" +#if defined(__ia64__) +#include +#endif /** * \c nopage method for AGP virtual memory. @@ -639,9 +642,13 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) 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)) + vma->vm_page_prot = + pgprot_writecombine(vma->vm_page_prot); + else vma->vm_page_prot = - pgprot_writecombine(vma->vm_page_prot); + pgprot_noncached(vma->vm_page_prot); #endif offset = dev->driver->get_reg_ofs(dev); #ifdef __sparc__ -- cgit v1.2.3