diff options
author | Dave Airlie <airlied@redhat.com> | 2022-05-17 12:19:24 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2022-05-17 12:20:04 +1000 |
commit | f8122500a039abeabfff41b0ad8b6a2c94c1107d (patch) | |
tree | 9e0ea71a7927fc2b9fbd0f8c37c2a11df4b546db /drivers/gpu/drm/etnaviv/etnaviv_gem.c | |
parent | 5756c29bfa816dfde24e0719002d225ab96a0cd6 (diff) | |
parent | 2829a9fcb738f742baad9d15de4c6eac84bcfd08 (diff) | |
download | linux-f8122500a039abeabfff41b0ad8b6a2c94c1107d.tar.gz linux-f8122500a039abeabfff41b0ad8b6a2c94c1107d.tar.bz2 linux-f8122500a039abeabfff41b0ad8b6a2c94c1107d.zip |
Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next
fix address space collisions in some edge cases when userspace is
using softpin and cleans up the MMU reference handling a bit.
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/ffae9f7d03ca7a9e00da16d5910ae810befd3c5a.camel@pengutronix.de
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem.c')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gem.c | 11 |
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); |