diff options
author | Hyesoo Yu <hyesoo.yu@samsung.com> | 2020-06-10 17:51:05 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2020-07-08 06:28:28 +0000 |
commit | b8018578d1c39cdb4724849f5ecb86a18af7612e (patch) | |
tree | 4d25bc5623e6cbc314e1fe94466919e480ce8a40 | |
parent | 1099a8c450f5cb47a9658624305a762e7d928bfb (diff) | |
download | goldfish-android-5.4.tar.gz |
ANDROID: ion: remove kmap from begin[end]_cpu_accessandroid-5.4
The begin[end]_cpu_access handles cache coherency.
However the kmap is always called here and it just
makes unnecessary overhead of kmap.
We don't need to call kmap on begin[end]_cpu_access
because ION no longer supports dma_buf_kmap callback
on ion dma, so remove it.
Bug: 158635261
Signed-off-by: Hyesoo YU <hyesoo.yu@samsung.com>
Change-Id: I8a9a1715da2c0d7df59a3abe8790614b07f55fe6
-rw-r--r-- | drivers/staging/android/ion/ion_dma_buf.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/staging/android/ion/ion_dma_buf.c b/drivers/staging/android/ion/ion_dma_buf.c index 19477162527d..97cfaacf229f 100644 --- a/drivers/staging/android/ion/ion_dma_buf.c +++ b/drivers/staging/android/ion/ion_dma_buf.c @@ -165,23 +165,11 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, struct ion_heap *heap = buffer->heap; void *vaddr; struct ion_dma_buf_attachment *a; - int ret; if (heap->buf_ops.begin_cpu_access) return heap->buf_ops.begin_cpu_access(dmabuf, direction); - /* - * TODO: Move this elsewhere because we don't always need a vaddr - * FIXME: Why do we need a vaddr here? - */ - ret = 0; mutex_lock(&buffer->lock); - vaddr = ion_buffer_kmap_get(buffer); - if (IS_ERR(vaddr)) { - ret = PTR_ERR(vaddr); - goto unlock; - } - if (!(buffer->flags & ION_FLAG_CACHED)) goto unlock; @@ -194,7 +182,7 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, unlock: mutex_unlock(&buffer->lock); - return ret; + return 0; } static int @@ -227,9 +215,6 @@ static int ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf, return heap->buf_ops.end_cpu_access(dmabuf, direction); mutex_lock(&buffer->lock); - - ion_buffer_kmap_put(buffer); - if (!(buffer->flags & ION_FLAG_CACHED)) goto unlock; |