Commit 84e0e179 authored by Andrew Morton's avatar Andrew Morton Committed by Jaroslav Kysela

[PATCH] v4l1 compatibility module fix.

From: Gerd Knorr <kraxel@bytesex.org>

This patch fixes a bug in the v4l1-compat module and makes it pass the
correct buffer type to the v4l2 driver on VIDIOC_STREAM(ON|OFF) ioctls.
parent 18e0d45e
...@@ -503,10 +503,11 @@ v4l_compat_translate_ioctl(struct inode *inode, ...@@ -503,10 +503,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
int *on = arg; int *on = arg;
if (0 == *on) { if (0 == *on) {
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
/* dirty hack time. But v4l1 has no STREAMOFF /* dirty hack time. But v4l1 has no STREAMOFF
* equivalent in the API, and this one at * equivalent in the API, and this one at
* least comes close ... */ * least comes close ... */
drv(inode, file, VIDIOC_STREAMOFF, NULL); drv(inode, file, VIDIOC_STREAMOFF, &type);
} }
err = drv(inode, file, VIDIOC_OVERLAY, arg); err = drv(inode, file, VIDIOC_OVERLAY, arg);
if (err < 0) if (err < 0)
...@@ -857,6 +858,7 @@ v4l_compat_translate_ioctl(struct inode *inode, ...@@ -857,6 +858,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
case VIDIOCMCAPTURE: /* capture a frame */ case VIDIOCMCAPTURE: /* capture a frame */
{ {
struct video_mmap *mm = arg; struct video_mmap *mm = arg;
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
memset(&buf2,0,sizeof(buf2)); memset(&buf2,0,sizeof(buf2));
...@@ -897,7 +899,7 @@ v4l_compat_translate_ioctl(struct inode *inode, ...@@ -897,7 +899,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n",err); dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n",err);
break; break;
} }
err = drv(inode, file, VIDIOC_STREAMON, NULL); err = drv(inode, file, VIDIOC_STREAMON, &type);
if (err < 0) if (err < 0)
dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n",err); dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n",err);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment