diff options
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r-- | drivers/media/video/videodev.c | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 5263b50463e1..b876aca69c73 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -433,13 +433,43 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
433 | int ret = -EINVAL; | 433 | int ret = -EINVAL; |
434 | 434 | ||
435 | if ( (vfd->debug & V4L2_DEBUG_IOCTL) && | 435 | if ( (vfd->debug & V4L2_DEBUG_IOCTL) && |
436 | !(vfd->debug | V4L2_DEBUG_IOCTL_ARG)) { | 436 | !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { |
437 | v4l_print_ioctl(vfd->name, cmd); | 437 | v4l_print_ioctl(vfd->name, cmd); |
438 | } | 438 | } |
439 | 439 | ||
440 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
441 | /*********************************************************** | ||
442 | Handles calls to the obsoleted V4L1 API | ||
443 | Due to the nature of VIDIOCGMBUF, each driver that supports | ||
444 | V4L1 should implement its own handler for this ioctl. | ||
445 | ***********************************************************/ | ||
446 | |||
447 | /* --- streaming capture ------------------------------------- */ | ||
448 | if (cmd == VIDIOCGMBUF) { | ||
449 | struct video_mbuf *p=arg; | ||
450 | |||
451 | memset(p,0,sizeof(p)); | ||
452 | |||
453 | if (!vfd->vidiocgmbuf) | ||
454 | return ret; | ||
455 | ret=vfd->vidiocgmbuf(file, fh, p); | ||
456 | if (!ret) | ||
457 | dbgarg (cmd, "size=%d, frames=%d, offsets=0x%08lx\n", | ||
458 | p->size, p->frames, | ||
459 | (unsigned long)p->offsets); | ||
460 | return ret; | ||
461 | } | ||
462 | |||
463 | /******************************************************** | ||
464 | All other V4L1 calls are handled by v4l1_compat module. | ||
465 | Those calls will be translated into V4L2 calls, and | ||
466 | __video_do_ioctl will be called again, with one or more | ||
467 | V4L2 ioctls. | ||
468 | ********************************************************/ | ||
440 | if (_IOC_TYPE(cmd)=='v') | 469 | if (_IOC_TYPE(cmd)=='v') |
441 | return v4l_compat_translate_ioctl(inode,file,cmd,arg, | 470 | return v4l_compat_translate_ioctl(inode,file,cmd,arg, |
442 | __video_do_ioctl); | 471 | __video_do_ioctl); |
472 | #endif | ||
443 | 473 | ||
444 | switch(cmd) { | 474 | switch(cmd) { |
445 | /* --- capabilities ------------------------------------------ */ | 475 | /* --- capabilities ------------------------------------------ */ |
@@ -791,24 +821,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
791 | ret=vfd->vidioc_overlay(file, fh, *i); | 821 | ret=vfd->vidioc_overlay(file, fh, *i); |
792 | break; | 822 | break; |
793 | } | 823 | } |
794 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
795 | /* --- streaming capture ------------------------------------- */ | ||
796 | case VIDIOCGMBUF: | ||
797 | { | ||
798 | struct video_mbuf *p=arg; | ||
799 | |||
800 | memset(p,0,sizeof(p)); | ||
801 | |||
802 | if (!vfd->vidiocgmbuf) | ||
803 | break; | ||
804 | ret=vfd->vidiocgmbuf(file, fh, p); | ||
805 | if (!ret) | ||
806 | dbgarg (cmd, "size=%d, frames=%d, offsets=0x%08lx\n", | ||
807 | p->size, p->frames, | ||
808 | (unsigned long)p->offsets); | ||
809 | break; | ||
810 | } | ||
811 | #endif | ||
812 | case VIDIOC_G_FBUF: | 824 | case VIDIOC_G_FBUF: |
813 | { | 825 | { |
814 | struct v4l2_framebuffer *p=arg; | 826 | struct v4l2_framebuffer *p=arg; |