diff options
author | Dave Airlie <airlied@linux.ie> | 2005-03-27 06:58:12 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-03-27 06:58:12 +0000 |
commit | 385f927692beb395ae3866538b2b0f8f8e436eba (patch) | |
tree | f3f70015b03d2af85804adb781c637838a38a49e /linux-core | |
parent | 459ef4862978800f3dbff76af134593350cad6aa (diff) |
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
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_vm.c | 11 |
1 files 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 <linux/efi.h> +#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__ |