New IOCTL ops: vidioc_enum_fmt_sdr_out vidioc_g_fmt_sdr_out vidioc_s_fmt_sdr_out vidioc_try_fmt_sdr_out New vb2 buffertype: V4L2_BUF_TYPE_SDR_OUTPUT New v4l2 capability: V4L2_CAP_SDR_OUTPUT
Unified · Split
| @@ -214,6 +214,7 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us · 213 unmodified lines | |||
| 214 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: | 214 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: |
| 215 | return get_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); | 215 | return get_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); |
| 216 | case V4L2_BUF_TYPE_SDR_CAPTURE: | 216 | case V4L2_BUF_TYPE_SDR_CAPTURE: |
| 217 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 217 | return get_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); | 218 | return get_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); |
| 218 | default: | 219 | default: |
| 219 | pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", | 220 | pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", |
| @@ -260,6 +261,7 @@ static int __put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us · 40 unmodified lines | |||
| 260 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: | 261 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: |
| 261 | return put_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); | 262 | return put_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); |
| 262 | case V4L2_BUF_TYPE_SDR_CAPTURE: | 263 | case V4L2_BUF_TYPE_SDR_CAPTURE: |
| 264 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 263 | return put_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); | 265 | return put_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); |
| 264 | default: | 266 | default: |
| 265 | pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", | 267 | pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", |
| @@ -637,8 +637,8 @@ static void determine_valid_ioctls(struct video_device *vdev) · 636 unmodified lines | |||
| 637 | ops->vidioc_try_fmt_sliced_vbi_out))) | 637 | ops->vidioc_try_fmt_sliced_vbi_out))) |
| 638 | set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); | 638 | set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); |
| 639 | SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, vidioc_g_sliced_vbi_cap); | 639 | SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, vidioc_g_sliced_vbi_cap); |
| 640 | } else if (is_sdr) { | 640 | } else if (is_sdr && is_rx) { |
| 641 | /* SDR specific ioctls */ | 641 | /* SDR receiver specific ioctls */ |
| 642 | if (ops->vidioc_enum_fmt_sdr_cap) | 642 | if (ops->vidioc_enum_fmt_sdr_cap) |
| 643 | set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls); | 643 | set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls); |
| 644 | if (ops->vidioc_g_fmt_sdr_cap) | 644 | if (ops->vidioc_g_fmt_sdr_cap) |
| @@ -647,6 +647,16 @@ static void determine_valid_ioctls(struct video_device *vdev) · 2 unmodified lines | |||
| 647 | set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls); | 647 | set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls); |
| 648 | if (ops->vidioc_try_fmt_sdr_cap) | 648 | if (ops->vidioc_try_fmt_sdr_cap) |
| 649 | set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); | 649 | set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); |
| 650 | } else if (is_sdr && is_tx) { | ||
| 651 | /* SDR transmitter specific ioctls */ | ||
| 652 | if (ops->vidioc_enum_fmt_sdr_out) | ||
| 653 | set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls); | ||
| 654 | if (ops->vidioc_g_fmt_sdr_out) | ||
| 655 | set_bit(_IOC_NR(VIDIOC_G_FMT), valid_ioctls); | ||
| 656 | if (ops->vidioc_s_fmt_sdr_out) | ||
| 657 | set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls); | ||
| 658 | if (ops->vidioc_try_fmt_sdr_out) | ||
| 659 | set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls); | ||
| 650 | } | 660 | } |
| 651 | 661 | ||
| 652 | if (is_vid || is_vbi || is_sdr) { | 662 | if (is_vid || is_vbi || is_sdr) { |
| @@ -153,6 +153,7 @@ const char *v4l2_type_names[] = { · 152 unmodified lines | |||
| 153 | [V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE] = "vid-cap-mplane", | 153 | [V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE] = "vid-cap-mplane", |
| 154 | [V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE] = "vid-out-mplane", | 154 | [V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE] = "vid-out-mplane", |
| 155 | [V4L2_BUF_TYPE_SDR_CAPTURE] = "sdr-cap", | 155 | [V4L2_BUF_TYPE_SDR_CAPTURE] = "sdr-cap", |
| 156 | [V4L2_BUF_TYPE_SDR_OUTPUT] = "sdr-out", | ||
| 156 | }; | 157 | }; |
| 157 | EXPORT_SYMBOL(v4l2_type_names); | 158 | EXPORT_SYMBOL(v4l2_type_names); |
| 158 | 159 | ||
| @@ -326,6 +327,7 @@ static void v4l_print_format(const void *arg, bool write_only) · 167 unmodified lines | |||
| 326 | sliced->service_lines[1][i]); | 327 | sliced->service_lines[1][i]); |
| 327 | break; | 328 | break; |
| 328 | case V4L2_BUF_TYPE_SDR_CAPTURE: | 329 | case V4L2_BUF_TYPE_SDR_CAPTURE: |
| 330 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 329 | sdr = &p->fmt.sdr; | 331 | sdr = &p->fmt.sdr; |
| 330 | pr_cont(", pixelformat=%c%c%c%c\n", | 332 | pr_cont(", pixelformat=%c%c%c%c\n", |
| 331 | (sdr->pixelformat >> 0) & 0xff, | 333 | (sdr->pixelformat >> 0) & 0xff, |
| @@ -974,6 +976,10 @@ static int check_fmt(struct file *file, enum v4l2_buf_type type) · 642 unmodified lines | |||
| 974 | if (is_sdr && is_rx && ops->vidioc_g_fmt_sdr_cap) | 976 | if (is_sdr && is_rx && ops->vidioc_g_fmt_sdr_cap) |
| 975 | return 0; | 977 | return 0; |
| 976 | break; | 978 | break; |
| 979 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 980 | if (is_sdr && is_tx && ops->vidioc_g_fmt_sdr_out) | ||
| 981 | return 0; | ||
| 982 | break; | ||
| 977 | default: | 983 | default: |
| 978 | break; | 984 | break; |
| 979 | } | 985 | } |
| @@ -1324,6 +1330,11 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops, · 344 unmodified lines | |||
| 1324 | break; | 1330 | break; |
| 1325 | ret = ops->vidioc_enum_fmt_sdr_cap(file, fh, arg); | 1331 | ret = ops->vidioc_enum_fmt_sdr_cap(file, fh, arg); |
| 1326 | break; | 1332 | break; |
| 1333 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 1334 | if (unlikely(!is_tx || !is_sdr || !ops->vidioc_enum_fmt_sdr_out)) | ||
| 1335 | break; | ||
| 1336 | ret = ops->vidioc_enum_fmt_sdr_out(file, fh, arg); | ||
| 1337 | break; | ||
| 1327 | } | 1338 | } |
| 1328 | if (ret == 0) | 1339 | if (ret == 0) |
| 1329 | v4l_fill_fmtdesc(p); | 1340 | v4l_fill_fmtdesc(p); |
| @@ -1418,6 +1429,10 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops, · 88 unmodified lines | |||
| 1418 | if (unlikely(!is_rx || !is_sdr || !ops->vidioc_g_fmt_sdr_cap)) | 1429 | if (unlikely(!is_rx || !is_sdr || !ops->vidioc_g_fmt_sdr_cap)) |
| 1419 | break; | 1430 | break; |
| 1420 | return ops->vidioc_g_fmt_sdr_cap(file, fh, arg); | 1431 | return ops->vidioc_g_fmt_sdr_cap(file, fh, arg); |
| 1432 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 1433 | if (unlikely(!is_tx || !is_sdr || !ops->vidioc_g_fmt_sdr_out)) | ||
| 1434 | break; | ||
| 1435 | return ops->vidioc_g_fmt_sdr_out(file, fh, arg); | ||
| 1421 | } | 1436 | } |
| 1422 | return -EINVAL; | 1437 | return -EINVAL; |
| 1423 | } | 1438 | } |
| @@ -1497,6 +1512,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, · 73 unmodified lines | |||
| 1497 | break; | 1512 | break; |
| 1498 | CLEAR_AFTER_FIELD(p, fmt.sdr); | 1513 | CLEAR_AFTER_FIELD(p, fmt.sdr); |
| 1499 | return ops->vidioc_s_fmt_sdr_cap(file, fh, arg); | 1514 | return ops->vidioc_s_fmt_sdr_cap(file, fh, arg); |
| 1515 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 1516 | if (unlikely(!is_tx || !is_sdr || !ops->vidioc_s_fmt_sdr_out)) | ||
| 1517 | break; | ||
| 1518 | CLEAR_AFTER_FIELD(p, fmt.sdr); | ||
| 1519 | return ops->vidioc_s_fmt_sdr_out(file, fh, arg); | ||
| 1500 | } | 1520 | } |
| 1501 | return -EINVAL; | 1521 | return -EINVAL; |
| 1502 | } | 1522 | } |
| @@ -1576,6 +1596,11 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, · 73 unmodified lines | |||
| 1576 | break; | 1596 | break; |
| 1577 | CLEAR_AFTER_FIELD(p, fmt.sdr); | 1597 | CLEAR_AFTER_FIELD(p, fmt.sdr); |
| 1578 | return ops->vidioc_try_fmt_sdr_cap(file, fh, arg); | 1598 | return ops->vidioc_try_fmt_sdr_cap(file, fh, arg); |
| 1599 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 1600 | if (unlikely(!is_tx || !is_sdr || !ops->vidioc_try_fmt_sdr_out)) | ||
| 1601 | break; | ||
| 1602 | CLEAR_AFTER_FIELD(p, fmt.sdr); | ||
| 1603 | return ops->vidioc_try_fmt_sdr_out(file, fh, arg); | ||
| 1579 | } | 1604 | } |
| 1580 | return -EINVAL; | 1605 | return -EINVAL; |
| 1581 | } | 1606 | } |
| @@ -576,7 +576,8 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) · 575 unmodified lines | |||
| 576 | } | 576 | } |
| 577 | if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT | 577 | if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT |
| 578 | || q->type == V4L2_BUF_TYPE_VBI_OUTPUT | 578 | || q->type == V4L2_BUF_TYPE_VBI_OUTPUT |
| 579 | || q->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { | 579 | || q->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT |
| 580 | || q->type == V4L2_BUF_TYPE_SDR_OUTPUT) { | ||
| 580 | buf->size = b->bytesused; | 581 | buf->size = b->bytesused; |
| 581 | buf->field = b->field; | 582 | buf->field = b->field; |
| 582 | buf->ts = b->timestamp; | 583 | buf->ts = b->timestamp; |
| @@ -1154,6 +1155,7 @@ unsigned int videobuf_poll_stream(struct file *file, · 571 unmodified lines | |||
| 1154 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: | 1155 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: |
| 1155 | case V4L2_BUF_TYPE_VBI_OUTPUT: | 1156 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
| 1156 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: | 1157 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: |
| 1158 | case V4L2_BUF_TYPE_SDR_OUTPUT: | ||
| 1157 | rc = POLLOUT | POLLWRNORM; | 1159 | rc = POLLOUT | POLLWRNORM; |
| 1158 | break; | 1160 | break; |
| 1159 | default: | 1161 | default: |
| @@ -36,6 +36,8 @@ struct v4l2_ioctl_ops { · 35 unmodified lines | |||
| 36 | struct v4l2_fmtdesc *f); | 36 | struct v4l2_fmtdesc *f); |
| 37 | int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh, | 37 | int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh, |
| 38 | struct v4l2_fmtdesc *f); | 38 | struct v4l2_fmtdesc *f); |
| 39 | int (*vidioc_enum_fmt_sdr_out) (struct file *file, void *fh, | ||
| 40 | struct v4l2_fmtdesc *f); | ||
| 39 | 41 | ||
| 40 | /* VIDIOC_G_FMT handlers */ | 42 | /* VIDIOC_G_FMT handlers */ |
| 41 | int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, | 43 | int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -60,6 +62,8 @@ struct v4l2_ioctl_ops { · 18 unmodified lines | |||
| 60 | struct v4l2_format *f); | 62 | struct v4l2_format *f); |
| 61 | int (*vidioc_g_fmt_sdr_cap) (struct file *file, void *fh, | 63 | int (*vidioc_g_fmt_sdr_cap) (struct file *file, void *fh, |
| 62 | struct v4l2_format *f); | 64 | struct v4l2_format *f); |
| 65 | int (*vidioc_g_fmt_sdr_out) (struct file *file, void *fh, | ||
| 66 | struct v4l2_format *f); | ||
| 63 | 67 | ||
| 64 | /* VIDIOC_S_FMT handlers */ | 68 | /* VIDIOC_S_FMT handlers */ |
| 65 | int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, | 69 | int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -84,6 +88,8 @@ struct v4l2_ioctl_ops { · 18 unmodified lines | |||
| 84 | struct v4l2_format *f); | 88 | struct v4l2_format *f); |
| 85 | int (*vidioc_s_fmt_sdr_cap) (struct file *file, void *fh, | 89 | int (*vidioc_s_fmt_sdr_cap) (struct file *file, void *fh, |
| 86 | struct v4l2_format *f); | 90 | struct v4l2_format *f); |
| 91 | int (*vidioc_s_fmt_sdr_out) (struct file *file, void *fh, | ||
| 92 | struct v4l2_format *f); | ||
| 87 | 93 | ||
| 88 | /* VIDIOC_TRY_FMT handlers */ | 94 | /* VIDIOC_TRY_FMT handlers */ |
| 89 | int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, | 95 | int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -108,6 +114,8 @@ struct v4l2_ioctl_ops { · 18 unmodified lines | |||
| 108 | struct v4l2_format *f); | 114 | struct v4l2_format *f); |
| 109 | int (*vidioc_try_fmt_sdr_cap) (struct file *file, void *fh, | 115 | int (*vidioc_try_fmt_sdr_cap) (struct file *file, void *fh, |
| 110 | struct v4l2_format *f); | 116 | struct v4l2_format *f); |
| 117 | int (*vidioc_try_fmt_sdr_out) (struct file *file, void *fh, | ||
| 118 | struct v4l2_format *f); | ||
| 111 | 119 | ||
| 112 | /* Buffer handlers */ | 120 | /* Buffer handlers */ |
| 113 | int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); | 121 | int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | |||
| 28 | EM( V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" ) \ | 28 | EM( V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" ) \ |
| 29 | EM( V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" ) \ | 29 | EM( V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" ) \ |
| 30 | EM( V4L2_BUF_TYPE_SDR_CAPTURE, "SDR_CAPTURE" ) \ | 30 | EM( V4L2_BUF_TYPE_SDR_CAPTURE, "SDR_CAPTURE" ) \ |
| 31 | EM( V4L2_BUF_TYPE_SDR_OUTPUT, "SDR_OUTPUT" ) \ | ||
| 31 | EMe(V4L2_BUF_TYPE_PRIVATE, "PRIVATE" ) | 32 | EMe(V4L2_BUF_TYPE_PRIVATE, "PRIVATE" ) |
| 32 | 33 | ||
| 33 | SHOW_TYPE | 34 | SHOW_TYPE |
| @@ -145,6 +145,7 @@ enum v4l2_buf_type { · 144 unmodified lines | |||
| 145 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, | 145 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, |
| 146 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, | 146 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, |
| 147 | V4L2_BUF_TYPE_SDR_CAPTURE = 11, | 147 | V4L2_BUF_TYPE_SDR_CAPTURE = 11, |
| 148 | V4L2_BUF_TYPE_SDR_OUTPUT = 12, | ||
| 148 | /* Deprecated, do not use */ | 149 | /* Deprecated, do not use */ |
| 149 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 150 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
| 150 | }; | 151 | }; |
| @@ -159,7 +160,8 @@ enum v4l2_buf_type { · 8 unmodified lines | |||
| 159 | || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \ | 160 | || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \ |
| 160 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ | 161 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ |
| 161 | || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ | 162 | || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ |
| 162 | || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) | 163 | || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \ |
| 164 | || (type) == V4L2_BUF_TYPE_SDR_OUTPUT) | ||
| 163 | 165 | ||
| 164 | enum v4l2_tuner_type { | 166 | enum v4l2_tuner_type { |
| 165 | V4L2_TUNER_RADIO = 1, | 167 | V4L2_TUNER_RADIO = 1, |
| @@ -435,6 +437,7 @@ struct v4l2_capability { · 269 unmodified lines | |||
| 435 | 437 | ||
| 436 | #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ | 438 | #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ |
| 437 | #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000 /* Supports the extended pixel format */ | 439 | #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000 /* Supports the extended pixel format */ |
| 440 | #define V4L2_CAP_SDR_OUTPUT 0x00400000 /* Is a SDR output device */ | ||
| 438 | 441 | ||
| 439 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 442 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| 440 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 443 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |