Lines Matching refs:aspace
15 struct msm_gem_address_space *aspace = container_of(kref, in msm_gem_address_space_destroy() local
18 drm_mm_takedown(&aspace->mm); in msm_gem_address_space_destroy()
19 if (aspace->mmu) in msm_gem_address_space_destroy()
20 aspace->mmu->funcs->destroy(aspace->mmu); in msm_gem_address_space_destroy()
21 put_pid(aspace->pid); in msm_gem_address_space_destroy()
22 kfree(aspace); in msm_gem_address_space_destroy()
26 void msm_gem_address_space_put(struct msm_gem_address_space *aspace) in msm_gem_address_space_put() argument
28 if (aspace) in msm_gem_address_space_put()
29 kref_put(&aspace->kref, msm_gem_address_space_destroy); in msm_gem_address_space_put()
33 msm_gem_address_space_get(struct msm_gem_address_space *aspace) in msm_gem_address_space_get() argument
35 if (!IS_ERR_OR_NULL(aspace)) in msm_gem_address_space_get()
36 kref_get(&aspace->kref); in msm_gem_address_space_get()
38 return aspace; in msm_gem_address_space_get()
44 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_purge() local
51 aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size); in msm_gem_vma_purge()
61 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_map() local
72 if (!aspace) in msm_gem_vma_map()
84 ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt, size, prot); in msm_gem_vma_map()
96 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_close() local
100 spin_lock(&aspace->lock); in msm_gem_vma_close()
103 spin_unlock(&aspace->lock); in msm_gem_vma_close()
107 msm_gem_address_space_put(aspace); in msm_gem_vma_close()
110 struct msm_gem_vma *msm_gem_vma_new(struct msm_gem_address_space *aspace) in msm_gem_vma_new() argument
118 vma->aspace = aspace; in msm_gem_vma_new()
127 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_init() local
130 if (GEM_WARN_ON(!aspace)) in msm_gem_vma_init()
136 spin_lock(&aspace->lock); in msm_gem_vma_init()
137 ret = drm_mm_insert_node_in_range(&aspace->mm, &vma->node, in msm_gem_vma_init()
140 spin_unlock(&aspace->lock); in msm_gem_vma_init()
148 kref_get(&aspace->kref); in msm_gem_vma_init()
157 struct msm_gem_address_space *aspace; in msm_gem_address_space_create() local
162 aspace = kzalloc(sizeof(*aspace), GFP_KERNEL); in msm_gem_address_space_create()
163 if (!aspace) in msm_gem_address_space_create()
166 spin_lock_init(&aspace->lock); in msm_gem_address_space_create()
167 aspace->name = name; in msm_gem_address_space_create()
168 aspace->mmu = mmu; in msm_gem_address_space_create()
169 aspace->va_start = va_start; in msm_gem_address_space_create()
170 aspace->va_size = size; in msm_gem_address_space_create()
172 drm_mm_init(&aspace->mm, va_start, size); in msm_gem_address_space_create()
174 kref_init(&aspace->kref); in msm_gem_address_space_create()
176 return aspace; in msm_gem_address_space_create()