Commit 257d06f7 authored by Rob Clark's avatar Rob Clark

drm/msm: small mmap offset cleanups

Use pre-computed iova when unmapping, to reduce the places we assume iova
and mmap offset are (at the moment) the same.  And get rid of an extra
drm_gem_free_mmap_offset() call (since it is already called from
drm_gem_object_release())
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent e27c54ff
...@@ -519,13 +519,11 @@ void msm_gem_free_object(struct drm_gem_object *obj) ...@@ -519,13 +519,11 @@ void msm_gem_free_object(struct drm_gem_object *obj)
for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) { for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) {
struct msm_mmu *mmu = priv->mmus[id]; struct msm_mmu *mmu = priv->mmus[id];
if (mmu && msm_obj->domain[id].iova) { if (mmu && msm_obj->domain[id].iova) {
uint32_t offset = (uint32_t)mmap_offset(obj); uint32_t offset = msm_obj->domain[id].iova;
mmu->funcs->unmap(mmu, offset, msm_obj->sgt, obj->size); mmu->funcs->unmap(mmu, offset, msm_obj->sgt, obj->size);
} }
} }
drm_gem_free_mmap_offset(obj);
if (obj->import_attach) { if (obj->import_attach) {
if (msm_obj->vaddr) if (msm_obj->vaddr)
dma_buf_vunmap(obj->import_attach->dmabuf, msm_obj->vaddr); dma_buf_vunmap(obj->import_attach->dmabuf, msm_obj->vaddr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment