Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/ttm bus_space_mmap cookies are not pad...
details: https://anonhg.NetBSD.org/src/rev/71ff18f6d952
branches: trunk
changeset: 331639:71ff18f6d952
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 18 01:17:34 2014 +0000
description:
bus_space_mmap cookies are not paddrs, so don't pmap_enter them!
diffstat:
sys/external/bsd/drm2/ttm/ttm_bo_vm.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diffs (51 lines):
diff -r 902c6b4e16ad -r 71ff18f6d952 sys/external/bsd/drm2/ttm/ttm_bo_vm.c
--- a/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Sun Aug 17 23:03:58 2014 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Mon Aug 18 01:17:34 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttm_bo_vm.c,v 1.2 2014/08/09 00:18:58 riastradh Exp $ */
+/* $NetBSD: ttm_bo_vm.c,v 1.3 2014/08/18 01:17:34 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.2 2014/08/09 00:18:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.3 2014/08/18 01:17:34 riastradh Exp $");
#include <sys/types.h>
@@ -89,6 +89,7 @@
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 @@
/* 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;
}
Home |
Main Index |
Thread Index |
Old Index