summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 507172e2780b..cc386f8a7116 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -294,18 +294,15 @@ struct etnaviv_vram_mapping *etnaviv_gem_mapping_get(
list_del(&mapping->obj_node);
}
- mapping->context = etnaviv_iommu_context_get(mmu_context);
mapping->use = 1;
ret = etnaviv_iommu_map_gem(mmu_context, etnaviv_obj,
mmu_context->global->memory_base,
mapping, va);
- if (ret < 0) {
- etnaviv_iommu_context_put(mmu_context);
+ if (ret < 0)
kfree(mapping);
- } else {
+ else
list_add_tail(&mapping->obj_node, &etnaviv_obj->vram_list);
- }
out:
mutex_unlock(&etnaviv_obj->lock);
@@ -500,10 +497,8 @@ void etnaviv_gem_free_object(struct drm_gem_object *obj)
WARN_ON(mapping->use);
- if (context) {
+ if (context)
etnaviv_iommu_unmap_gem(context, mapping);
- etnaviv_iommu_context_put(context);
- }
list_del(&mapping->obj_node);
kfree(mapping);