Lines Matching refs:mapping
6 #include <linux/dma-mapping.h>
65 /* unroll mapping in case something went wrong */
127 struct etnaviv_vram_mapping *mapping)
129 struct etnaviv_gem_object *etnaviv_obj = mapping->object;
133 etnaviv_iommu_unmap(context, mapping->vram_node.start,
135 drm_mm_remove_node(&mapping->vram_node);
138 void etnaviv_iommu_reap_mapping(struct etnaviv_vram_mapping *mapping)
140 struct etnaviv_iommu_context *context = mapping->context;
143 WARN_ON(mapping->use);
145 etnaviv_iommu_remove_mapping(context, mapping);
146 etnaviv_iommu_context_put(mapping->context);
147 mapping->context = NULL;
148 list_del_init(&mapping->mmu_node);
183 * so we must keep its mapping.
215 * this mapping.
249 * When we can't insert the node, due to a existing mapping blocking
256 * here to make space for the new mapping.
280 struct etnaviv_vram_mapping *mapping, u64 va)
297 mapping->iova = iova;
298 mapping->context = etnaviv_iommu_context_get(context);
299 list_add_tail(&mapping->mmu_node, &context->mappings);
305 node = &mapping->vram_node;
316 mapping->iova = node->start;
325 mapping->context = etnaviv_iommu_context_get(context);
326 list_add_tail(&mapping->mmu_node, &context->mappings);
334 struct etnaviv_vram_mapping *mapping)
336 WARN_ON(mapping->use);
340 /* Bail if the mapping has been reaped by another thread */
341 if (!mapping->context) {
347 if (mapping->vram_node.mm == &context->mm)
348 etnaviv_iommu_remove_mapping(context, mapping);
350 list_del(&mapping->mmu_node);
412 struct etnaviv_vram_mapping *mapping,
418 if (mapping->use > 0) {
419 mapping->use++;
427 * window. Instead we manufacture a mapping to make it look uniform
431 mapping->iova = paddr - memory_base;
433 struct drm_mm_node *node = &mapping->vram_node;
442 mapping->iova = node->start;
454 list_add_tail(&mapping->mmu_node, &context->mappings);
455 mapping->use = 1;
463 struct etnaviv_vram_mapping *mapping)
465 struct drm_mm_node *node = &mapping->vram_node;
468 mapping->use--;
470 if (mapping->use > 0 || context->global->version == ETNAVIV_IOMMU_V1) {