mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
video: rockchip: mpp: use dma-buf-cache func
The attachment and sg_table will be store in dma-buf-cache. So use dma-buf-cache api instead of dma-buf api to reduce the actual operation of attach/map. Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: I8b46c8f6a6f69ebe9854858e198d1c312a808a2f
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
*
|
||||
*/
|
||||
#include <linux/delay.h>
|
||||
#ifdef CONFIG_DMABUF_CACHE
|
||||
#include <linux/dma-cache.h>
|
||||
#endif
|
||||
#include <linux/dma-buf.h>
|
||||
#include <linux/dma-iommu.h>
|
||||
#include <linux/iommu.h>
|
||||
@@ -234,8 +237,10 @@ struct mpp_dma_buffer *mpp_dma_import_fd(struct mpp_iommu_info *iommu_info,
|
||||
buffer->dma = dma;
|
||||
|
||||
kref_init(&buffer->ref);
|
||||
/* Increase the reference for used outside the buffer pool */
|
||||
kref_get(&buffer->ref);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_DMABUF_CACHE))
|
||||
/* Increase the reference for used outside the buffer pool */
|
||||
kref_get(&buffer->ref);
|
||||
|
||||
mutex_lock(&dma->list_mutex);
|
||||
dma->buffer_count++;
|
||||
|
||||
Reference in New Issue
Block a user