summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKenneth Aafloy <devnull@localhost>2004-11-16 14:23:36 +0000
committerKenneth Aafloy <devnull@localhost>2004-11-16 14:23:36 +0000
commit070620158ef9755801329fc9b567070b8b19da38 (patch)
treeaf3e59882e4680cbe04d1520454b26ce445232a6 /linux
parent5c7692558a1136078b55837599894e816f2786e3 (diff)
downloadmediapointer-dvb-s2-070620158ef9755801329fc9b567070b8b19da38.tar.gz
mediapointer-dvb-s2-070620158ef9755801329fc9b567070b8b19da38.tar.bz2
- videobuf api changes in 2.6.10
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/common/saa7146_fops.c10
-rw-r--r--linux/drivers/media/common/saa7146_vbi.c26
-rw-r--r--linux/drivers/media/common/saa7146_video.c49
3 files changed, 60 insertions, 25 deletions
diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c
index 0fa03c3fa..dd92cebbd 100644
--- a/linux/drivers/media/common/saa7146_fops.c
+++ b/linux/drivers/media/common/saa7146_fops.c
@@ -1,4 +1,5 @@
#include <media/saa7146_vv.h>
+#include <linux/version.h>
#define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1)
@@ -344,7 +345,12 @@ static int fops_mmap(struct file *file, struct vm_area_struct * vma)
BUG();
return 0;
}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
return videobuf_mmap_mapper(vma,q);
+#else
+ return videobuf_mmap_mapper(q,vma);
+#endif
}
static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
@@ -357,11 +363,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 )
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
return videobuf_poll_stream(file, &fh->vbi_q, wait);
-#else
- return videobuf_poll_stream(file, file->private_data, &fh->vbi_q, wait);
-#endif
q = &fh->vbi_q;
} else {
DEB_D(("using video queue.\n"));
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c
index 8a07e95df..ecbd93eee 100644
--- a/linux/drivers/media/common/saa7146_vbi.c
+++ b/linux/drivers/media/common/saa7146_vbi.c
@@ -218,9 +218,9 @@ static int buffer_activate(struct saa7146_dev *dev,
static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field)
{
#else
-static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field)
+static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -274,7 +274,7 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
#else
-static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
+static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
#endif
{
int llength,lines;
@@ -294,9 +294,9 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
{
#else
-static void buffer_queue(void *priv, struct videobuf_buffer *vb)
+static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -311,9 +311,9 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb)
static void buffer_release(struct file *file, struct videobuf_buffer *vb)
{
#else
-static void buffer_release(void *priv, struct videobuf_buffer *vb)
+static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -354,7 +354,11 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file)
saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE);
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
videobuf_queue_cancel(file,&fh->vbi_q);
+#else
+ videobuf_queue_cancel(&fh->vbi_q);
+#endif
vv->vbi_streaming = NULL;
@@ -427,7 +431,11 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file)
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VBI_CAPTURE,
V4L2_FIELD_SEQ_TB, // FIXME: does this really work?
- sizeof(struct saa7146_buf));
+ sizeof(struct saa7146_buf)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+ ,file
+#endif
+ );
init_MUTEX(&fh->vbi_q.lock);
init_timer(&fh->vbi_read_timeout);
@@ -506,7 +514,7 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1);
#else
- ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1,
+ ret = videobuf_read_stream(&fh->vbi_q, data, count, ppos, 1,
file->f_flags & O_NONBLOCK);
#endif
/*
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 2f632b747..8cce44602 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1137,7 +1137,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
case VIDIOC_REQBUFS: {
struct v4l2_requestbuffers *req = arg;
DEB_D(("VIDIOC_REQBUFS, type:%d\n",req->type));
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
return videobuf_reqbufs(file,q,req);
+#else
+ return videobuf_reqbufs(q,req);
+#endif
}
case VIDIOC_QUERYBUF: {
struct v4l2_buffer *buf = arg;
@@ -1147,7 +1151,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
case VIDIOC_QBUF: {
struct v4l2_buffer *buf = arg;
int ret = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
ret = videobuf_qbuf(file,q,buf);
+#else
+ ret = videobuf_qbuf(q,buf);
+#endif
DEB_D(("VIDIOC_QBUF: ret:%d, index:%d\n",ret,buf->index));
return ret;
}
@@ -1157,7 +1165,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
ret = videobuf_dqbuf(file,q,buf);
#else
- ret = videobuf_dqbuf(file,q,buf,file->f_flags & O_NONBLOCK);
+ ret = videobuf_dqbuf(q,buf,file->f_flags & O_NONBLOCK);
#endif
DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index));
return ret;
@@ -1170,7 +1178,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
if( 0 != err) {
return err;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
err = videobuf_streamon(file,q);
+#else
+ err = videobuf_streamon(q);
+#endif
return err;
}
case VIDIOC_STREAMOFF: {
@@ -1191,7 +1203,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
return -EBUSY;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
err = videobuf_streamoff(file,q);
+#else
+ err = videobuf_streamoff(q);
+#endif
if (0 != err) {
DEB_D(("warning: videobuf_streamoff() failed.\n"));
video_end(fh, file);
@@ -1214,8 +1230,13 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
q = &fh->video_q;
down(&q->lock);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
err = videobuf_mmap_setup(file,q,gbuffers,gbufsize,
V4L2_MEMORY_MMAP);
+#else
+ err = videobuf_mmap_setup(q,gbuffers,gbufsize,
+ V4L2_MEMORY_MMAP);
+#endif
if (err < 0) {
up(&q->lock);
return err;
@@ -1255,9 +1276,9 @@ static int buffer_activate (struct saa7146_dev *dev,
static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field)
{
#else
-static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field)
+static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -1343,9 +1364,9 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field
static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
{
#else
-static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
+static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
@@ -1368,9 +1389,9 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
{
#else
-static void buffer_queue(void *priv, struct videobuf_buffer *vb)
+static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -1385,9 +1406,9 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb)
static void buffer_release(struct file *file, struct videobuf_buffer *vb)
{
#else
-static void buffer_release(void *priv, struct videobuf_buffer *vb)
+static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
{
- struct file *file = priv;
+ struct file *file = q->priv_data;
#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
@@ -1442,7 +1463,11 @@ static int video_open(struct saa7146_dev *dev, struct file *file)
dev->pci, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
- sizeof(struct saa7146_buf));
+ sizeof(struct saa7146_buf)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+ ,file
+#endif
+ );
init_MUTEX(&fh->video_q.lock);
@@ -1509,9 +1534,9 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
- ret = videobuf_read_one(file,&fh->video_q , data, count, ppos);
+ ret = videobuf_read_one(file, &fh->video_q , data, count, ppos);
#else
- ret = videobuf_read_one(file,&fh->video_q , data, count, ppos,
+ ret = videobuf_read_one(&fh->video_q , data, count, ppos,
file->f_flags & O_NONBLOCK);
#endif
if (ret != 0) {