Lines Matching full:vb
82 struct videobuf_buffer vb; member
296 buf = list_entry(vidq->active.next, struct viu_buf, vb.queue); in restart_video_queue()
298 buf, buf->vb.i); in restart_video_queue()
303 list_for_each_entry_safe(buf, prev, &vidq->active, vb.queue) { in restart_video_queue()
304 list_del(&buf->vb.queue); in restart_video_queue()
305 buf->vb.state = VIDEOBUF_ERROR; in restart_video_queue()
306 wake_up(&buf->vb.done); in restart_video_queue()
316 buf = list_entry(vidq->queued.next, struct viu_buf, vb.queue); in restart_video_queue()
318 list_move_tail(&buf->vb.queue, &vidq->active); in restart_video_queue()
324 buf->vb.state = VIDEOBUF_ACTIVE; in restart_video_queue()
327 buf, buf->vb.i); in restart_video_queue()
329 } else if (prev->vb.width == buf->vb.width && in restart_video_queue()
330 prev->vb.height == buf->vb.height && in restart_video_queue()
332 list_move_tail(&buf->vb.queue, &vidq->active); in restart_video_queue()
333 buf->vb.state = VIDEOBUF_ACTIVE; in restart_video_queue()
335 buf, buf->vb.i); in restart_video_queue()
350 buf = list_entry(vidq->active.next, struct viu_buf, vb.queue); in viu_vid_timeout()
351 list_del(&buf->vb.queue); in viu_vid_timeout()
352 buf->vb.state = VIDEOBUF_ERROR; in viu_vid_timeout()
353 wake_up(&buf->vb.done); in viu_vid_timeout()
354 dprintk(1, "viu/0: [%p/%d] timeout\n", buf, buf->vb.i); in viu_vid_timeout()
381 struct videobuf_buffer *vb = &buf->vb; in free_buffer() local
386 videobuf_waiton(vq, &buf->vb, 0, 0); in free_buffer()
389 vaddr = vq->int_ops->vaddr(vb); in free_buffer()
392 videobuf_dma_contig_free(vq, &buf->vb); in free_buffer()
394 buf->vb.state = VIDEOBUF_NEEDS_INIT; in free_buffer()
403 reg_val.field_base_addr = videobuf_to_dma_contig(&buf->vb); in buffer_activate()
406 buf, buf->vb.i, (unsigned long)reg_val.field_base_addr); in buffer_activate()
414 reg_val.dma_inc = buf->vb.width * 2; in buffer_activate()
418 reg_val.dma_inc = buf->vb.width * 4; in buffer_activate()
427 reg_val.picture_count = (buf->vb.height / 2) << 16 | in buffer_activate()
428 buf->vb.width; in buffer_activate()
432 buf->vb.state = VIDEOBUF_ACTIVE; in buffer_activate()
433 dev->capfield = buf->vb.field; in buffer_activate()
436 if (!V4L2_FIELD_HAS_BOTH(buf->vb.field)) in buffer_activate()
447 struct videobuf_buffer *vb, in buffer_prepare() argument
451 struct viu_buf *buf = container_of(vb, struct viu_buf, vb); in buffer_prepare()
459 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3; in buffer_prepare()
460 if (buf->vb.baddr != 0 && buf->vb.bsize < buf->vb.size) in buffer_prepare()
464 buf->vb.width != fh->width || in buffer_prepare()
465 buf->vb.height != fh->height || in buffer_prepare()
466 buf->vb.field != field) { in buffer_prepare()
468 buf->vb.width = fh->width; in buffer_prepare()
469 buf->vb.height = fh->height; in buffer_prepare()
470 buf->vb.field = field; in buffer_prepare()
473 if (buf->vb.state == VIDEOBUF_NEEDS_INIT) { in buffer_prepare()
474 rc = videobuf_iolock(vq, &buf->vb, NULL); in buffer_prepare()
478 buf->vb.width = fh->width; in buffer_prepare()
479 buf->vb.height = fh->height; in buffer_prepare()
480 buf->vb.field = field; in buffer_prepare()
484 buf->vb.state = VIDEOBUF_PREPARED; in buffer_prepare()
492 static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) in buffer_queue() argument
494 struct viu_buf *buf = container_of(vb, struct viu_buf, vb); in buffer_queue()
501 dprintk(1, "adding vb queue=%p\n", &buf->vb.queue); in buffer_queue()
507 list_add_tail(&buf->vb.queue, &vidq->queued); in buffer_queue()
508 buf->vb.state = VIDEOBUF_QUEUED; in buffer_queue()
510 buf, buf->vb.i); in buffer_queue()
512 dprintk(1, "adding vb active=%p\n", &buf->vb.queue); in buffer_queue()
513 list_add_tail(&buf->vb.queue, &vidq->active); in buffer_queue()
514 buf->vb.state = VIDEOBUF_ACTIVE; in buffer_queue()
517 buf, buf->vb.i); in buffer_queue()
521 dprintk(1, "adding vb queue2=%p\n", &buf->vb.queue); in buffer_queue()
522 prev = list_entry(vidq->active.prev, struct viu_buf, vb.queue); in buffer_queue()
523 if (prev->vb.width == buf->vb.width && in buffer_queue()
524 prev->vb.height == buf->vb.height && in buffer_queue()
526 list_add_tail(&buf->vb.queue, &vidq->active); in buffer_queue()
527 buf->vb.state = VIDEOBUF_ACTIVE; in buffer_queue()
529 buf, buf->vb.i); in buffer_queue()
531 list_add_tail(&buf->vb.queue, &vidq->queued); in buffer_queue()
532 buf->vb.state = VIDEOBUF_QUEUED; in buffer_queue()
534 buf, buf->vb.i); in buffer_queue()
540 struct videobuf_buffer *vb) in buffer_release() argument
542 struct viu_buf *buf = container_of(vb, struct viu_buf, vb); in buffer_release()
964 vb.queue); in viu_activate_next_buf()
969 vb.queue); in viu_activate_next_buf()
970 list_del(&buf->vb.queue); in viu_activate_next_buf()
973 list_add_tail(&buf->vb.queue, &vidq->active); in viu_activate_next_buf()
974 buf->vb.state = VIDEOBUF_ACTIVE; in viu_activate_next_buf()
1075 struct viu_buf, vb.queue); in viu_capture_intr()
1077 buf, buf->vb.i, in viu_capture_intr()
1078 (unsigned long)videobuf_to_dma_contig(&buf->vb), in viu_capture_intr()
1081 if (waitqueue_active(&buf->vb.done)) { in viu_capture_intr()
1082 list_del(&buf->vb.queue); in viu_capture_intr()
1083 buf->vb.ts = ktime_get_ns(); in viu_capture_intr()
1084 buf->vb.state = VIDEOBUF_DONE; in viu_capture_intr()
1085 buf->vb.field_count++; in viu_capture_intr()
1086 wake_up(&buf->vb.done); in viu_capture_intr()