diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2010-12-16 01:09:59 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2010-12-16 01:09:59 +0000 |
commit | 7fa20791fd9a167a5cb2524535781a58ff18026e (patch) | |
tree | a9f3c1a24b8905c09669b6dc319e9cb72d0c8689 /sys/dev/pci/drm | |
parent | d05d7f2e1d560b7a36f2cba90fb5ebf44777cc90 (diff) |
no need to poke the vmspace, uvm_map_hint does what we want. ok oga
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drm_bufs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c index a4890cdd696..56f498f7e1c 100644 --- a/sys/dev/pci/drm/drm_bufs.c +++ b/sys/dev/pci/drm/drm_bufs.c @@ -922,7 +922,6 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_device_dma *dma = dev->dma; struct drm_buf_map *request = data; - struct vmspace *vms; struct vnode *vn; vaddr_t address, vaddr; voff_t foff; @@ -933,8 +932,6 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) if (!vfinddev(file_priv->kdev, VCHR, &vn)) return EINVAL; - vms = curproc->p_vmspace; - rw_enter_write(&dma->dma_lock); dev->dma->buf_use++; /* Can't allocate more after this call */ rw_exit_write(&dma->dma_lock); @@ -960,8 +957,8 @@ drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) foff = 0; } - vaddr = round_page((vaddr_t)vms->vm_daddr + BRKSIZ); - retcode = uvm_mmap(&vms->vm_map, &vaddr, size, + vaddr = uvm_map_hint(curproc, VM_PROT_READ | VM_PROT_WRITE); + retcode = uvm_mmap(&curproc->p_vmspace->vm_map, &vaddr, size, UVM_PROT_READ | UVM_PROT_WRITE, UVM_PROT_ALL, MAP_SHARED, (caddr_t)vn, foff, curproc->p_rlimit[RLIMIT_MEMLOCK].rlim_cur, curproc); |