Lines Matching full:mapping

7 #include <linux/dma-mapping.h>
59 struct panfrost_gem_mapping *iter, *mapping = NULL; in panfrost_gem_mapping_get() local
65 mapping = iter; in panfrost_gem_mapping_get()
71 return mapping; in panfrost_gem_mapping_get()
75 panfrost_gem_teardown_mapping(struct panfrost_gem_mapping *mapping) in panfrost_gem_teardown_mapping() argument
77 if (mapping->active) in panfrost_gem_teardown_mapping()
78 panfrost_mmu_unmap(mapping); in panfrost_gem_teardown_mapping()
80 spin_lock(&mapping->mmu->mm_lock); in panfrost_gem_teardown_mapping()
81 if (drm_mm_node_allocated(&mapping->mmnode)) in panfrost_gem_teardown_mapping()
82 drm_mm_remove_node(&mapping->mmnode); in panfrost_gem_teardown_mapping()
83 spin_unlock(&mapping->mmu->mm_lock); in panfrost_gem_teardown_mapping()
88 struct panfrost_gem_mapping *mapping; in panfrost_gem_mapping_release() local
90 mapping = container_of(kref, struct panfrost_gem_mapping, refcount); in panfrost_gem_mapping_release()
92 panfrost_gem_teardown_mapping(mapping); in panfrost_gem_mapping_release()
93 drm_gem_object_put(&mapping->obj->base.base); in panfrost_gem_mapping_release()
94 panfrost_mmu_ctx_put(mapping->mmu); in panfrost_gem_mapping_release()
95 kfree(mapping); in panfrost_gem_mapping_release()
98 void panfrost_gem_mapping_put(struct panfrost_gem_mapping *mapping) in panfrost_gem_mapping_put() argument
100 if (!mapping) in panfrost_gem_mapping_put()
103 kref_put(&mapping->refcount, panfrost_gem_mapping_release); in panfrost_gem_mapping_put()
108 struct panfrost_gem_mapping *mapping; in panfrost_gem_teardown_mappings_locked() local
110 list_for_each_entry(mapping, &bo->mappings.list, node) in panfrost_gem_teardown_mappings_locked()
111 panfrost_gem_teardown_mapping(mapping); in panfrost_gem_teardown_mappings_locked()
122 struct panfrost_gem_mapping *mapping; in panfrost_gem_open() local
124 mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); in panfrost_gem_open()
125 if (!mapping) in panfrost_gem_open()
128 INIT_LIST_HEAD(&mapping->node); in panfrost_gem_open()
129 kref_init(&mapping->refcount); in panfrost_gem_open()
131 mapping->obj = bo; in panfrost_gem_open()
144 mapping->mmu = panfrost_mmu_ctx_get(priv->mmu); in panfrost_gem_open()
145 spin_lock(&mapping->mmu->mm_lock); in panfrost_gem_open()
146 ret = drm_mm_insert_node_generic(&mapping->mmu->mm, &mapping->mmnode, in panfrost_gem_open()
148 spin_unlock(&mapping->mmu->mm_lock); in panfrost_gem_open()
153 ret = panfrost_mmu_map(mapping); in panfrost_gem_open()
160 list_add_tail(&mapping->node, &bo->mappings.list); in panfrost_gem_open()
165 panfrost_gem_mapping_put(mapping); in panfrost_gem_open()
173 struct panfrost_gem_mapping *mapping = NULL, *iter; in panfrost_gem_close() local
178 mapping = iter; in panfrost_gem_close()
185 panfrost_gem_mapping_put(mapping); in panfrost_gem_close()