Lines Matching refs:buf
190 static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) in free_buffer() argument
207 if (dev->vbi_mode.bulk_ctl.buf == buf) in free_buffer()
208 dev->vbi_mode.bulk_ctl.buf = NULL; in free_buffer()
211 videobuf_vmalloc_free(&buf->vb); in free_buffer()
212 buf->vb.state = VIDEOBUF_NEEDS_INIT; in free_buffer()
220 struct cx231xx_buffer *buf = in vbi_buffer_prepare() local
228 buf->vb.size = ((dev->width << 1) * height * 2); in vbi_buffer_prepare()
230 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) in vbi_buffer_prepare()
233 buf->vb.width = dev->width; in vbi_buffer_prepare()
234 buf->vb.height = height; in vbi_buffer_prepare()
235 buf->vb.field = field; in vbi_buffer_prepare()
236 buf->vb.field = V4L2_FIELD_SEQ_TB; in vbi_buffer_prepare()
238 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { in vbi_buffer_prepare()
239 rc = videobuf_iolock(vq, &buf->vb, NULL); in vbi_buffer_prepare()
256 buf->vb.state = VIDEOBUF_PREPARED; in vbi_buffer_prepare()
260 free_buffer(vq, buf); in vbi_buffer_prepare()
267 struct cx231xx_buffer *buf = in vbi_buffer_queue() local
273 buf->vb.state = VIDEOBUF_QUEUED; in vbi_buffer_queue()
274 list_add_tail(&buf->vb.queue, &vidq->active); in vbi_buffer_queue()
281 struct cx231xx_buffer *buf = in vbi_buffer_release() local
285 free_buffer(vq, buf); in vbi_buffer_release()
436 dev->vbi_mode.bulk_ctl.buf = NULL; in cx231xx_init_vbi_isoc()
525 struct cx231xx_buffer *buf) in vbi_buffer_filled() argument
530 buf->vb.state = VIDEOBUF_DONE; in vbi_buffer_filled()
531 buf->vb.field_count++; in vbi_buffer_filled()
532 v4l2_get_timestamp(&buf->vb.ts); in vbi_buffer_filled()
534 dev->vbi_mode.bulk_ctl.buf = NULL; in vbi_buffer_filled()
536 list_del(&buf->vb.queue); in vbi_buffer_filled()
537 wake_up(&buf->vb.done); in vbi_buffer_filled()
544 struct cx231xx_buffer *buf; in cx231xx_copy_vbi_line() local
556 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_copy_vbi_line()
576 if (!buf) { in cx231xx_copy_vbi_line()
595 if (cx231xx_is_vbi_buffer_done(dev, dma_q) && buf) { in cx231xx_copy_vbi_line()
597 vbi_buffer_filled(dev, dma_q, buf); in cx231xx_copy_vbi_line()
612 struct cx231xx_buffer **buf) in get_next_vbi_buf() argument
621 dev->vbi_mode.bulk_ctl.buf = NULL; in get_next_vbi_buf()
622 *buf = NULL; in get_next_vbi_buf()
627 *buf = list_entry(dma_q->active.next, struct cx231xx_buffer, vb.queue); in get_next_vbi_buf()
630 outp = videobuf_to_vmalloc(&(*buf)->vb); in get_next_vbi_buf()
631 memset(outp, 0, (*buf)->vb.size); in get_next_vbi_buf()
633 dev->vbi_mode.bulk_ctl.buf = *buf; in get_next_vbi_buf()
641 struct cx231xx_buffer *buf; in cx231xx_reset_vbi_buffer() local
643 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_reset_vbi_buffer()
645 if (buf == NULL) { in cx231xx_reset_vbi_buffer()
647 get_next_vbi_buf(dma_q, &buf); in cx231xx_reset_vbi_buffer()
662 struct cx231xx_buffer *buf; in cx231xx_do_vbi_copy() local
667 buf = dev->vbi_mode.bulk_ctl.buf; in cx231xx_do_vbi_copy()
669 if (buf == NULL) in cx231xx_do_vbi_copy()
672 p_out_buffer = videobuf_to_vmalloc(&buf->vb); in cx231xx_do_vbi_copy()