media: rkisp1: enable userptr io mode

Enable VB2_USERPTR mode. vb2_dma_contig takes care
the rest of details except the vb2_plane_vaddr().

Change-Id: Id23e0c9ef7b3332fcb3be57c71c4178e181d7141
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Shunqian Zheng
2019-04-02 18:11:11 +08:00
committed by Tao Huang
parent aaaa072ed1
commit 72ea36e892

View File

@@ -1341,8 +1341,10 @@ static void rkisp1_buf_queue(struct vb2_buffer *vb)
u32 sizeimage = pixm->plane_fmt[0].sizeimage;
u32 *buf = vb2_plane_vaddr(vb, 0);
*buf = RKISP1_DMATX_CHECK;
*(buf + sizeimage / 4 - 1) = RKISP1_DMATX_CHECK;
if (buf) {
*buf = RKISP1_DMATX_CHECK;
*(buf + sizeimage / 4 - 1) = RKISP1_DMATX_CHECK;
}
}
}
@@ -1595,7 +1597,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
node = queue_to_node(q);
q->type = buf_type;
q->io_modes = VB2_MMAP | VB2_DMABUF;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
q->drv_priv = stream;
q->ops = &rkisp1_vb2_ops;
q->mem_ops = &vb2_dma_contig_memops;
@@ -2226,6 +2228,8 @@ void rkisp1_mipi_dmatx0_end(u32 status, struct rkisp1_device *dev)
u32 sizeimage = stream->out_fmt.plane_fmt[0].sizeimage;
buf = (u32 *)vb2_plane_vaddr(&stream->curr_buf->vb.vb2_buf, 0);
if (!buf)
goto out;
end = *(buf + sizeimage / 4 - 1);
while (end == RKISP1_DMATX_CHECK) {
udelay(1);
@@ -2245,6 +2249,7 @@ void rkisp1_mipi_dmatx0_end(u32 status, struct rkisp1_device *dev)
}
}
}
out:
mi_frame_end(stream);
}
}