gpu: ion: Add call back for unmapping user mappings
When mmap is called to remove a mapping, the mmap code takes care of removing all the entries so it isn't necessary to call unmap versions. However, there may be cases where heaps need to do other buffer clean up when a userspace buffer is unmapped. Add an unmap_user function to the ion heap ops. This callback needs to happen in vma_close, so move the decrementing of the overall user map call back as well. Change-Id: I8e5716774dd973828f76e03ec43e8e8ecf8c7936 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
0a06f5ac59
commit
2d5e460bb6
@@ -1026,6 +1026,9 @@ static void ion_vma_close(struct vm_area_struct *vma)
|
||||
mutex_lock(&buffer->lock);
|
||||
buffer->umap_cnt--;
|
||||
mutex_unlock(&buffer->lock);
|
||||
|
||||
if (buffer->heap->ops->unmap_user)
|
||||
buffer->heap->ops->unmap_user(buffer->heap, buffer);
|
||||
}
|
||||
|
||||
static struct vm_operations_struct ion_vm_ops = {
|
||||
|
||||
Reference in New Issue
Block a user