|
@@ -541,6 +541,7 @@ static long __video_do_ioctl(struct file *file,
|
|
void *fh = file->private_data;
|
|
void *fh = file->private_data;
|
|
struct v4l2_fh *vfh = NULL;
|
|
struct v4l2_fh *vfh = NULL;
|
|
struct v4l2_format f_copy;
|
|
struct v4l2_format f_copy;
|
|
|
|
+ int use_fh_prio = 0;
|
|
long ret = -EINVAL;
|
|
long ret = -EINVAL;
|
|
|
|
|
|
if (ops == NULL) {
|
|
if (ops == NULL) {
|
|
@@ -555,10 +556,12 @@ static long __video_do_ioctl(struct file *file,
|
|
printk(KERN_CONT "\n");
|
|
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;
|
|
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) {
|
|
switch (cmd) {
|
|
case VIDIOC_S_CTRL:
|
|
case VIDIOC_S_CTRL:
|
|
case VIDIOC_S_STD:
|
|
case VIDIOC_S_STD:
|
|
@@ -620,7 +623,7 @@ static long __video_do_ioctl(struct file *file,
|
|
|
|
|
|
if (ops->vidioc_g_priority) {
|
|
if (ops->vidioc_g_priority) {
|
|
ret = ops->vidioc_g_priority(file, fh, p);
|
|
ret = ops->vidioc_g_priority(file, fh, p);
|
|
- } else if (vfh) {
|
|
|
|
|
|
+ } else if (use_fh_prio) {
|
|
*p = v4l2_prio_max(&vfd->v4l2_dev->prio);
|
|
*p = v4l2_prio_max(&vfd->v4l2_dev->prio);
|
|
ret = 0;
|
|
ret = 0;
|
|
}
|
|
}
|
|
@@ -632,7 +635,7 @@ static long __video_do_ioctl(struct file *file,
|
|
{
|
|
{
|
|
enum v4l2_priority *p = arg;
|
|
enum v4l2_priority *p = arg;
|
|
|
|
|
|
- if (!ops->vidioc_s_priority && vfh == NULL)
|
|
|
|
|
|
+ if (!ops->vidioc_s_priority && !use_fh_prio)
|
|
break;
|
|
break;
|
|
dbgarg(cmd, "setting priority to %d\n", *p);
|
|
dbgarg(cmd, "setting priority to %d\n", *p);
|
|
if (ops->vidioc_s_priority)
|
|
if (ops->vidioc_s_priority)
|
|
@@ -2187,7 +2190,7 @@ static long __video_do_ioctl(struct file *file,
|
|
|
|
|
|
if (!ops->vidioc_default)
|
|
if (!ops->vidioc_default)
|
|
break;
|
|
break;
|
|
- if (vfh && !ops->vidioc_s_priority)
|
|
|
|
|
|
+ if (use_fh_prio)
|
|
valid_prio = v4l2_prio_check(vfd->prio, vfh->prio) >= 0;
|
|
valid_prio = v4l2_prio_check(vfd->prio, vfh->prio) >= 0;
|
|
ret = ops->vidioc_default(file, fh, valid_prio, cmd, arg);
|
|
ret = ops->vidioc_default(file, fh, valid_prio, cmd, arg);
|
|
break;
|
|
break;
|