Lines Matching refs:vma
42 struct msm_gem_vma *vma) in msm_gem_purge_vma() argument
44 unsigned size = vma->node.size << PAGE_SHIFT; in msm_gem_purge_vma()
47 if (WARN_ON(vma->inuse > 0)) in msm_gem_purge_vma()
51 if (!vma->mapped) in msm_gem_purge_vma()
55 aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size); in msm_gem_purge_vma()
57 vma->mapped = false; in msm_gem_purge_vma()
62 struct msm_gem_vma *vma) in msm_gem_unmap_vma() argument
64 if (!WARN_ON(!vma->iova)) in msm_gem_unmap_vma()
65 vma->inuse--; in msm_gem_unmap_vma()
70 struct msm_gem_vma *vma, int prot, in msm_gem_map_vma() argument
76 if (WARN_ON(!vma->iova)) in msm_gem_map_vma()
80 vma->inuse++; in msm_gem_map_vma()
82 if (vma->mapped) in msm_gem_map_vma()
85 vma->mapped = true; in msm_gem_map_vma()
88 ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt, in msm_gem_map_vma()
92 vma->mapped = false; in msm_gem_map_vma()
93 vma->inuse--; in msm_gem_map_vma()
101 struct msm_gem_vma *vma) in msm_gem_close_vma() argument
103 if (WARN_ON(vma->inuse > 0 || vma->mapped)) in msm_gem_close_vma()
107 if (vma->iova) in msm_gem_close_vma()
108 drm_mm_remove_node(&vma->node); in msm_gem_close_vma()
111 vma->iova = 0; in msm_gem_close_vma()
118 struct msm_gem_vma *vma, int npages, in msm_gem_init_vma() argument
123 if (WARN_ON(vma->iova)) in msm_gem_init_vma()
127 ret = drm_mm_insert_node_in_range(&aspace->mm, &vma->node, npages, 0, in msm_gem_init_vma()
134 vma->iova = vma->node.start << PAGE_SHIFT; in msm_gem_init_vma()
135 vma->mapped = false; in msm_gem_init_vma()