]> git.hungrycats.org Git - linux/commitdiff
[PATCH] v4l: adapt saa7146 to video-buf changes.
authorGerd Knorr <kraxel@bytesex.org>
Wed, 20 Oct 2004 01:17:57 +0000 (18:17 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 20 Oct 2004 01:17:57 +0000 (18:17 -0700)
This patch adapts the saa7146 driver to the video-buf changes.

Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/common/saa7146_fops.c
drivers/media/common/saa7146_vbi.c
drivers/media/common/saa7146_video.c

index a5621d7acee9cdc86230c4209f570e1341fecbb8..0c5c14a0e8d3becc2b0b813a29efcc697a923b81 100644 (file)
@@ -371,7 +371,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
 
        if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
                if( 0 == fh->vbi_q.streaming )
-                       return videobuf_poll_stream(file, &fh->vbi_q, wait);
+                       return videobuf_poll_stream(file, file->private_data, &fh->vbi_q, wait);
                q = &fh->vbi_q;
        } else {
                DEB_D(("using video queue.\n"));
index 6c4f0bedda1cb0d138b35cc02073a44d5ba50dc6..2534497ece49665b2a5d42a145a1349828c12864 100644 (file)
@@ -213,8 +213,9 @@ static int buffer_activate(struct saa7146_dev *dev,
        return 0;
 }
 
-static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field)
+static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_buf *buf = (struct saa7146_buf *)vb;
@@ -264,7 +265,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l
        return err;
 }
 
-static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
+static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
 {
        int llength,lines;
        
@@ -279,8 +280,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si
        return 0;
 }
 
-static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
+static void buffer_queue(void *priv, struct videobuf_buffer *vb)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_vv *vv = dev->vv_data;
@@ -290,8 +292,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
        saa7146_buffer_queue(dev,&vv->vbi_q,buf);
 }
 
-static void buffer_release(struct file *file, struct videobuf_buffer *vb)
+static void buffer_release(void *priv, struct videobuf_buffer *vb)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh   = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_buf *buf = (struct saa7146_buf *)vb;
@@ -480,7 +483,8 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff
        }
 
        mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT);
-       ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1);
+       ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1,
+                                  file->f_flags & O_NONBLOCK);
 /*
        printk("BASE_ODD3:      0x%08x\n", saa7146_read(dev, BASE_ODD3));
        printk("BASE_EVEN3:     0x%08x\n", saa7146_read(dev, BASE_EVEN3));
index e897131951412ba166496f0ba38dc586134d1493..d7dd4d5197afe2747ab6751aa79152b4cc497cbb 100644 (file)
@@ -1147,7 +1147,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        case VIDIOC_DQBUF: {
                struct v4l2_buffer *buf = arg;
                int ret = 0;
-               ret = videobuf_dqbuf(file,q,buf);
+               ret = videobuf_dqbuf(file,q,buf,file->f_flags & O_NONBLOCK);
                DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index));
                return ret;
        }
@@ -1240,8 +1240,9 @@ static int buffer_activate (struct saa7146_dev *dev,
        return 0;
 }
 
-static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4l2_field field)
+static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_field field)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_vv *vv = dev->vv_data;
@@ -1322,8 +1323,9 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4
        return err;
 }
 
-static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
+static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
 
        if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS)
@@ -1341,8 +1343,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si
        return 0;
 }
 
-static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
+static void buffer_queue(void *priv, struct videobuf_buffer *vb)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_vv *vv = dev->vv_data;
@@ -1353,8 +1356,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
 }
 
 
-static void buffer_release(struct file *file, struct videobuf_buffer *vb)
+static void buffer_release(void *priv, struct videobuf_buffer *vb)
 {
+       struct file *file = priv;
        struct saa7146_fh *fh = file->private_data;
        struct saa7146_dev *dev = fh->dev;
        struct saa7146_buf *buf = (struct saa7146_buf *)vb;
@@ -1474,7 +1478,8 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
                goto out;
        }
 
-       ret = videobuf_read_one(file,&fh->video_q , data, count, ppos);
+       ret = videobuf_read_one(file,&fh->video_q , data, count, ppos,
+                               file->f_flags & O_NONBLOCK);
        if (ret != 0) {
        video_end(fh, file);
        } else {