Commit 88bb42fb authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] cx88: add priority support

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c5a86144
...@@ -974,6 +974,7 @@ static int mpeg_open(struct file *file) ...@@ -974,6 +974,7 @@ static int mpeg_open(struct file *file)
mutex_unlock(&dev->core->lock); mutex_unlock(&dev->core->lock);
return -ENOMEM; return -ENOMEM;
} }
v4l2_fh_init(&fh->fh, vdev);
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
...@@ -990,6 +991,7 @@ static int mpeg_open(struct file *file) ...@@ -990,6 +991,7 @@ static int mpeg_open(struct file *file)
dev->core->mpeg_users++; dev->core->mpeg_users++;
mutex_unlock(&dev->core->lock); mutex_unlock(&dev->core->lock);
v4l2_fh_add(&fh->fh);
return 0; return 0;
} }
...@@ -1010,6 +1012,8 @@ static int mpeg_release(struct file *file) ...@@ -1010,6 +1012,8 @@ static int mpeg_release(struct file *file)
videobuf_mmap_free(&fh->mpegq); videobuf_mmap_free(&fh->mpegq);
v4l2_fh_del(&fh->fh);
v4l2_fh_exit(&fh->fh);
file->private_data = NULL; file->private_data = NULL;
kfree(fh); kfree(fh);
......
...@@ -1036,6 +1036,7 @@ struct video_device *cx88_vdev_init(struct cx88_core *core, ...@@ -1036,6 +1036,7 @@ struct video_device *cx88_vdev_init(struct cx88_core *core,
vfd->release = video_device_release; vfd->release = video_device_release;
snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)",
core->name, type, core->board.name); core->name, type, core->board.name);
set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags);
return vfd; return vfd;
} }
......
...@@ -744,6 +744,7 @@ static int video_open(struct file *file) ...@@ -744,6 +744,7 @@ static int video_open(struct file *file)
if (unlikely(!fh)) if (unlikely(!fh))
return -ENOMEM; return -ENOMEM;
v4l2_fh_init(&fh->fh, vdev);
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
...@@ -788,6 +789,7 @@ static int video_open(struct file *file) ...@@ -788,6 +789,7 @@ static int video_open(struct file *file)
core->users++; core->users++;
mutex_unlock(&core->lock); mutex_unlock(&core->lock);
v4l2_fh_add(&fh->fh);
return 0; return 0;
} }
...@@ -883,6 +885,8 @@ static int video_release(struct file *file) ...@@ -883,6 +885,8 @@ static int video_release(struct file *file)
videobuf_mmap_free(&fh->vbiq); videobuf_mmap_free(&fh->vbiq);
mutex_lock(&dev->core->lock); mutex_lock(&dev->core->lock);
v4l2_fh_del(&fh->fh);
v4l2_fh_exit(&fh->fh);
file->private_data = NULL; file->private_data = NULL;
kfree(fh); kfree(fh);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/tuner.h> #include <media/tuner.h>
#include <media/tveeprom.h> #include <media/tveeprom.h>
#include <media/videobuf-dma-sg.h> #include <media/videobuf-dma-sg.h>
...@@ -454,6 +455,7 @@ struct cx8802_dev; ...@@ -454,6 +455,7 @@ struct cx8802_dev;
/* function 0: video stuff */ /* function 0: video stuff */
struct cx8800_fh { struct cx8800_fh {
struct v4l2_fh fh;
struct cx8800_dev *dev; struct cx8800_dev *dev;
unsigned int resources; unsigned int resources;
...@@ -504,6 +506,7 @@ struct cx8800_dev { ...@@ -504,6 +506,7 @@ struct cx8800_dev {
/* function 2: mpeg stuff */ /* function 2: mpeg stuff */
struct cx8802_fh { struct cx8802_fh {
struct v4l2_fh fh;
struct cx8802_dev *dev; struct cx8802_dev *dev;
struct videobuf_queue mpegq; struct videobuf_queue mpegq;
}; };
......
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