[media] cx88: add priority support
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 11 May 2012 13:57:59 +0000 (10:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 6 Jul 2012 21:11:51 +0000 (18:11 -0300)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88.h

index d8c25c5bb3231a34084a24ebecafb9d3c777ad6c..95cdfed80f4ead06095e9101ab735c00ed36c54b 100644 (file)
@@ -974,6 +974,7 @@ static int mpeg_open(struct file *file)
                mutex_unlock(&dev->core->lock);
                return -ENOMEM;
        }
+       v4l2_fh_init(&fh->fh, vdev);
        file->private_data = fh;
        fh->dev      = dev;
 
@@ -990,6 +991,7 @@ static int mpeg_open(struct file *file)
 
        dev->core->mpeg_users++;
        mutex_unlock(&dev->core->lock);
+       v4l2_fh_add(&fh->fh);
        return 0;
 }
 
@@ -1010,6 +1012,8 @@ static int mpeg_release(struct file *file)
 
        videobuf_mmap_free(&fh->mpegq);
 
+       v4l2_fh_del(&fh->fh);
+       v4l2_fh_exit(&fh->fh);
        file->private_data = NULL;
        kfree(fh);
 
index 8bd925db412be7e0b61f251c4aec43ac297f5ad2..e81c735f012a263b918bfdb324aff12578b06c1d 100644 (file)
@@ -1036,6 +1036,7 @@ struct video_device *cx88_vdev_init(struct cx88_core *core,
        vfd->release = video_device_release;
        snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)",
                 core->name, type, core->board.name);
+       set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags);
        return vfd;
 }
 
index bd1f52f6e2649e036a0fcd8b6206fc186aada40e..673f88be325fbce189019cb07455e15a0edd3b3c 100644 (file)
@@ -744,6 +744,7 @@ static int video_open(struct file *file)
        if (unlikely(!fh))
                return -ENOMEM;
 
+       v4l2_fh_init(&fh->fh, vdev);
        file->private_data = fh;
        fh->dev      = dev;
 
@@ -788,6 +789,7 @@ static int video_open(struct file *file)
 
        core->users++;
        mutex_unlock(&core->lock);
+       v4l2_fh_add(&fh->fh);
 
        return 0;
 }
@@ -883,6 +885,8 @@ static int video_release(struct file *file)
        videobuf_mmap_free(&fh->vbiq);
 
        mutex_lock(&dev->core->lock);
+       v4l2_fh_del(&fh->fh);
+       v4l2_fh_exit(&fh->fh);
        file->private_data = NULL;
        kfree(fh);
 
index 94af48e91b5286e412c8dc8e0fe534e9b12edb4c..0cae0fd9e1647d50f73b4826c2a35861f71a771c 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/kdev_t.h>
 
 #include <media/v4l2-device.h>
+#include <media/v4l2-fh.h>
 #include <media/tuner.h>
 #include <media/tveeprom.h>
 #include <media/videobuf-dma-sg.h>
@@ -454,6 +455,7 @@ struct cx8802_dev;
 /* function 0: video stuff                                     */
 
 struct cx8800_fh {
+       struct v4l2_fh             fh;
        struct cx8800_dev          *dev;
        unsigned int               resources;
 
@@ -504,6 +506,7 @@ struct cx8800_dev {
 /* function 2: mpeg stuff                                      */
 
 struct cx8802_fh {
+       struct v4l2_fh             fh;
        struct cx8802_dev          *dev;
        struct videobuf_queue      mpegq;
 };