Add backports/v5.17_iosys.patch

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Hans Verkuil
2022-04-05 08:06:50 +02:00
parent 341f661f42
commit 28a79b3705
2 changed files with 124 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ add rc-cec.patch
[5.17.1023]
add v5.17_spi.patch
add v5.17_iosys.patch
[5.15.1023]
add v5.15_container_of.patch

123
backports/v5.17_iosys.patch Normal file
View File

@@ -0,0 +1,123 @@
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
index 678b359717c4..0e3f264122af 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
@@ -99,7 +99,7 @@ static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)
return buf->vaddr;
if (buf->db_attach) {
- struct iosys_map map;
+ struct dma_buf_map map;
if (!dma_buf_vmap(buf->db_attach->dmabuf, &map))
buf->vaddr = map.vaddr;
@@ -446,7 +446,7 @@ vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
return 0;
}
-static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct iosys_map *map)
+static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
{
struct vb2_dc_buf *buf;
void *vaddr;
@@ -456,7 +456,7 @@ static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct iosys_map *map)
if (!vaddr)
return -EINVAL;
- iosys_map_set_vaddr(map, vaddr);
+ dma_buf_map_set_vaddr(map, vaddr);
return 0;
}
@@ -737,7 +737,7 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv)
{
struct vb2_dc_buf *buf = mem_priv;
struct sg_table *sgt = buf->dma_sgt;
- struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
+ struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
if (WARN_ON(!buf->db_attach)) {
pr_err("trying to unpin a not attached buffer\n");
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
index f8a21c560ad2..90acafd9a290 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
@@ -303,7 +303,7 @@ static void vb2_dma_sg_put_userptr(void *buf_priv)
static void *vb2_dma_sg_vaddr(struct vb2_buffer *vb, void *buf_priv)
{
struct vb2_dma_sg_buf *buf = buf_priv;
- struct iosys_map map;
+ struct dma_buf_map map;
int ret;
BUG_ON(!buf);
@@ -492,12 +492,11 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
return 0;
}
-static int vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf,
- struct iosys_map *map)
+static int vb2_dma_sg_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
{
struct vb2_dma_sg_buf *buf = dbuf->priv;
- iosys_map_set_vaddr(map, buf->vaddr);
+ dma_buf_map_set_vaddr(map, buf->vaddr);
return 0;
}
@@ -582,7 +581,7 @@ static void vb2_dma_sg_unmap_dmabuf(void *mem_priv)
{
struct vb2_dma_sg_buf *buf = mem_priv;
struct sg_table *sgt = buf->dma_sgt;
- struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
+ struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
if (WARN_ON(!buf->db_attach)) {
pr_err("trying to unpin a not attached buffer\n");
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
index 948152f1596b..0bbfea66554f 100644
--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c
+++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
@@ -312,12 +312,11 @@ static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf)
vb2_vmalloc_put(dbuf->priv);
}
-static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf,
- struct iosys_map *map)
+static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct dma_buf_map *map)
{
struct vb2_vmalloc_buf *buf = dbuf->priv;
- iosys_map_set_vaddr(map, buf->vaddr);
+ dma_buf_map_set_vaddr(map, buf->vaddr);
return 0;
}
@@ -373,7 +372,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(struct vb2_buffer *vb,
static int vb2_vmalloc_map_dmabuf(void *mem_priv)
{
struct vb2_vmalloc_buf *buf = mem_priv;
- struct iosys_map map;
+ struct dma_buf_map map;
int ret;
ret = dma_buf_vmap(buf->dbuf, &map);
@@ -387,7 +386,7 @@ static int vb2_vmalloc_map_dmabuf(void *mem_priv)
static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)
{
struct vb2_vmalloc_buf *buf = mem_priv;
- struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
+ struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
dma_buf_vunmap(buf->dbuf, &map);
buf->vaddr = NULL;
@@ -396,7 +395,7 @@ static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)
static void vb2_vmalloc_detach_dmabuf(void *mem_priv)
{
struct vb2_vmalloc_buf *buf = mem_priv;
- struct iosys_map map = IOSYS_MAP_INIT_VADDR(buf->vaddr);
+ struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(buf->vaddr);
if (buf->vaddr)
dma_buf_vunmap(buf->dbuf, &map);