aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-03-22 10:14:07 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 16:38:16 -0300
commitb1a873a37b6551a214ad37d1eee7654a9d65fd6e (patch)
tree3667a3d36c9f7c6ae73609004331f006751c44be /drivers/media/video/v4l2-ioctl.c
parent2f82441a8644287e5b647329cc30b590f6fd3714 (diff)
downloadkernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.zip
kernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.tar.gz
kernel_samsung_smdk4412-b1a873a37b6551a214ad37d1eee7654a9d65fd6e.tar.bz2
[media] v4l2: use new flag to enable core priority handling
Rather than guess which driver supports core priority handling, require drivers that do to explicitly set the V4L2_FL_USE_FH_PRIO flag in video_device. Updated the core prio handling accordingly and set the flag in the three drivers that do. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r--drivers/media/video/v4l2-ioctl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 3e6b6fa..a01ed39 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -541,6 +541,7 @@ static long __video_do_ioctl(struct file *file,
void *fh = file->private_data;
struct v4l2_fh *vfh = NULL;
struct v4l2_format f_copy;
+ int use_fh_prio = 0;
long ret = -EINVAL;
if (ops == NULL) {
@@ -555,10 +556,12 @@ static long __video_do_ioctl(struct file *file,
printk(KERN_CONT "\n");
}
- if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags))
+ if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
vfh = file->private_data;
+ use_fh_prio = test_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags);
+ }
- if (vfh && !ops->vidioc_s_priority) {
+ if (use_fh_prio) {
switch (cmd) {
case VIDIOC_S_CTRL:
case VIDIOC_S_STD:
@@ -620,7 +623,7 @@ static long __video_do_ioctl(struct file *file,
if (ops->vidioc_g_priority) {
ret = ops->vidioc_g_priority(file, fh, p);
- } else if (vfh) {
+ } else if (use_fh_prio) {
*p = v4l2_prio_max(&vfd->v4l2_dev->prio);
ret = 0;
}
@@ -632,7 +635,7 @@ static long __video_do_ioctl(struct file *file,
{
enum v4l2_priority *p = arg;
- if (!ops->vidioc_s_priority && vfh == NULL)
+ if (!ops->vidioc_s_priority && !use_fh_prio)
break;
dbgarg(cmd, "setting priority to %d\n", *p);
if (ops->vidioc_s_priority)
@@ -2187,7 +2190,7 @@ static long __video_do_ioctl(struct file *file,
if (!ops->vidioc_default)
break;
- if (vfh && !ops->vidioc_s_priority)
+ if (use_fh_prio)
valid_prio = v4l2_prio_check(vfd->prio, vfh->prio) >= 0;
ret = ops->vidioc_default(file, fh, valid_prio, cmd, arg);
break;