mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
video: rockchip: mpp: fix issue for fd find dmabuf
Multiple fd may point to the same dmmabuf, which means the same buffer. Therefore, fd cannot be added as a judgment. Change-Id: I459a3350a692299932e58f3e274d2509a5b9a48e Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user