mirror of
https://github.com/tbsdtv/media_build.git
synced 2025-07-23 04:13:02 +02:00
79 lines
3.1 KiB
Diff
79 lines
3.1 KiB
Diff
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
index 2f3a5996d3fc..5ac803f6a20c 100644
|
|
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
@@ -344,6 +344,13 @@ vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
|
|
return 0;
|
|
}
|
|
|
|
+static void *vb2_dc_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum)
|
|
+{
|
|
+ struct vb2_dc_buf *buf = dbuf->priv;
|
|
+
|
|
+ return buf->vaddr ? buf->vaddr + pgnum * PAGE_SIZE : NULL;
|
|
+}
|
|
+
|
|
static void *vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf)
|
|
{
|
|
struct vb2_dc_buf *buf = dbuf->priv;
|
|
@@ -364,6 +371,7 @@ static const struct dma_buf_ops vb2_dc_dmabuf_ops = {
|
|
.unmap_dma_buf = vb2_dc_dmabuf_ops_unmap,
|
|
.begin_cpu_access = vb2_dc_dmabuf_ops_begin_cpu_access,
|
|
.end_cpu_access = vb2_dc_dmabuf_ops_end_cpu_access,
|
|
+ .map = vb2_dc_dmabuf_ops_kmap,
|
|
.vmap = vb2_dc_dmabuf_ops_vmap,
|
|
.mmap = vb2_dc_dmabuf_ops_mmap,
|
|
.release = vb2_dc_dmabuf_ops_release,
|
|
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
|
|
index f6db8bfb6573..8e4d02ffea2b 100644
|
|
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
|
|
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
|
|
@@ -481,6 +481,13 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
|
|
return 0;
|
|
}
|
|
|
|
+static void *vb2_dma_sg_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum)
|
|
+{
|
|
+ struct vb2_dma_sg_buf *buf = dbuf->priv;
|
|
+
|
|
+ return buf->vaddr ? buf->vaddr + pgnum * PAGE_SIZE : NULL;
|
|
+}
|
|
+
|
|
static void *vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf)
|
|
{
|
|
struct vb2_dma_sg_buf *buf = dbuf->priv;
|
|
@@ -501,6 +508,7 @@ static const struct dma_buf_ops vb2_dma_sg_dmabuf_ops = {
|
|
.unmap_dma_buf = vb2_dma_sg_dmabuf_ops_unmap,
|
|
.begin_cpu_access = vb2_dma_sg_dmabuf_ops_begin_cpu_access,
|
|
.end_cpu_access = vb2_dma_sg_dmabuf_ops_end_cpu_access,
|
|
+ .map = vb2_dma_sg_dmabuf_ops_kmap,
|
|
.vmap = vb2_dma_sg_dmabuf_ops_vmap,
|
|
.mmap = vb2_dma_sg_dmabuf_ops_mmap,
|
|
.release = vb2_dma_sg_dmabuf_ops_release,
|
|
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
|
|
index 66276a8d50b5..73521976b897 100644
|
|
--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c
|
|
+++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
|
|
@@ -315,6 +315,13 @@ static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf)
|
|
vb2_vmalloc_put(dbuf->priv);
|
|
}
|
|
|
|
+static void *vb2_vmalloc_dmabuf_ops_kmap(struct dma_buf *dbuf, unsigned long pgnum)
|
|
+{
|
|
+ struct vb2_vmalloc_buf *buf = dbuf->priv;
|
|
+
|
|
+ return buf->vaddr + pgnum * PAGE_SIZE;
|
|
+}
|
|
+
|
|
static void *vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf)
|
|
{
|
|
struct vb2_vmalloc_buf *buf = dbuf->priv;
|
|
@@ -333,6 +340,7 @@ static const struct dma_buf_ops vb2_vmalloc_dmabuf_ops = {
|
|
.detach = vb2_vmalloc_dmabuf_ops_detach,
|
|
.map_dma_buf = vb2_vmalloc_dmabuf_ops_map,
|
|
.unmap_dma_buf = vb2_vmalloc_dmabuf_ops_unmap,
|
|
+ .map = vb2_vmalloc_dmabuf_ops_kmap,
|
|
.vmap = vb2_vmalloc_dmabuf_ops_vmap,
|
|
.mmap = vb2_vmalloc_dmabuf_ops_mmap,
|
|
.release = vb2_vmalloc_dmabuf_ops_release,
|