/* buffer for one video frame */
struct mx6s_buffer {
/* common v4l buffer stuff -- must be first */
- struct vb2_buffer vb;
+ struct vb2_v4l2_buffer vb;
struct mx6s_buf_internal internal;
};
static void mx6s_videobuf_queue(struct vb2_buffer *vb)
{
+ struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
struct mx6s_csi_dev *csi_dev = vb2_get_drv_priv(vb->vb2_queue);
- struct mx6s_buffer *buf = container_of(vb, struct mx6s_buffer, vb);
+ struct mx6s_buffer *buf = container_of(vbuf, struct mx6s_buffer, vb);
unsigned long flags;
dev_dbg(csi_dev->dev, "%s (vb=0x%p) 0x%p %lu\n", __func__,
buf = list_first_entry(&csi_dev->capture, struct mx6s_buffer,
internal.queue);
buf->internal.bufnum = 0;
- vb = &buf->vb;
+ vb = &buf->vb.vb2_buf;
vb->state = VB2_BUF_STATE_ACTIVE;
phys = vb2_dma_contig_plane_dma_addr(vb, 0);
buf = list_first_entry(&csi_dev->capture, struct mx6s_buffer,
internal.queue);
buf->internal.bufnum = 1;
- vb = &buf->vb;
+ vb = &buf->vb.vb2_buf;
vb->state = VB2_BUF_STATE_ACTIVE;
phys = vb2_dma_contig_plane_dma_addr(vb, 0);
list_for_each_entry_safe(buf, tmp,
&csi_dev->active_bufs, internal.queue) {
list_del_init(&buf->internal.queue);
- if (buf->vb.state == VB2_BUF_STATE_ACTIVE)
- vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
+ if (buf->vb.vb2_buf.state == VB2_BUF_STATE_ACTIVE)
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
list_for_each_entry_safe(buf, tmp,
&csi_dev->capture, internal.queue) {
list_del_init(&buf->internal.queue);
- if (buf->vb.state == VB2_BUF_STATE_ACTIVE)
- vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
+ if (buf->vb.vb2_buf.state == VB2_BUF_STATE_ACTIVE)
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
INIT_LIST_HEAD(&csi_dev->capture);
} else {
buf = mx6s_ibuf_to_buf(ibuf);
- vb = &buf->vb;
+ vb = &buf->vb.vb2_buf;
phys = vb2_dma_contig_plane_dma_addr(vb, 0);
if (bufnum == 1) {
if (csi_read(csi_dev, CSI_CSIDMASA_FB2) != phys) {
list_move_tail(csi_dev->capture.next, &csi_dev->active_bufs);
- vb = &buf->vb;
+ vb = &buf->vb.vb2_buf;
vb->state = VB2_BUF_STATE_ACTIVE;
phys = vb2_dma_contig_plane_dma_addr(vb, 0);