Lines Matching refs:buf
190 static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) in free_buffer() argument
208 if (dev->vbi_mode.bulk_ctl.buf == buf) in free_buffer()
209 dev->vbi_mode.bulk_ctl.buf = NULL; in free_buffer()
212 videobuf_vmalloc_free(&buf->vb); in free_buffer()
213 buf->vb.state = VIDEOBUF_NEEDS_INIT; in free_buffer()
221 struct cx231xx_buffer *buf = in vbi_buffer_prepare() local
229 buf->vb.size = ((dev->width << 1) * height * 2); in vbi_buffer_prepare()
231 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) in vbi_buffer_prepare()
234 buf->vb.width = dev->width; in vbi_buffer_prepare()
235 buf->vb.height = height; in vbi_buffer_prepare()
236 buf->vb.field = field; in vbi_buffer_prepare()
237 buf->vb.field = V4L2_FIELD_SEQ_TB; in vbi_buffer_prepare()
239 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { in vbi_buffer_prepare()
240 rc = videobuf_iolock(vq, &buf->vb, NULL); in vbi_buffer_prepare()
257 buf->vb.state = VIDEOBUF_PREPARED; in vbi_buffer_prepare()
261 free_buffer(vq, buf); in vbi_buffer_prepare()
268 struct cx231xx_buffer *buf = in vbi_buffer_queue() local
274 buf->vb.state = VIDEOBUF_QUEUED; in vbi_buffer_queue()
275 list_add_tail(&buf->vb.queue, &vidq->active); in vbi_buffer_queue()
282 struct cx231xx_buffer *buf = in vbi_buffer_release() local
286 free_buffer(vq, buf); in vbi_buffer_release()
437 dev->vbi_mode.bulk_ctl.buf = NULL; in cx231xx_init_vbi_isoc()
526 struct cx231xx_buffer *buf) in vbi_buffer_filled() argument
531 buf->vb.state = VIDEOBUF_DONE; in vbi_buffer_filled()
532 buf->vb.field_count++; in vbi_buffer_filled()
533 v4l2_get_timestamp(&buf->vb.ts); in vbi_buffer_filled()
535 dev->vbi_mode.bulk_ctl.buf = NULL; in vbi_buffer_filled()
537 list_del(&buf->vb.queue); in vbi_buffer_filled()
538 wake_up(&buf->vb.done); in vbi_buffer_filled()
545 struct cx231xx_buffer *buf; in cx231xx_copy_vbi_line() local
557 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_copy_vbi_line()
577 if (!buf) { in cx231xx_copy_vbi_line()
596 if (cx231xx_is_vbi_buffer_done(dev, dma_q) && buf) { in cx231xx_copy_vbi_line()
598 vbi_buffer_filled(dev, dma_q, buf); in cx231xx_copy_vbi_line()
613 struct cx231xx_buffer **buf) in get_next_vbi_buf() argument
622 dev->vbi_mode.bulk_ctl.buf = NULL; in get_next_vbi_buf()
623 *buf = NULL; in get_next_vbi_buf()
628 *buf = list_entry(dma_q->active.next, struct cx231xx_buffer, vb.queue); in get_next_vbi_buf()
631 outp = videobuf_to_vmalloc(&(*buf)->vb); in get_next_vbi_buf()
632 memset(outp, 0, (*buf)->vb.size); in get_next_vbi_buf()
634 dev->vbi_mode.bulk_ctl.buf = *buf; in get_next_vbi_buf()
642 struct cx231xx_buffer *buf; in cx231xx_reset_vbi_buffer() local
644 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_reset_vbi_buffer()
646 if (buf == NULL) { in cx231xx_reset_vbi_buffer()
648 get_next_vbi_buf(dma_q, &buf); in cx231xx_reset_vbi_buffer()
663 struct cx231xx_buffer *buf; in cx231xx_do_vbi_copy() local
668 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_do_vbi_copy()
670 if (buf == NULL) in cx231xx_do_vbi_copy()
673 p_out_buffer = videobuf_to_vmalloc(&buf->vb); in cx231xx_do_vbi_copy()