diff options
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index 43e78ee24a10..5c55bd392ea3 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
@@ -644,53 +644,6 @@ done: | |||
644 | return retval; | 644 | return retval; |
645 | } | 645 | } |
646 | 646 | ||
647 | static int __videobuf_copy_to_user(struct videobuf_queue *q, | ||
648 | char __user *data, size_t count, | ||
649 | int nonblocking) | ||
650 | { | ||
651 | struct videobuf_dma_sg_memory *mem = q->read_buf->priv; | ||
652 | BUG_ON(!mem); | ||
653 | MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); | ||
654 | |||
655 | /* copy to userspace */ | ||
656 | if (count > q->read_buf->size - q->read_off) | ||
657 | count = q->read_buf->size - q->read_off; | ||
658 | |||
659 | if (copy_to_user(data, mem->dma.vmalloc+q->read_off, count)) | ||
660 | return -EFAULT; | ||
661 | |||
662 | return count; | ||
663 | } | ||
664 | |||
665 | static int __videobuf_copy_stream(struct videobuf_queue *q, | ||
666 | char __user *data, size_t count, size_t pos, | ||
667 | int vbihack, int nonblocking) | ||
668 | { | ||
669 | unsigned int *fc; | ||
670 | struct videobuf_dma_sg_memory *mem = q->read_buf->priv; | ||
671 | BUG_ON(!mem); | ||
672 | MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); | ||
673 | |||
674 | if (vbihack) { | ||
675 | /* dirty, undocumented hack -- pass the frame counter | ||
676 | * within the last four bytes of each vbi data block. | ||
677 | * We need that one to maintain backward compatibility | ||
678 | * to all vbi decoding software out there ... */ | ||
679 | fc = (unsigned int *)mem->dma.vmalloc; | ||
680 | fc += (q->read_buf->size >> 2) - 1; | ||
681 | *fc = q->read_buf->field_count >> 1; | ||
682 | dprintk(1, "vbihack: %d\n", *fc); | ||
683 | } | ||
684 | |||
685 | /* copy stuff using the common method */ | ||
686 | count = __videobuf_copy_to_user(q, data, count, nonblocking); | ||
687 | |||
688 | if ((count == -EFAULT) && (0 == pos)) | ||
689 | return -EFAULT; | ||
690 | |||
691 | return count; | ||
692 | } | ||
693 | |||
694 | static struct videobuf_qtype_ops sg_ops = { | 647 | static struct videobuf_qtype_ops sg_ops = { |
695 | .magic = MAGIC_QTYPE_OPS, | 648 | .magic = MAGIC_QTYPE_OPS, |
696 | 649 | ||
@@ -698,8 +651,6 @@ static struct videobuf_qtype_ops sg_ops = { | |||
698 | .iolock = __videobuf_iolock, | 651 | .iolock = __videobuf_iolock, |
699 | .sync = __videobuf_sync, | 652 | .sync = __videobuf_sync, |
700 | .mmap_mapper = __videobuf_mmap_mapper, | 653 | .mmap_mapper = __videobuf_mmap_mapper, |
701 | .video_copy_to_user = __videobuf_copy_to_user, | ||
702 | .copy_stream = __videobuf_copy_stream, | ||
703 | .vaddr = __videobuf_to_vaddr, | 654 | .vaddr = __videobuf_to_vaddr, |
704 | }; | 655 | }; |
705 | 656 | ||