diff --git a/drivers/video/rockchip/mpp/mpp_iommu.c b/drivers/video/rockchip/mpp/mpp_iommu.c index 3df57083de75..833079ff8f90 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.c +++ b/drivers/video/rockchip/mpp/mpp_iommu.c @@ -38,11 +38,10 @@ mpp_dma_find_buffer_fd(struct mpp_dma_session *dma, int fd) list_for_each_entry_safe(buffer, n, &dma->buffer_list, link) { /* - * As long as the last reference is hold by the buffer pool, - * the same fd won't be assigned to the other application. + * fd may dup several and point the same dambuf. + * thus, here should be distinguish with the dmabuf. */ - if (buffer->fd == fd && - buffer->dmabuf == dmabuf) { + if (buffer->dmabuf == dmabuf) { out = buffer; break; } @@ -205,7 +204,6 @@ struct mpp_dma_buffer *mpp_dma_import_fd(struct mpp_iommu_info *iommu_info, } buffer->dmabuf = dmabuf; - buffer->fd = fd; buffer->dir = DMA_BIDIRECTIONAL; buffer->last_used = ktime_get(); diff --git a/drivers/video/rockchip/mpp/mpp_iommu.h b/drivers/video/rockchip/mpp/mpp_iommu.h index a8ba6b9f5f1d..767ada326897 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.h +++ b/drivers/video/rockchip/mpp/mpp_iommu.h @@ -27,7 +27,6 @@ struct mpp_dma_buffer { struct sg_table *copy_sgt; enum dma_data_direction dir; - int fd; dma_addr_t iova; unsigned long size; void *vaddr;