diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-04-08 02:28:14 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-04-08 02:28:14 +0000 |
commit | 348d40200984234819c240eea6304f306a678871 (patch) | |
tree | 4ef96961eaebc7de663f5ebe12f9b1e33d44a6df /sys/dev/pci/drm/i915/i915_gem.c | |
parent | 47aaddf4650438695425219483a930b11b02a03e (diff) |
ttm has it's own version of kmap/kunmap that uses
kernel_map/uvm_km_valloc and i915 has a version that uses
phys_map/uvm_km_valloc_wait as calling code assumes kmap would
sleep if no memory is available.
Move these and ttm's vmap/vunmap into the linux compat files
and make them all use phys_map/uvm_km_valloc_wait.
looks good kettenis@
Diffstat (limited to 'sys/dev/pci/drm/i915/i915_gem.c')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index 2aa75694069..0dc5341ee7c 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem.c,v 1.88 2015/04/06 12:25:10 jsg Exp $ */ +/* $OpenBSD: i915_gem.c,v 1.89 2015/04/08 02:28:13 jsg Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -290,35 +290,6 @@ static int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) obj->tiling_mode != I915_TILING_NONE; } -static void * -kmap(struct vm_page *pg) -{ - vaddr_t va; - -#if defined (__HAVE_PMAP_DIRECT) - va = pmap_map_direct(pg); -#else - va = uvm_km_valloc_wait(phys_map, PAGE_SIZE); - pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg), PROT_READ | PROT_WRITE); - pmap_update(pmap_kernel()); -#endif - return (void *)va; -} - -static void -kunmap(void *addr) -{ - vaddr_t va = (vaddr_t)addr; - -#if defined (__HAVE_PMAP_DIRECT) - pmap_unmap_direct(va); -#else - pmap_kremove(va, PAGE_SIZE); - pmap_update(pmap_kernel()); - uvm_km_free_wakeup(phys_map, va, PAGE_SIZE); -#endif -} - static inline void drm_clflush_virt_range(void *addr, size_t len) { |