Index: sys/external/bsd/drm2/ttm/ttm_bo_vm.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c,v retrieving revision 1.2 diff -p -u -r1.2 ttm_bo_vm.c --- sys/external/bsd/drm2/ttm/ttm_bo_vm.c 9 Aug 2014 00:18:58 -0000 1.2 +++ sys/external/bsd/drm2/ttm/ttm_bo_vm.c 18 Aug 2014 01:07:50 -0000 @@ -89,6 +89,7 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u unsigned i; vm_prot_t vm_prot; /* VM_PROT_* */ pgprot_t pgprot; /* VM_PROT_* | PMAP_* cacheability flags */ + unsigned mmapflags; int ret; /* Copy-on-write mappings make no sense for the graphics aperture. */ @@ -178,13 +179,19 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u /* XXX PGO_ALLPAGES? */ if (pps[i] == PGO_DONTCARE) continue; - if (bo->mem.bus.is_iomem) - paddr = bus_space_mmap(bdev->memt, u.base, - ((startpage + i) << PAGE_SHIFT), vm_prot, 0); - else + if (bo->mem.bus.is_iomem) { + const paddr_t cookie = bus_space_mmap(bdev->memt, + u.base, ((startpage + i) << PAGE_SHIFT), vm_prot, + 0); + + paddr = pmap_phys_address(cookie); + mmapflags = pmap_mmap_flags(cookie); + } else { paddr = page_to_phys(u.ttm->pages[startpage + i]); + mmapflags = 0; + } ret = -pmap_enter(ufi->orig_map->pmap, vaddr + i*PAGE_SIZE, - paddr, vm_prot, (PMAP_CANFAIL | pgprot)); + paddr, vm_prot, (PMAP_CANFAIL | pgprot | mmapflags)); if (ret) goto out3; }