diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 182 |
1 files changed, 41 insertions, 141 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 3df1f80f1c5c..623d280ce095 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -189,6 +189,8 @@ struct v4l2_ioctl_info { | |||
189 | const char * const name; | 189 | const char * const name; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | /* This control needs a priority check */ | ||
193 | #define INFO_FL_PRIO (1 << 0) | ||
192 | /* This control can be valid if the filehandle passes a control handler. */ | 194 | /* This control can be valid if the filehandle passes a control handler. */ |
193 | #define INFO_FL_CTRL (1 << 1) | 195 | #define INFO_FL_CTRL (1 << 1) |
194 | 196 | ||
@@ -202,80 +204,82 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = { | |||
202 | IOCTL_INFO(VIDIOC_QUERYCAP, 0), | 204 | IOCTL_INFO(VIDIOC_QUERYCAP, 0), |
203 | IOCTL_INFO(VIDIOC_ENUM_FMT, 0), | 205 | IOCTL_INFO(VIDIOC_ENUM_FMT, 0), |
204 | IOCTL_INFO(VIDIOC_G_FMT, 0), | 206 | IOCTL_INFO(VIDIOC_G_FMT, 0), |
205 | IOCTL_INFO(VIDIOC_S_FMT, 0), | 207 | IOCTL_INFO(VIDIOC_S_FMT, INFO_FL_PRIO), |
206 | IOCTL_INFO(VIDIOC_REQBUFS, 0), | 208 | IOCTL_INFO(VIDIOC_REQBUFS, INFO_FL_PRIO), |
207 | IOCTL_INFO(VIDIOC_QUERYBUF, 0), | 209 | IOCTL_INFO(VIDIOC_QUERYBUF, 0), |
208 | IOCTL_INFO(VIDIOC_G_FBUF, 0), | 210 | IOCTL_INFO(VIDIOC_G_FBUF, 0), |
209 | IOCTL_INFO(VIDIOC_S_FBUF, 0), | 211 | IOCTL_INFO(VIDIOC_S_FBUF, INFO_FL_PRIO), |
210 | IOCTL_INFO(VIDIOC_OVERLAY, 0), | 212 | IOCTL_INFO(VIDIOC_OVERLAY, INFO_FL_PRIO), |
211 | IOCTL_INFO(VIDIOC_QBUF, 0), | 213 | IOCTL_INFO(VIDIOC_QBUF, 0), |
212 | IOCTL_INFO(VIDIOC_DQBUF, 0), | 214 | IOCTL_INFO(VIDIOC_DQBUF, 0), |
213 | IOCTL_INFO(VIDIOC_STREAMON, 0), | 215 | IOCTL_INFO(VIDIOC_STREAMON, INFO_FL_PRIO), |
214 | IOCTL_INFO(VIDIOC_STREAMOFF, 0), | 216 | IOCTL_INFO(VIDIOC_STREAMOFF, INFO_FL_PRIO), |
215 | IOCTL_INFO(VIDIOC_G_PARM, 0), | 217 | IOCTL_INFO(VIDIOC_G_PARM, 0), |
216 | IOCTL_INFO(VIDIOC_S_PARM, 0), | 218 | IOCTL_INFO(VIDIOC_S_PARM, INFO_FL_PRIO), |
217 | IOCTL_INFO(VIDIOC_G_STD, 0), | 219 | IOCTL_INFO(VIDIOC_G_STD, 0), |
218 | IOCTL_INFO(VIDIOC_S_STD, 0), | 220 | IOCTL_INFO(VIDIOC_S_STD, INFO_FL_PRIO), |
219 | IOCTL_INFO(VIDIOC_ENUMSTD, 0), | 221 | IOCTL_INFO(VIDIOC_ENUMSTD, 0), |
220 | IOCTL_INFO(VIDIOC_ENUMINPUT, 0), | 222 | IOCTL_INFO(VIDIOC_ENUMINPUT, 0), |
221 | IOCTL_INFO(VIDIOC_G_CTRL, INFO_FL_CTRL), | 223 | IOCTL_INFO(VIDIOC_G_CTRL, INFO_FL_CTRL), |
222 | IOCTL_INFO(VIDIOC_S_CTRL, INFO_FL_CTRL), | 224 | IOCTL_INFO(VIDIOC_S_CTRL, INFO_FL_PRIO | INFO_FL_CTRL), |
223 | IOCTL_INFO(VIDIOC_G_TUNER, 0), | 225 | IOCTL_INFO(VIDIOC_G_TUNER, 0), |
224 | IOCTL_INFO(VIDIOC_S_TUNER, 0), | 226 | IOCTL_INFO(VIDIOC_S_TUNER, INFO_FL_PRIO), |
225 | IOCTL_INFO(VIDIOC_G_AUDIO, 0), | 227 | IOCTL_INFO(VIDIOC_G_AUDIO, 0), |
226 | IOCTL_INFO(VIDIOC_S_AUDIO, 0), | 228 | IOCTL_INFO(VIDIOC_S_AUDIO, INFO_FL_PRIO), |
227 | IOCTL_INFO(VIDIOC_QUERYCTRL, INFO_FL_CTRL), | 229 | IOCTL_INFO(VIDIOC_QUERYCTRL, INFO_FL_CTRL), |
228 | IOCTL_INFO(VIDIOC_QUERYMENU, INFO_FL_CTRL), | 230 | IOCTL_INFO(VIDIOC_QUERYMENU, INFO_FL_CTRL), |
229 | IOCTL_INFO(VIDIOC_G_INPUT, 0), | 231 | IOCTL_INFO(VIDIOC_G_INPUT, 0), |
230 | IOCTL_INFO(VIDIOC_S_INPUT, 0), | 232 | IOCTL_INFO(VIDIOC_S_INPUT, INFO_FL_PRIO), |
231 | IOCTL_INFO(VIDIOC_G_OUTPUT, 0), | 233 | IOCTL_INFO(VIDIOC_G_OUTPUT, 0), |
232 | IOCTL_INFO(VIDIOC_S_OUTPUT, 0), | 234 | IOCTL_INFO(VIDIOC_S_OUTPUT, INFO_FL_PRIO), |
233 | IOCTL_INFO(VIDIOC_ENUMOUTPUT, 0), | 235 | IOCTL_INFO(VIDIOC_ENUMOUTPUT, 0), |
234 | IOCTL_INFO(VIDIOC_G_AUDOUT, 0), | 236 | IOCTL_INFO(VIDIOC_G_AUDOUT, 0), |
235 | IOCTL_INFO(VIDIOC_S_AUDOUT, 0), | 237 | IOCTL_INFO(VIDIOC_S_AUDOUT, INFO_FL_PRIO), |
236 | IOCTL_INFO(VIDIOC_G_MODULATOR, 0), | 238 | IOCTL_INFO(VIDIOC_G_MODULATOR, 0), |
237 | IOCTL_INFO(VIDIOC_S_MODULATOR, 0), | 239 | IOCTL_INFO(VIDIOC_S_MODULATOR, INFO_FL_PRIO), |
238 | IOCTL_INFO(VIDIOC_G_FREQUENCY, 0), | 240 | IOCTL_INFO(VIDIOC_G_FREQUENCY, 0), |
239 | IOCTL_INFO(VIDIOC_S_FREQUENCY, 0), | 241 | IOCTL_INFO(VIDIOC_S_FREQUENCY, INFO_FL_PRIO), |
240 | IOCTL_INFO(VIDIOC_CROPCAP, 0), | 242 | IOCTL_INFO(VIDIOC_CROPCAP, 0), |
241 | IOCTL_INFO(VIDIOC_G_CROP, 0), | 243 | IOCTL_INFO(VIDIOC_G_CROP, 0), |
242 | IOCTL_INFO(VIDIOC_S_CROP, 0), | 244 | IOCTL_INFO(VIDIOC_S_CROP, INFO_FL_PRIO), |
243 | IOCTL_INFO(VIDIOC_G_SELECTION, 0), | 245 | IOCTL_INFO(VIDIOC_G_SELECTION, 0), |
244 | IOCTL_INFO(VIDIOC_S_SELECTION, 0), | 246 | IOCTL_INFO(VIDIOC_S_SELECTION, INFO_FL_PRIO), |
245 | IOCTL_INFO(VIDIOC_G_JPEGCOMP, 0), | 247 | IOCTL_INFO(VIDIOC_G_JPEGCOMP, 0), |
246 | IOCTL_INFO(VIDIOC_S_JPEGCOMP, 0), | 248 | IOCTL_INFO(VIDIOC_S_JPEGCOMP, INFO_FL_PRIO), |
247 | IOCTL_INFO(VIDIOC_QUERYSTD, 0), | 249 | IOCTL_INFO(VIDIOC_QUERYSTD, 0), |
248 | IOCTL_INFO(VIDIOC_TRY_FMT, 0), | 250 | IOCTL_INFO(VIDIOC_TRY_FMT, 0), |
249 | IOCTL_INFO(VIDIOC_ENUMAUDIO, 0), | 251 | IOCTL_INFO(VIDIOC_ENUMAUDIO, 0), |
250 | IOCTL_INFO(VIDIOC_ENUMAUDOUT, 0), | 252 | IOCTL_INFO(VIDIOC_ENUMAUDOUT, 0), |
251 | IOCTL_INFO(VIDIOC_G_PRIORITY, 0), | 253 | IOCTL_INFO(VIDIOC_G_PRIORITY, 0), |
252 | IOCTL_INFO(VIDIOC_S_PRIORITY, 0), | 254 | IOCTL_INFO(VIDIOC_S_PRIORITY, INFO_FL_PRIO), |
253 | IOCTL_INFO(VIDIOC_G_SLICED_VBI_CAP, 0), | 255 | IOCTL_INFO(VIDIOC_G_SLICED_VBI_CAP, 0), |
254 | IOCTL_INFO(VIDIOC_LOG_STATUS, 0), | 256 | IOCTL_INFO(VIDIOC_LOG_STATUS, 0), |
255 | IOCTL_INFO(VIDIOC_G_EXT_CTRLS, INFO_FL_CTRL), | 257 | IOCTL_INFO(VIDIOC_G_EXT_CTRLS, INFO_FL_CTRL), |
256 | IOCTL_INFO(VIDIOC_S_EXT_CTRLS, INFO_FL_CTRL), | 258 | IOCTL_INFO(VIDIOC_S_EXT_CTRLS, INFO_FL_PRIO | INFO_FL_CTRL), |
257 | IOCTL_INFO(VIDIOC_TRY_EXT_CTRLS, 0), | 259 | IOCTL_INFO(VIDIOC_TRY_EXT_CTRLS, 0), |
258 | IOCTL_INFO(VIDIOC_ENUM_FRAMESIZES, 0), | 260 | IOCTL_INFO(VIDIOC_ENUM_FRAMESIZES, 0), |
259 | IOCTL_INFO(VIDIOC_ENUM_FRAMEINTERVALS, 0), | 261 | IOCTL_INFO(VIDIOC_ENUM_FRAMEINTERVALS, 0), |
260 | IOCTL_INFO(VIDIOC_G_ENC_INDEX, 0), | 262 | IOCTL_INFO(VIDIOC_G_ENC_INDEX, 0), |
261 | IOCTL_INFO(VIDIOC_ENCODER_CMD, 0), | 263 | IOCTL_INFO(VIDIOC_ENCODER_CMD, INFO_FL_PRIO), |
262 | IOCTL_INFO(VIDIOC_TRY_ENCODER_CMD, 0), | 264 | IOCTL_INFO(VIDIOC_TRY_ENCODER_CMD, 0), |
263 | IOCTL_INFO(VIDIOC_DECODER_CMD, 0), | 265 | IOCTL_INFO(VIDIOC_DECODER_CMD, INFO_FL_PRIO), |
264 | IOCTL_INFO(VIDIOC_TRY_DECODER_CMD, 0), | 266 | IOCTL_INFO(VIDIOC_TRY_DECODER_CMD, 0), |
267 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
265 | IOCTL_INFO(VIDIOC_DBG_S_REGISTER, 0), | 268 | IOCTL_INFO(VIDIOC_DBG_S_REGISTER, 0), |
266 | IOCTL_INFO(VIDIOC_DBG_G_REGISTER, 0), | 269 | IOCTL_INFO(VIDIOC_DBG_G_REGISTER, 0), |
270 | #endif | ||
267 | IOCTL_INFO(VIDIOC_DBG_G_CHIP_IDENT, 0), | 271 | IOCTL_INFO(VIDIOC_DBG_G_CHIP_IDENT, 0), |
268 | IOCTL_INFO(VIDIOC_S_HW_FREQ_SEEK, 0), | 272 | IOCTL_INFO(VIDIOC_S_HW_FREQ_SEEK, INFO_FL_PRIO), |
269 | IOCTL_INFO(VIDIOC_ENUM_DV_PRESETS, 0), | 273 | IOCTL_INFO(VIDIOC_ENUM_DV_PRESETS, 0), |
270 | IOCTL_INFO(VIDIOC_S_DV_PRESET, 0), | 274 | IOCTL_INFO(VIDIOC_S_DV_PRESET, INFO_FL_PRIO), |
271 | IOCTL_INFO(VIDIOC_G_DV_PRESET, 0), | 275 | IOCTL_INFO(VIDIOC_G_DV_PRESET, 0), |
272 | IOCTL_INFO(VIDIOC_QUERY_DV_PRESET, 0), | 276 | IOCTL_INFO(VIDIOC_QUERY_DV_PRESET, 0), |
273 | IOCTL_INFO(VIDIOC_S_DV_TIMINGS, 0), | 277 | IOCTL_INFO(VIDIOC_S_DV_TIMINGS, INFO_FL_PRIO), |
274 | IOCTL_INFO(VIDIOC_G_DV_TIMINGS, 0), | 278 | IOCTL_INFO(VIDIOC_G_DV_TIMINGS, 0), |
275 | IOCTL_INFO(VIDIOC_DQEVENT, 0), | 279 | IOCTL_INFO(VIDIOC_DQEVENT, 0), |
276 | IOCTL_INFO(VIDIOC_SUBSCRIBE_EVENT, 0), | 280 | IOCTL_INFO(VIDIOC_SUBSCRIBE_EVENT, 0), |
277 | IOCTL_INFO(VIDIOC_UNSUBSCRIBE_EVENT, 0), | 281 | IOCTL_INFO(VIDIOC_UNSUBSCRIBE_EVENT, 0), |
278 | IOCTL_INFO(VIDIOC_CREATE_BUFS, 0), | 282 | IOCTL_INFO(VIDIOC_CREATE_BUFS, INFO_FL_PRIO), |
279 | IOCTL_INFO(VIDIOC_PREPARE_BUF, 0), | 283 | IOCTL_INFO(VIDIOC_PREPARE_BUF, 0), |
280 | }; | 284 | }; |
281 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) | 285 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) |
@@ -509,7 +513,6 @@ static long __video_do_ioctl(struct file *file, | |||
509 | void *fh = file->private_data; | 513 | void *fh = file->private_data; |
510 | struct v4l2_fh *vfh = NULL; | 514 | struct v4l2_fh *vfh = NULL; |
511 | int use_fh_prio = 0; | 515 | int use_fh_prio = 0; |
512 | long ret_prio = 0; | ||
513 | long ret = -ENOTTY; | 516 | long ret = -ENOTTY; |
514 | 517 | ||
515 | if (ops == NULL) { | 518 | if (ops == NULL) { |
@@ -521,8 +524,6 @@ static long __video_do_ioctl(struct file *file, | |||
521 | if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) { | 524 | if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) { |
522 | vfh = file->private_data; | 525 | vfh = file->private_data; |
523 | use_fh_prio = test_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); | 526 | use_fh_prio = test_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); |
524 | if (use_fh_prio) | ||
525 | ret_prio = v4l2_prio_check(vfd->prio, vfh->prio); | ||
526 | } | 527 | } |
527 | 528 | ||
528 | if (v4l2_is_known_ioctl(cmd)) { | 529 | if (v4l2_is_known_ioctl(cmd)) { |
@@ -531,6 +532,12 @@ static long __video_do_ioctl(struct file *file, | |||
531 | if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) && | 532 | if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) && |
532 | !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler)) | 533 | !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler)) |
533 | return -ENOTTY; | 534 | return -ENOTTY; |
535 | |||
536 | if (use_fh_prio && (info->flags & INFO_FL_PRIO)) { | ||
537 | ret = v4l2_prio_check(vfd->prio, vfh->prio); | ||
538 | if (ret) | ||
539 | return ret; | ||
540 | } | ||
534 | } | 541 | } |
535 | 542 | ||
536 | if ((vfd->debug & V4L2_DEBUG_IOCTL) && | 543 | if ((vfd->debug & V4L2_DEBUG_IOCTL) && |
@@ -579,14 +586,11 @@ static long __video_do_ioctl(struct file *file, | |||
579 | { | 586 | { |
580 | enum v4l2_priority *p = arg; | 587 | enum v4l2_priority *p = arg; |
581 | 588 | ||
582 | if (!ops->vidioc_s_priority && !use_fh_prio) | ||
583 | break; | ||
584 | dbgarg(cmd, "setting priority to %d\n", *p); | 589 | dbgarg(cmd, "setting priority to %d\n", *p); |
585 | if (ops->vidioc_s_priority) | 590 | if (ops->vidioc_s_priority) |
586 | ret = ops->vidioc_s_priority(file, fh, *p); | 591 | ret = ops->vidioc_s_priority(file, fh, *p); |
587 | else | 592 | else |
588 | ret = ret_prio ? ret_prio : | 593 | ret = v4l2_prio_change(&vfd->v4l2_dev->prio, |
589 | v4l2_prio_change(&vfd->v4l2_dev->prio, | ||
590 | &vfh->prio, *p); | 594 | &vfh->prio, *p); |
591 | break; | 595 | break; |
592 | } | 596 | } |
@@ -715,10 +719,6 @@ static long __video_do_ioctl(struct file *file, | |||
715 | { | 719 | { |
716 | struct v4l2_format *f = (struct v4l2_format *)arg; | 720 | struct v4l2_format *f = (struct v4l2_format *)arg; |
717 | 721 | ||
718 | if (ret_prio) { | ||
719 | ret = ret_prio; | ||
720 | break; | ||
721 | } | ||
722 | ret = -EINVAL; | 722 | ret = -EINVAL; |
723 | 723 | ||
724 | /* FIXME: Should be one dump per type */ | 724 | /* FIXME: Should be one dump per type */ |
@@ -885,10 +885,6 @@ static long __video_do_ioctl(struct file *file, | |||
885 | { | 885 | { |
886 | struct v4l2_requestbuffers *p = arg; | 886 | struct v4l2_requestbuffers *p = arg; |
887 | 887 | ||
888 | if (ret_prio) { | ||
889 | ret = ret_prio; | ||
890 | break; | ||
891 | } | ||
892 | ret = check_fmt(ops, p->type); | 888 | ret = check_fmt(ops, p->type); |
893 | if (ret) | 889 | if (ret) |
894 | break; | 890 | break; |
@@ -946,10 +942,6 @@ static long __video_do_ioctl(struct file *file, | |||
946 | { | 942 | { |
947 | int *i = arg; | 943 | int *i = arg; |
948 | 944 | ||
949 | if (ret_prio) { | ||
950 | ret = ret_prio; | ||
951 | break; | ||
952 | } | ||
953 | dbgarg(cmd, "value=%d\n", *i); | 945 | dbgarg(cmd, "value=%d\n", *i); |
954 | ret = ops->vidioc_overlay(file, fh, *i); | 946 | ret = ops->vidioc_overlay(file, fh, *i); |
955 | break; | 947 | break; |
@@ -971,10 +963,6 @@ static long __video_do_ioctl(struct file *file, | |||
971 | { | 963 | { |
972 | struct v4l2_framebuffer *p = arg; | 964 | struct v4l2_framebuffer *p = arg; |
973 | 965 | ||
974 | if (ret_prio) { | ||
975 | ret = ret_prio; | ||
976 | break; | ||
977 | } | ||
978 | dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", | 966 | dbgarg(cmd, "capability=0x%x, flags=%d, base=0x%08lx\n", |
979 | p->capability, p->flags, (unsigned long)p->base); | 967 | p->capability, p->flags, (unsigned long)p->base); |
980 | v4l_print_pix_fmt(vfd, &p->fmt); | 968 | v4l_print_pix_fmt(vfd, &p->fmt); |
@@ -985,10 +973,6 @@ static long __video_do_ioctl(struct file *file, | |||
985 | { | 973 | { |
986 | enum v4l2_buf_type i = *(int *)arg; | 974 | enum v4l2_buf_type i = *(int *)arg; |
987 | 975 | ||
988 | if (ret_prio) { | ||
989 | ret = ret_prio; | ||
990 | break; | ||
991 | } | ||
992 | dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); | 976 | dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); |
993 | ret = ops->vidioc_streamon(file, fh, i); | 977 | ret = ops->vidioc_streamon(file, fh, i); |
994 | break; | 978 | break; |
@@ -997,10 +981,6 @@ static long __video_do_ioctl(struct file *file, | |||
997 | { | 981 | { |
998 | enum v4l2_buf_type i = *(int *)arg; | 982 | enum v4l2_buf_type i = *(int *)arg; |
999 | 983 | ||
1000 | if (ret_prio) { | ||
1001 | ret = ret_prio; | ||
1002 | break; | ||
1003 | } | ||
1004 | dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); | 984 | dbgarg(cmd, "type=%s\n", prt_names(i, v4l2_type_names)); |
1005 | ret = ops->vidioc_streamoff(file, fh, i); | 985 | ret = ops->vidioc_streamoff(file, fh, i); |
1006 | break; | 986 | break; |
@@ -1070,10 +1050,6 @@ static long __video_do_ioctl(struct file *file, | |||
1070 | 1050 | ||
1071 | dbgarg(cmd, "std=%08Lx\n", (long long unsigned)*id); | 1051 | dbgarg(cmd, "std=%08Lx\n", (long long unsigned)*id); |
1072 | 1052 | ||
1073 | if (ret_prio) { | ||
1074 | ret = ret_prio; | ||
1075 | break; | ||
1076 | } | ||
1077 | ret = -EINVAL; | 1053 | ret = -EINVAL; |
1078 | norm = (*id) & vfd->tvnorms; | 1054 | norm = (*id) & vfd->tvnorms; |
1079 | if (vfd->tvnorms && !norm) /* Check if std is supported */ | 1055 | if (vfd->tvnorms && !norm) /* Check if std is supported */ |
@@ -1148,10 +1124,6 @@ static long __video_do_ioctl(struct file *file, | |||
1148 | { | 1124 | { |
1149 | unsigned int *i = arg; | 1125 | unsigned int *i = arg; |
1150 | 1126 | ||
1151 | if (ret_prio) { | ||
1152 | ret = ret_prio; | ||
1153 | break; | ||
1154 | } | ||
1155 | dbgarg(cmd, "value=%d\n", *i); | 1127 | dbgarg(cmd, "value=%d\n", *i); |
1156 | ret = ops->vidioc_s_input(file, fh, *i); | 1128 | ret = ops->vidioc_s_input(file, fh, *i); |
1157 | break; | 1129 | break; |
@@ -1197,10 +1169,6 @@ static long __video_do_ioctl(struct file *file, | |||
1197 | { | 1169 | { |
1198 | unsigned int *i = arg; | 1170 | unsigned int *i = arg; |
1199 | 1171 | ||
1200 | if (ret_prio) { | ||
1201 | ret = ret_prio; | ||
1202 | break; | ||
1203 | } | ||
1204 | dbgarg(cmd, "value=%d\n", *i); | 1172 | dbgarg(cmd, "value=%d\n", *i); |
1205 | ret = ops->vidioc_s_output(file, fh, *i); | 1173 | ret = ops->vidioc_s_output(file, fh, *i); |
1206 | break; | 1174 | break; |
@@ -1270,10 +1238,6 @@ static long __video_do_ioctl(struct file *file, | |||
1270 | if (!(vfh && vfh->ctrl_handler) && !vfd->ctrl_handler && | 1238 | if (!(vfh && vfh->ctrl_handler) && !vfd->ctrl_handler && |
1271 | !ops->vidioc_s_ctrl && !ops->vidioc_s_ext_ctrls) | 1239 | !ops->vidioc_s_ctrl && !ops->vidioc_s_ext_ctrls) |
1272 | break; | 1240 | break; |
1273 | if (ret_prio) { | ||
1274 | ret = ret_prio; | ||
1275 | break; | ||
1276 | } | ||
1277 | 1241 | ||
1278 | dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); | 1242 | dbgarg(cmd, "id=0x%x, value=%d\n", p->id, p->value); |
1279 | 1243 | ||
@@ -1329,10 +1293,6 @@ static long __video_do_ioctl(struct file *file, | |||
1329 | if (!(vfh && vfh->ctrl_handler) && !vfd->ctrl_handler && | 1293 | if (!(vfh && vfh->ctrl_handler) && !vfd->ctrl_handler && |
1330 | !ops->vidioc_s_ext_ctrls) | 1294 | !ops->vidioc_s_ext_ctrls) |
1331 | break; | 1295 | break; |
1332 | if (ret_prio) { | ||
1333 | ret = ret_prio; | ||
1334 | break; | ||
1335 | } | ||
1336 | v4l_print_ext_ctrls(cmd, vfd, p, 1); | 1296 | v4l_print_ext_ctrls(cmd, vfd, p, 1); |
1337 | if (vfh && vfh->ctrl_handler) | 1297 | if (vfh && vfh->ctrl_handler) |
1338 | ret = v4l2_s_ext_ctrls(vfh, vfh->ctrl_handler, p); | 1298 | ret = v4l2_s_ext_ctrls(vfh, vfh->ctrl_handler, p); |
@@ -1414,10 +1374,6 @@ static long __video_do_ioctl(struct file *file, | |||
1414 | { | 1374 | { |
1415 | struct v4l2_audio *p = arg; | 1375 | struct v4l2_audio *p = arg; |
1416 | 1376 | ||
1417 | if (ret_prio) { | ||
1418 | ret = ret_prio; | ||
1419 | break; | ||
1420 | } | ||
1421 | dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " | 1377 | dbgarg(cmd, "index=%d, name=%s, capability=0x%x, " |
1422 | "mode=0x%x\n", p->index, p->name, | 1378 | "mode=0x%x\n", p->index, p->name, |
1423 | p->capability, p->mode); | 1379 | p->capability, p->mode); |
@@ -1451,10 +1407,6 @@ static long __video_do_ioctl(struct file *file, | |||
1451 | { | 1407 | { |
1452 | struct v4l2_audioout *p = arg; | 1408 | struct v4l2_audioout *p = arg; |
1453 | 1409 | ||
1454 | if (ret_prio) { | ||
1455 | ret = ret_prio; | ||
1456 | break; | ||
1457 | } | ||
1458 | dbgarg(cmd, "index=%d, name=%s, capability=%d, " | 1410 | dbgarg(cmd, "index=%d, name=%s, capability=%d, " |
1459 | "mode=%d\n", p->index, p->name, | 1411 | "mode=%d\n", p->index, p->name, |
1460 | p->capability, p->mode); | 1412 | p->capability, p->mode); |
@@ -1480,10 +1432,6 @@ static long __video_do_ioctl(struct file *file, | |||
1480 | { | 1432 | { |
1481 | struct v4l2_modulator *p = arg; | 1433 | struct v4l2_modulator *p = arg; |
1482 | 1434 | ||
1483 | if (ret_prio) { | ||
1484 | ret = ret_prio; | ||
1485 | break; | ||
1486 | } | ||
1487 | dbgarg(cmd, "index=%d, name=%s, capability=%d, " | 1435 | dbgarg(cmd, "index=%d, name=%s, capability=%d, " |
1488 | "rangelow=%d, rangehigh=%d, txsubchans=%d\n", | 1436 | "rangelow=%d, rangehigh=%d, txsubchans=%d\n", |
1489 | p->index, p->name, p->capability, p->rangelow, | 1437 | p->index, p->name, p->capability, p->rangelow, |
@@ -1526,10 +1474,6 @@ static long __video_do_ioctl(struct file *file, | |||
1526 | { | 1474 | { |
1527 | struct v4l2_crop *p = arg; | 1475 | struct v4l2_crop *p = arg; |
1528 | 1476 | ||
1529 | if (ret_prio) { | ||
1530 | ret = ret_prio; | ||
1531 | break; | ||
1532 | } | ||
1533 | dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); | 1477 | dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); |
1534 | dbgrect(vfd, "", &p->c); | 1478 | dbgrect(vfd, "", &p->c); |
1535 | 1479 | ||
@@ -1567,10 +1511,6 @@ static long __video_do_ioctl(struct file *file, | |||
1567 | { | 1511 | { |
1568 | struct v4l2_selection *p = arg; | 1512 | struct v4l2_selection *p = arg; |
1569 | 1513 | ||
1570 | if (ret_prio) { | ||
1571 | ret = ret_prio; | ||
1572 | break; | ||
1573 | } | ||
1574 | 1514 | ||
1575 | dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); | 1515 | dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); |
1576 | dbgrect(vfd, "", &p->r); | 1516 | dbgrect(vfd, "", &p->r); |
@@ -1639,10 +1579,6 @@ static long __video_do_ioctl(struct file *file, | |||
1639 | { | 1579 | { |
1640 | struct v4l2_jpegcompression *p = arg; | 1580 | struct v4l2_jpegcompression *p = arg; |
1641 | 1581 | ||
1642 | if (ret_prio) { | ||
1643 | ret = ret_prio; | ||
1644 | break; | ||
1645 | } | ||
1646 | dbgarg(cmd, "quality=%d, APPn=%d, APP_len=%d, " | 1582 | dbgarg(cmd, "quality=%d, APPn=%d, APP_len=%d, " |
1647 | "COM_len=%d, jpeg_markers=%d\n", | 1583 | "COM_len=%d, jpeg_markers=%d\n", |
1648 | p->quality, p->APPn, p->APP_len, | 1584 | p->quality, p->APPn, p->APP_len, |
@@ -1664,10 +1600,6 @@ static long __video_do_ioctl(struct file *file, | |||
1664 | { | 1600 | { |
1665 | struct v4l2_encoder_cmd *p = arg; | 1601 | struct v4l2_encoder_cmd *p = arg; |
1666 | 1602 | ||
1667 | if (ret_prio) { | ||
1668 | ret = ret_prio; | ||
1669 | break; | ||
1670 | } | ||
1671 | ret = ops->vidioc_encoder_cmd(file, fh, p); | 1603 | ret = ops->vidioc_encoder_cmd(file, fh, p); |
1672 | if (!ret) | 1604 | if (!ret) |
1673 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); | 1605 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); |
@@ -1686,10 +1618,6 @@ static long __video_do_ioctl(struct file *file, | |||
1686 | { | 1618 | { |
1687 | struct v4l2_decoder_cmd *p = arg; | 1619 | struct v4l2_decoder_cmd *p = arg; |
1688 | 1620 | ||
1689 | if (ret_prio) { | ||
1690 | ret = ret_prio; | ||
1691 | break; | ||
1692 | } | ||
1693 | ret = ops->vidioc_decoder_cmd(file, fh, p); | 1621 | ret = ops->vidioc_decoder_cmd(file, fh, p); |
1694 | if (!ret) | 1622 | if (!ret) |
1695 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); | 1623 | dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags); |
@@ -1735,10 +1663,6 @@ static long __video_do_ioctl(struct file *file, | |||
1735 | { | 1663 | { |
1736 | struct v4l2_streamparm *p = arg; | 1664 | struct v4l2_streamparm *p = arg; |
1737 | 1665 | ||
1738 | if (ret_prio) { | ||
1739 | ret = ret_prio; | ||
1740 | break; | ||
1741 | } | ||
1742 | ret = check_fmt(ops, p->type); | 1666 | ret = check_fmt(ops, p->type); |
1743 | if (ret) | 1667 | if (ret) |
1744 | break; | 1668 | break; |
@@ -1769,10 +1693,6 @@ static long __video_do_ioctl(struct file *file, | |||
1769 | { | 1693 | { |
1770 | struct v4l2_tuner *p = arg; | 1694 | struct v4l2_tuner *p = arg; |
1771 | 1695 | ||
1772 | if (ret_prio) { | ||
1773 | ret = ret_prio; | ||
1774 | break; | ||
1775 | } | ||
1776 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | 1696 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? |
1777 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | 1697 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1778 | dbgarg(cmd, "index=%d, name=%s, type=%d, " | 1698 | dbgarg(cmd, "index=%d, name=%s, type=%d, " |
@@ -1803,10 +1723,6 @@ static long __video_do_ioctl(struct file *file, | |||
1803 | struct v4l2_frequency *p = arg; | 1723 | struct v4l2_frequency *p = arg; |
1804 | enum v4l2_tuner_type type; | 1724 | enum v4l2_tuner_type type; |
1805 | 1725 | ||
1806 | if (ret_prio) { | ||
1807 | ret = ret_prio; | ||
1808 | break; | ||
1809 | } | ||
1810 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | 1726 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? |
1811 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | 1727 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1812 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", | 1728 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", |
@@ -1881,10 +1797,6 @@ static long __video_do_ioctl(struct file *file, | |||
1881 | struct v4l2_hw_freq_seek *p = arg; | 1797 | struct v4l2_hw_freq_seek *p = arg; |
1882 | enum v4l2_tuner_type type; | 1798 | enum v4l2_tuner_type type; |
1883 | 1799 | ||
1884 | if (ret_prio) { | ||
1885 | ret = ret_prio; | ||
1886 | break; | ||
1887 | } | ||
1888 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | 1800 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? |
1889 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | 1801 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1890 | dbgarg(cmd, | 1802 | dbgarg(cmd, |
@@ -1978,11 +1890,6 @@ static long __video_do_ioctl(struct file *file, | |||
1978 | { | 1890 | { |
1979 | struct v4l2_dv_preset *p = arg; | 1891 | struct v4l2_dv_preset *p = arg; |
1980 | 1892 | ||
1981 | if (ret_prio) { | ||
1982 | ret = ret_prio; | ||
1983 | break; | ||
1984 | } | ||
1985 | |||
1986 | dbgarg(cmd, "preset=%d\n", p->preset); | 1893 | dbgarg(cmd, "preset=%d\n", p->preset); |
1987 | ret = ops->vidioc_s_dv_preset(file, fh, p); | 1894 | ret = ops->vidioc_s_dv_preset(file, fh, p); |
1988 | break; | 1895 | break; |
@@ -2009,11 +1916,6 @@ static long __video_do_ioctl(struct file *file, | |||
2009 | { | 1916 | { |
2010 | struct v4l2_dv_timings *p = arg; | 1917 | struct v4l2_dv_timings *p = arg; |
2011 | 1918 | ||
2012 | if (ret_prio) { | ||
2013 | ret = ret_prio; | ||
2014 | break; | ||
2015 | } | ||
2016 | |||
2017 | switch (p->type) { | 1919 | switch (p->type) { |
2018 | case V4L2_DV_BT_656_1120: | 1920 | case V4L2_DV_BT_656_1120: |
2019 | dbgarg2("bt-656/1120:interlaced=%d, pixelclock=%lld," | 1921 | dbgarg2("bt-656/1120:interlaced=%d, pixelclock=%lld," |
@@ -2112,10 +2014,6 @@ static long __video_do_ioctl(struct file *file, | |||
2112 | { | 2014 | { |
2113 | struct v4l2_create_buffers *create = arg; | 2015 | struct v4l2_create_buffers *create = arg; |
2114 | 2016 | ||
2115 | if (ret_prio) { | ||
2116 | ret = ret_prio; | ||
2117 | break; | ||
2118 | } | ||
2119 | ret = check_fmt(ops, create->format.type); | 2017 | ret = check_fmt(ops, create->format.type); |
2120 | if (ret) | 2018 | if (ret) |
2121 | break; | 2019 | break; |
@@ -2141,7 +2039,9 @@ static long __video_do_ioctl(struct file *file, | |||
2141 | default: | 2039 | default: |
2142 | if (!ops->vidioc_default) | 2040 | if (!ops->vidioc_default) |
2143 | break; | 2041 | break; |
2144 | ret = ops->vidioc_default(file, fh, ret_prio >= 0, cmd, arg); | 2042 | ret = ops->vidioc_default(file, fh, use_fh_prio ? |
2043 | v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0, | ||
2044 | cmd, arg); | ||
2145 | break; | 2045 | break; |
2146 | } /* switch */ | 2046 | } /* switch */ |
2147 | 2047 | ||