2 * generic helper functions for handling video4linux capture buffers
4 * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org>
6 * Highly based on video-buf written originally by:
7 * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
8 * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org>
9 * (c) 2006 Ted Walther and John Sokol
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2
16 #include <linux/init.h>
17 #include <linux/module.h>
18 #include <linux/moduleparam.h>
19 #include <linux/slab.h>
20 #include <linux/interrupt.h>
22 #include <media/videobuf-core.h>
24 #define MAGIC_BUFFER 0x20070728
25 #define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \
26 { printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); }
29 module_param(debug, int, 0644);
31 MODULE_DESCRIPTION("helper module to manage video4linux buffers");
32 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
33 MODULE_LICENSE("GPL");
35 #define dprintk(level, fmt, arg...) if (debug >= level) \
36 printk(KERN_DEBUG "vbuf: " fmt , ## arg)
38 /* --------------------------------------------------------------------- */
40 #define CALL(q, f, arg...) \
41 ( (q->int_ops->f)? q->int_ops->f(arg) : 0)
43 void* videobuf_alloc(struct videobuf_queue* q)
45 struct videobuf_buffer *vb;
47 BUG_ON (q->msize<sizeof(*vb));
49 if (!q->int_ops || !q->int_ops->alloc) {
50 printk(KERN_ERR "No specific ops defined!\n");
54 vb = q->int_ops->alloc(q->msize);
57 init_waitqueue_head(&vb->done);
58 vb->magic = MAGIC_BUFFER;
64 int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
67 DECLARE_WAITQUEUE(wait, current);
69 MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
70 add_wait_queue(&vb->done, &wait);
71 while (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) {
76 set_current_state(intr ? TASK_INTERRUPTIBLE
77 : TASK_UNINTERRUPTIBLE);
78 if (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED)
80 set_current_state(TASK_RUNNING);
81 if (intr && signal_pending(current)) {
82 dprintk(1,"buffer waiton: -EINTR\n");
87 remove_wait_queue(&vb->done, &wait);
91 int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
92 struct v4l2_framebuffer *fbuf)
94 MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
95 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
97 /* FIXME: This is required to avoid OOPS on some cases, since mmap_mapper()
98 method should be called before _iolock.
99 On some cases, the mmap_mapper() is called only after scheduling.
101 However, this way is just too dirty! Better to wait for some event.
103 schedule_timeout(HZ);
105 return CALL(q,iolock,q,vb,fbuf);
108 /* --------------------------------------------------------------------- */
111 void videobuf_queue_core_init(struct videobuf_queue* q,
112 struct videobuf_queue_ops *ops,
115 enum v4l2_buf_type type,
116 enum v4l2_field field,
119 struct videobuf_qtype_ops *int_ops)
121 memset(q,0,sizeof(*q));
122 q->irqlock = irqlock;
129 q->int_ops = int_ops;
131 /* All buffer operations are mandatory */
132 BUG_ON (!q->ops->buf_setup);
133 BUG_ON (!q->ops->buf_prepare);
134 BUG_ON (!q->ops->buf_queue);
135 BUG_ON (!q->ops->buf_release);
137 /* Having implementations for abstract methods are mandatory */
138 BUG_ON (!q->int_ops);
140 mutex_init(&q->lock);
141 INIT_LIST_HEAD(&q->stream);
144 /* Locking: Only usage in bttv unsafe find way to remove */
145 int videobuf_queue_is_busy(struct videobuf_queue *q)
149 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
152 dprintk(1,"busy: streaming active\n");
156 dprintk(1,"busy: pending read #1\n");
160 dprintk(1,"busy: pending read #2\n");
163 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
164 if (NULL == q->bufs[i])
166 if (q->bufs[i]->map) {
167 dprintk(1,"busy: buffer #%d mapped\n",i);
170 if (q->bufs[i]->state == STATE_QUEUED) {
171 dprintk(1,"busy: buffer #%d queued\n",i);
174 if (q->bufs[i]->state == STATE_ACTIVE) {
175 dprintk(1,"busy: buffer #%d avtive\n",i);
182 /* Locking: Caller holds q->lock */
183 void videobuf_queue_cancel(struct videobuf_queue *q)
185 unsigned long flags=0;
188 /* remove queued buffers from list */
190 spin_lock_irqsave(q->irqlock,flags);
191 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
192 if (NULL == q->bufs[i])
194 if (q->bufs[i]->state == STATE_QUEUED) {
195 list_del(&q->bufs[i]->queue);
196 q->bufs[i]->state = STATE_ERROR;
200 spin_unlock_irqrestore(q->irqlock,flags);
202 /* free all buffers + clear queue */
203 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
204 if (NULL == q->bufs[i])
206 q->ops->buf_release(q,q->bufs[i]);
208 INIT_LIST_HEAD(&q->stream);
211 /* --------------------------------------------------------------------- */
213 /* Locking: Caller holds q->lock */
214 enum v4l2_field videobuf_next_field(struct videobuf_queue *q)
216 enum v4l2_field field = q->field;
218 BUG_ON(V4L2_FIELD_ANY == field);
220 if (V4L2_FIELD_ALTERNATE == field) {
221 if (V4L2_FIELD_TOP == q->last) {
222 field = V4L2_FIELD_BOTTOM;
223 q->last = V4L2_FIELD_BOTTOM;
225 field = V4L2_FIELD_TOP;
226 q->last = V4L2_FIELD_TOP;
232 /* Locking: Caller holds q->lock */
233 static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
234 struct videobuf_buffer *vb, enum v4l2_buf_type type)
236 MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
237 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
242 b->memory = vb->memory;
244 case V4L2_MEMORY_MMAP:
245 b->m.offset = vb->boff;
246 b->length = vb->bsize;
248 case V4L2_MEMORY_USERPTR:
249 b->m.userptr = vb->baddr;
250 b->length = vb->bsize;
252 case V4L2_MEMORY_OVERLAY:
253 b->m.offset = vb->boff;
259 b->flags |= V4L2_BUF_FLAG_MAPPED;
265 b->flags |= V4L2_BUF_FLAG_QUEUED;
269 b->flags |= V4L2_BUF_FLAG_DONE;
271 case STATE_NEEDS_INIT:
277 if (vb->input != UNSET) {
278 b->flags |= V4L2_BUF_FLAG_INPUT;
279 b->input = vb->input;
282 b->field = vb->field;
283 b->timestamp = vb->ts;
284 b->bytesused = vb->size;
285 b->sequence = vb->field_count >> 1;
288 /* Locking: Caller holds q->lock */
289 static int __videobuf_mmap_free(struct videobuf_queue *q)
297 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
299 rc = CALL(q,mmap_free,q);
303 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
304 if (NULL == q->bufs[i])
306 q->ops->buf_release(q,q->bufs[i]);
314 int videobuf_mmap_free(struct videobuf_queue *q)
317 mutex_lock(&q->lock);
318 ret = __videobuf_mmap_free(q);
319 mutex_unlock(&q->lock);
323 /* Locking: Caller holds q->lock */
324 static int __videobuf_mmap_setup(struct videobuf_queue *q,
325 unsigned int bcount, unsigned int bsize,
326 enum v4l2_memory memory)
331 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
333 err = __videobuf_mmap_free(q);
337 /* Allocate and initialize buffers */
338 for (i = 0; i < bcount; i++) {
339 q->bufs[i] = videobuf_alloc(q);
341 if (q->bufs[i] == NULL)
345 q->bufs[i]->input = UNSET;
346 q->bufs[i]->memory = memory;
347 q->bufs[i]->bsize = bsize;
349 case V4L2_MEMORY_MMAP:
350 q->bufs[i]->boff = bsize * i;
352 case V4L2_MEMORY_USERPTR:
353 case V4L2_MEMORY_OVERLAY:
362 dprintk(1,"mmap setup: %d buffers, %d bytes each\n",
368 int videobuf_mmap_setup(struct videobuf_queue *q,
369 unsigned int bcount, unsigned int bsize,
370 enum v4l2_memory memory)
373 mutex_lock(&q->lock);
374 ret = __videobuf_mmap_setup(q, bcount, bsize, memory);
375 mutex_unlock(&q->lock);
379 int videobuf_reqbufs(struct videobuf_queue *q,
380 struct v4l2_requestbuffers *req)
382 unsigned int size,count;
385 if (req->count < 1) {
386 dprintk(1,"reqbufs: count invalid (%d)\n",req->count);
390 if (req->memory != V4L2_MEMORY_MMAP &&
391 req->memory != V4L2_MEMORY_USERPTR &&
392 req->memory != V4L2_MEMORY_OVERLAY) {
393 dprintk(1,"reqbufs: memory type invalid\n");
397 mutex_lock(&q->lock);
398 if (req->type != q->type) {
399 dprintk(1,"reqbufs: queue type invalid\n");
405 dprintk(1,"reqbufs: streaming already exists\n");
409 if (!list_empty(&q->stream)) {
410 dprintk(1,"reqbufs: stream running\n");
416 if (count > VIDEO_MAX_FRAME)
417 count = VIDEO_MAX_FRAME;
419 q->ops->buf_setup(q,&count,&size);
420 size = PAGE_ALIGN(size);
421 dprintk(1,"reqbufs: bufs=%d, size=0x%x [%d pages total]\n",
422 count, size, (count*size)>>PAGE_SHIFT);
424 retval = __videobuf_mmap_setup(q,count,size,req->memory);
426 dprintk(1,"reqbufs: mmap setup returned %d\n",retval);
433 mutex_unlock(&q->lock);
437 int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b)
441 mutex_lock(&q->lock);
442 if (unlikely(b->type != q->type)) {
443 dprintk(1,"querybuf: Wrong type.\n");
446 if (unlikely(b->index < 0 || b->index >= VIDEO_MAX_FRAME)) {
447 dprintk(1,"querybuf: index out of range.\n");
450 if (unlikely(NULL == q->bufs[b->index])) {
451 dprintk(1,"querybuf: buffer is null.\n");
455 videobuf_status(q,b,q->bufs[b->index],q->type);
459 mutex_unlock(&q->lock);
463 int videobuf_qbuf(struct videobuf_queue *q,
464 struct v4l2_buffer *b)
466 struct videobuf_buffer *buf;
467 enum v4l2_field field;
468 unsigned long flags=0;
471 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
473 if (b->memory == V4L2_MEMORY_MMAP)
474 down_read(¤t->mm->mmap_sem);
476 mutex_lock(&q->lock);
479 dprintk(1,"qbuf: Reading running...\n");
483 if (b->type != q->type) {
484 dprintk(1,"qbuf: Wrong type.\n");
487 if (b->index < 0 || b->index >= VIDEO_MAX_FRAME) {
488 dprintk(1,"qbuf: index out of range.\n");
491 buf = q->bufs[b->index];
493 dprintk(1,"qbuf: buffer is null.\n");
496 MAGIC_CHECK(buf->magic,MAGIC_BUFFER);
497 if (buf->memory != b->memory) {
498 dprintk(1,"qbuf: memory type is wrong.\n");
501 if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) {
502 dprintk(1,"qbuf: buffer is already queued or active.\n");
506 if (b->flags & V4L2_BUF_FLAG_INPUT) {
507 if (b->input >= q->inputs) {
508 dprintk(1,"qbuf: wrong input.\n");
511 buf->input = b->input;
517 case V4L2_MEMORY_MMAP:
518 if (0 == buf->baddr) {
519 dprintk(1,"qbuf: mmap requested but buffer addr is zero!\n");
523 case V4L2_MEMORY_USERPTR:
524 if (b->length < buf->bsize) {
525 dprintk(1,"qbuf: buffer length is not enough\n");
528 if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
529 q->ops->buf_release(q,buf);
530 buf->baddr = b->m.userptr;
532 case V4L2_MEMORY_OVERLAY:
533 buf->boff = b->m.offset;
536 dprintk(1,"qbuf: wrong memory type\n");
540 dprintk(1,"qbuf: requesting next field\n");
541 field = videobuf_next_field(q);
542 retval = q->ops->buf_prepare(q,buf,field);
544 dprintk(1,"qbuf: buffer_prepare returned %d\n",retval);
548 list_add_tail(&buf->stream,&q->stream);
551 spin_lock_irqsave(q->irqlock,flags);
552 q->ops->buf_queue(q,buf);
554 spin_unlock_irqrestore(q->irqlock,flags);
556 dprintk(1,"qbuf: succeded\n");
560 mutex_unlock(&q->lock);
562 if (b->memory == V4L2_MEMORY_MMAP)
563 up_read(¤t->mm->mmap_sem);
568 int videobuf_dqbuf(struct videobuf_queue *q,
569 struct v4l2_buffer *b, int nonblocking)
571 struct videobuf_buffer *buf;
574 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
576 mutex_lock(&q->lock);
579 dprintk(1,"dqbuf: Reading running...\n");
583 if (b->type != q->type) {
584 dprintk(1,"dqbuf: Wrong type.\n");
587 if (list_empty(&q->stream)) {
588 dprintk(1,"dqbuf: stream running\n");
591 buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
592 retval = videobuf_waiton(buf, nonblocking, 1);
594 dprintk(1,"dqbuf: waiton returned %d\n",retval);
597 switch (buf->state) {
599 dprintk(1,"dqbuf: state is error\n");
602 buf->state = STATE_IDLE;
605 dprintk(1,"dqbuf: state is done\n");
607 buf->state = STATE_IDLE;
610 dprintk(1,"dqbuf: state invalid\n");
614 list_del(&buf->stream);
615 memset(b,0,sizeof(*b));
616 videobuf_status(q,b,buf,q->type);
619 mutex_unlock(&q->lock);
623 int videobuf_streamon(struct videobuf_queue *q)
625 struct videobuf_buffer *buf;
626 unsigned long flags=0;
629 mutex_lock(&q->lock);
638 spin_lock_irqsave(q->irqlock,flags);
639 list_for_each_entry(buf, &q->stream, stream)
640 if (buf->state == STATE_PREPARED)
641 q->ops->buf_queue(q,buf);
643 spin_unlock_irqrestore(q->irqlock,flags);
646 mutex_unlock(&q->lock);
650 /* Locking: Caller holds q->lock */
651 static int __videobuf_streamoff(struct videobuf_queue *q)
656 videobuf_queue_cancel(q);
662 int videobuf_streamoff(struct videobuf_queue *q)
666 mutex_lock(&q->lock);
667 retval = __videobuf_streamoff(q);
668 mutex_unlock(&q->lock);
673 /* Locking: Caller holds q->lock */
674 static ssize_t videobuf_read_zerocopy(struct videobuf_queue *q,
676 size_t count, loff_t *ppos)
678 enum v4l2_field field;
679 unsigned long flags=0;
682 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
685 q->read_buf = videobuf_alloc(q);
686 if (NULL == q->read_buf)
689 q->read_buf->memory = V4L2_MEMORY_USERPTR;
690 q->read_buf->baddr = (unsigned long)data;
691 q->read_buf->bsize = count;
693 field = videobuf_next_field(q);
694 retval = q->ops->buf_prepare(q,q->read_buf,field);
698 /* start capture & wait */
700 spin_lock_irqsave(q->irqlock,flags);
701 q->ops->buf_queue(q,q->read_buf);
703 spin_unlock_irqrestore(q->irqlock,flags);
704 retval = videobuf_waiton(q->read_buf,0,0);
706 CALL(q,sync,q,q->read_buf);
707 if (STATE_ERROR == q->read_buf->state)
710 retval = q->read_buf->size;
715 q->ops->buf_release(q,q->read_buf);
721 ssize_t videobuf_read_one(struct videobuf_queue *q,
722 char __user *data, size_t count, loff_t *ppos,
725 enum v4l2_field field;
726 unsigned long flags=0;
727 unsigned size, nbufs;
730 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
732 mutex_lock(&q->lock);
735 q->ops->buf_setup(q,&nbufs,&size);
737 if (NULL == q->read_buf &&
740 retval = videobuf_read_zerocopy(q,data,count,ppos);
741 if (retval >= 0 || retval == -EIO)
744 /* fallback to kernel bounce buffer on failures */
747 if (NULL == q->read_buf) {
748 /* need to capture a new frame */
750 q->read_buf = videobuf_alloc(q);
752 dprintk(1,"video alloc=0x%p\n", q->read_buf);
753 if (NULL == q->read_buf)
755 q->read_buf->memory = V4L2_MEMORY_USERPTR;
756 q->read_buf->bsize = count; /* preferred size */
757 field = videobuf_next_field(q);
758 retval = q->ops->buf_prepare(q,q->read_buf,field);
766 spin_lock_irqsave(q->irqlock,flags);
768 q->ops->buf_queue(q,q->read_buf);
770 spin_unlock_irqrestore(q->irqlock,flags);
774 /* wait until capture is done */
775 retval = videobuf_waiton(q->read_buf, nonblocking, 1);
779 CALL(q,sync,q,q->read_buf);
781 if (STATE_ERROR == q->read_buf->state) {
782 /* catch I/O errors */
783 q->ops->buf_release(q,q->read_buf);
790 /* Copy to userspace */
791 retval=CALL(q,video_copy_to_user,q,data,count,nonblocking);
795 q->read_off += retval;
796 if (q->read_off == q->read_buf->size) {
797 /* all data copied, cleanup */
798 q->ops->buf_release(q,q->read_buf);
804 mutex_unlock(&q->lock);
808 /* Locking: Caller holds q->lock */
809 int __videobuf_read_start(struct videobuf_queue *q)
811 enum v4l2_field field;
812 unsigned long flags=0;
813 unsigned int count = 0, size = 0;
816 q->ops->buf_setup(q,&count,&size);
819 if (count > VIDEO_MAX_FRAME)
820 count = VIDEO_MAX_FRAME;
821 size = PAGE_ALIGN(size);
823 err = __videobuf_mmap_setup(q, count, size, V4L2_MEMORY_USERPTR);
829 for (i = 0; i < count; i++) {
830 field = videobuf_next_field(q);
831 err = q->ops->buf_prepare(q,q->bufs[i],field);
834 list_add_tail(&q->bufs[i]->stream, &q->stream);
837 spin_lock_irqsave(q->irqlock,flags);
838 for (i = 0; i < count; i++)
839 q->ops->buf_queue(q,q->bufs[i]);
841 spin_unlock_irqrestore(q->irqlock,flags);
846 static void __videobuf_read_stop(struct videobuf_queue *q)
851 videobuf_queue_cancel(q);
852 __videobuf_mmap_free(q);
853 INIT_LIST_HEAD(&q->stream);
854 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
855 if (NULL == q->bufs[i])
865 int videobuf_read_start(struct videobuf_queue *q)
869 mutex_lock(&q->lock);
870 rc = __videobuf_read_start(q);
871 mutex_unlock(&q->lock);
876 void videobuf_read_stop(struct videobuf_queue *q)
878 mutex_lock(&q->lock);
879 __videobuf_read_stop(q);
880 mutex_unlock(&q->lock);
883 void videobuf_stop(struct videobuf_queue *q)
885 mutex_lock(&q->lock);
888 __videobuf_streamoff(q);
891 __videobuf_read_stop(q);
893 mutex_unlock(&q->lock);
897 ssize_t videobuf_read_stream(struct videobuf_queue *q,
898 char __user *data, size_t count, loff_t *ppos,
899 int vbihack, int nonblocking)
902 unsigned long flags=0;
904 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
906 dprintk(2,"%s\n",__FUNCTION__);
907 mutex_lock(&q->lock);
912 retval = __videobuf_read_start(q);
919 /* get / wait for data */
920 if (NULL == q->read_buf) {
921 q->read_buf = list_entry(q->stream.next,
922 struct videobuf_buffer,
924 list_del(&q->read_buf->stream);
927 rc = videobuf_waiton(q->read_buf, nonblocking, 1);
934 if (q->read_buf->state == STATE_DONE) {
935 rc = CALL (q,copy_stream, q, data + retval, count,
936 retval, vbihack, nonblocking);
946 q->read_off = q->read_buf->size;
951 /* requeue buffer when done with copying */
952 if (q->read_off == q->read_buf->size) {
953 list_add_tail(&q->read_buf->stream,
956 spin_lock_irqsave(q->irqlock,flags);
957 q->ops->buf_queue(q,q->read_buf);
959 spin_unlock_irqrestore(q->irqlock,flags);
967 mutex_unlock(&q->lock);
971 unsigned int videobuf_poll_stream(struct file *file,
972 struct videobuf_queue *q,
975 struct videobuf_buffer *buf = NULL;
978 mutex_lock(&q->lock);
980 if (!list_empty(&q->stream))
981 buf = list_entry(q->stream.next,
982 struct videobuf_buffer, stream);
985 __videobuf_read_start(q);
988 } else if (NULL == q->read_buf) {
989 q->read_buf = list_entry(q->stream.next,
990 struct videobuf_buffer,
992 list_del(&q->read_buf->stream);
1001 poll_wait(file, &buf->done, wait);
1002 if (buf->state == STATE_DONE ||
1003 buf->state == STATE_ERROR)
1004 rc = POLLIN|POLLRDNORM;
1006 mutex_unlock(&q->lock);
1010 int videobuf_mmap_mapper(struct videobuf_queue *q,
1011 struct vm_area_struct *vma)
1015 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
1017 mutex_lock(&q->lock);
1018 retval=CALL(q,mmap_mapper,q,vma);
1019 mutex_unlock(&q->lock);
1024 #ifdef CONFIG_VIDEO_V4L1_COMPAT
1025 int videobuf_cgmbuf(struct videobuf_queue *q,
1026 struct video_mbuf *mbuf, int count)
1028 struct v4l2_requestbuffers req;
1031 MAGIC_CHECK(q->int_ops->magic,MAGIC_QTYPE_OPS);
1033 memset(&req,0,sizeof(req));
1036 req.memory = V4L2_MEMORY_MMAP;
1037 rc = videobuf_reqbufs(q,&req);
1041 mbuf->frames = req.count;
1043 for (i = 0; i < mbuf->frames; i++) {
1044 mbuf->offsets[i] = q->bufs[i]->boff;
1045 mbuf->size += q->bufs[i]->bsize;
1050 EXPORT_SYMBOL_GPL(videobuf_cgmbuf);
1053 /* --------------------------------------------------------------------- */
1055 EXPORT_SYMBOL_GPL(videobuf_waiton);
1056 EXPORT_SYMBOL_GPL(videobuf_iolock);
1058 EXPORT_SYMBOL_GPL(videobuf_alloc);
1060 EXPORT_SYMBOL_GPL(videobuf_queue_core_init);
1061 EXPORT_SYMBOL_GPL(videobuf_queue_cancel);
1062 EXPORT_SYMBOL_GPL(videobuf_queue_is_busy);
1064 EXPORT_SYMBOL_GPL(videobuf_next_field);
1065 EXPORT_SYMBOL_GPL(videobuf_reqbufs);
1066 EXPORT_SYMBOL_GPL(videobuf_querybuf);
1067 EXPORT_SYMBOL_GPL(videobuf_qbuf);
1068 EXPORT_SYMBOL_GPL(videobuf_dqbuf);
1069 EXPORT_SYMBOL_GPL(videobuf_streamon);
1070 EXPORT_SYMBOL_GPL(videobuf_streamoff);
1072 EXPORT_SYMBOL_GPL(videobuf_read_start);
1073 EXPORT_SYMBOL_GPL(videobuf_read_stop);
1074 EXPORT_SYMBOL_GPL(videobuf_stop);
1075 EXPORT_SYMBOL_GPL(videobuf_read_stream);
1076 EXPORT_SYMBOL_GPL(videobuf_read_one);
1077 EXPORT_SYMBOL_GPL(videobuf_poll_stream);
1079 EXPORT_SYMBOL_GPL(videobuf_mmap_setup);
1080 EXPORT_SYMBOL_GPL(videobuf_mmap_free);
1081 EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);