diff --git a/drivers/video/rockchip/mpp/mpp_iommu.c b/drivers/video/rockchip/mpp/mpp_iommu.c index 9fd8196123ac..e279f4f43489 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.c +++ b/drivers/video/rockchip/mpp/mpp_iommu.c @@ -9,6 +9,9 @@ * */ #include +#ifdef CONFIG_DMABUF_CACHE +#include +#endif #include #include #include @@ -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++;