Lines Matching refs:vaddr

25 	void				*vaddr;  member
48 buf->vaddr = vmalloc_user(buf->size); in vb2_vmalloc_alloc()
54 if (!buf->vaddr) { in vb2_vmalloc_alloc()
69 vfree(buf->vaddr); in vb2_vmalloc_put()
74 static void *vb2_vmalloc_get_userptr(void *alloc_ctx, unsigned long vaddr, in vb2_vmalloc_get_userptr() argument
89 offset = vaddr & ~PAGE_MASK; in vb2_vmalloc_get_userptr()
93 vma = find_vma(current->mm, vaddr); in vb2_vmalloc_get_userptr()
95 if (vb2_get_contig_userptr(vaddr, size, &vma, &physp)) in vb2_vmalloc_get_userptr()
98 buf->vaddr = (__force void *)ioremap_nocache(physp, size); in vb2_vmalloc_get_userptr()
99 if (!buf->vaddr) in vb2_vmalloc_get_userptr()
102 first = vaddr >> PAGE_SHIFT; in vb2_vmalloc_get_userptr()
103 last = (vaddr + size - 1) >> PAGE_SHIFT; in vb2_vmalloc_get_userptr()
112 vaddr & PAGE_MASK, buf->n_pages, in vb2_vmalloc_get_userptr()
119 buf->vaddr = vm_map_ram(buf->pages, buf->n_pages, -1, in vb2_vmalloc_get_userptr()
121 if (!buf->vaddr) in vb2_vmalloc_get_userptr()
125 buf->vaddr += offset; in vb2_vmalloc_get_userptr()
144 unsigned long vaddr = (unsigned long)buf->vaddr & PAGE_MASK; in vb2_vmalloc_put_userptr() local
148 if (vaddr) in vb2_vmalloc_put_userptr()
149 vm_unmap_ram((void *)vaddr, buf->n_pages); in vb2_vmalloc_put_userptr()
158 iounmap((__force void __iomem *)buf->vaddr); in vb2_vmalloc_put_userptr()
167 if (!buf->vaddr) { in vb2_vmalloc_vaddr()
173 return buf->vaddr; in vb2_vmalloc_vaddr()
192 ret = remap_vmalloc_range(vma, buf->vaddr, 0); in vb2_vmalloc_mmap()
232 void *vaddr = buf->vaddr; in vb2_vmalloc_dmabuf_ops_attach() local
247 struct page *page = vmalloc_to_page(vaddr); in vb2_vmalloc_dmabuf_ops_attach()
255 vaddr += PAGE_SIZE; in vb2_vmalloc_dmabuf_ops_attach()
339 return buf->vaddr + pgnum * PAGE_SIZE; in vb2_vmalloc_dmabuf_ops_kmap()
346 return buf->vaddr; in vb2_vmalloc_dmabuf_ops_vmap()
378 if (WARN_ON(!buf->vaddr)) in vb2_vmalloc_get_dmabuf()
401 buf->vaddr = dma_buf_vmap(buf->dbuf); in vb2_vmalloc_map_dmabuf()
403 return buf->vaddr ? 0 : -EFAULT; in vb2_vmalloc_map_dmabuf()
410 dma_buf_vunmap(buf->dbuf, buf->vaddr); in vb2_vmalloc_unmap_dmabuf()
411 buf->vaddr = NULL; in vb2_vmalloc_unmap_dmabuf()
418 if (buf->vaddr) in vb2_vmalloc_detach_dmabuf()
419 dma_buf_vunmap(buf->dbuf, buf->vaddr); in vb2_vmalloc_detach_dmabuf()
456 .vaddr = vb2_vmalloc_vaddr,