Validate the pad field in the core code whenever specified.
Unified · Split
| @@ -1,11 +1,12 @@ | ||
| 1 | 1 | <refentry id="vidioc-dv-timings-cap"> |
| 2 | 2 | <refmeta> |
| 3 | − <refentrytitle>ioctl VIDIOC_DV_TIMINGS_CAP</refentrytitle> | |
| 3 | + <refentrytitle>ioctl VIDIOC_DV_TIMINGS_CAP, VIDIOC_SUBDEV_DV_TIMINGS_CAP</refentrytitle> | |
| 4 | 4 | &manvol; |
| 5 | 5 | </refmeta> |
| 6 | 6 | |
| 7 | 7 | <refnamediv> |
| 8 | 8 | <refname>VIDIOC_DV_TIMINGS_CAP</refname> |
| 9 | + <refname>VIDIOC_SUBDEV_DV_TIMINGS_CAP</refname> | |
| 9 | 10 | <refpurpose>The capabilities of the Digital Video receiver/transmitter</refpurpose> |
| 10 | 11 | </refnamediv> |
| 11 | 12 | |
| @@ -33,7 +34,7 @@ · 21 unmodified lines | ||
| 33 | 34 | <varlistentry> |
| 34 | 35 | <term><parameter>request</parameter></term> |
| 35 | 36 | <listitem> |
| 36 | − <para>VIDIOC_DV_TIMINGS_CAP</para> | |
| 37 | + <para>VIDIOC_DV_TIMINGS_CAP, VIDIOC_SUBDEV_DV_TIMINGS_CAP</para> | |
| 37 | 38 | </listitem> |
| 38 | 39 | </varlistentry> |
| 39 | 40 | <varlistentry> |
| @@ -54,10 +55,19 @@ · 14 unmodified lines | ||
| 54 | 55 | interface and may change in the future.</para> |
| 55 | 56 | </note> |
| 56 | 57 | |
| 57 | − <para>To query the capabilities of the DV receiver/transmitter applications can call | |
| 58 | −this ioctl and the driver will fill in the structure. Note that drivers may return | |
| 58 | + <para>To query the capabilities of the DV receiver/transmitter applications | |
| 59 | +can call the <constant>VIDIOC_DV_TIMINGS_CAP</constant> ioctl on a video node | |
| 60 | +and the driver will fill in the structure. Note that drivers may return | |
| 59 | 61 | different values after switching the video input or output.</para> |
| 60 | 62 | |
| 63 | + <para>When implemented by the driver DV capabilities of subdevices can be | |
| 64 | +queried by calling the <constant>VIDIOC_SUBDEV_DV_TIMINGS_CAP</constant> ioctl | |
| 65 | +directly on a subdevice node. The capabilities are specific to inputs (for DV | |
| 66 | +receivers) or outputs (for DV transmitters), applications must specify the | |
| 67 | +desired pad number in the &v4l2-dv-timings-cap; <structfield>pad</structfield> | |
| 68 | +field. Attempts to query capabilities on a pad that doesn't support them will | |
| 69 | +return an &EINVAL;.</para> | |
| 70 | + | |
| 61 | 71 | <table pgwide="1" frame="none" id="v4l2-bt-timings-cap"> |
| 62 | 72 | <title>struct <structname>v4l2_bt_timings_cap</structname></title> |
| 63 | 73 | <tgroup cols="3"> |
| @@ -127,7 +137,14 @@ different values after switching the video input or output.</para> · 63 unmodified lines | ||
| 127 | 137 | </row> |
| 128 | 138 | <row> |
| 129 | 139 | <entry>__u32</entry> |
| 130 | − <entry><structfield>reserved</structfield>[3]</entry> | |
| 140 | + <entry><structfield>pad</structfield></entry> | |
| 141 | + <entry>Pad number as reported by the media controller API. This field | |
| 142 | + is only used when operating on a subdevice node. When operating on a | |
| 143 | + video node applications must set this field to zero.</entry> | |
| 144 | + </row> | |
| 145 | + <row> | |
| 146 | + <entry>__u32</entry> | |
| 147 | + <entry><structfield>reserved</structfield>[2]</entry> | |
| 131 | 148 | <entry>Reserved for future extensions. Drivers must set the array to zero.</entry> |
| 132 | 149 | </row> |
| 133 | 150 | <row> |
| @@ -1,11 +1,12 @@ | ||
| 1 | 1 | <refentry id="vidioc-enum-dv-timings"> |
| 2 | 2 | <refmeta> |
| 3 | − <refentrytitle>ioctl VIDIOC_ENUM_DV_TIMINGS</refentrytitle> | |
| 3 | + <refentrytitle>ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS</refentrytitle> | |
| 4 | 4 | &manvol; |
| 5 | 5 | </refmeta> |
| 6 | 6 | |
| 7 | 7 | <refnamediv> |
| 8 | 8 | <refname>VIDIOC_ENUM_DV_TIMINGS</refname> |
| 9 | + <refname>VIDIOC_SUBDEV_ENUM_DV_TIMINGS</refname> | |
| 9 | 10 | <refpurpose>Enumerate supported Digital Video timings</refpurpose> |
| 10 | 11 | </refnamediv> |
| 11 | 12 | |
| @@ -33,7 +34,7 @@ · 21 unmodified lines | ||
| 33 | 34 | <varlistentry> |
| 34 | 35 | <term><parameter>request</parameter></term> |
| 35 | 36 | <listitem> |
| 36 | − <para>VIDIOC_ENUM_DV_TIMINGS</para> | |
| 37 | + <para>VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS</para> | |
| 37 | 38 | </listitem> |
| 38 | 39 | </varlistentry> |
| 39 | 40 | <varlistentry> |
| @@ -61,14 +62,21 @@ standards or even custom timings that are not in this list.</para> · 21 unmodified lines | ||
| 61 | 62 | |
| 62 | 63 | <para>To query the available timings, applications initialize the |
| 63 | 64 | <structfield>index</structfield> field and zero the reserved array of &v4l2-enum-dv-timings; |
| 64 | −and call the <constant>VIDIOC_ENUM_DV_TIMINGS</constant> ioctl with a pointer to this | |
| 65 | −structure. Drivers fill the rest of the structure or return an | |
| 65 | +and call the <constant>VIDIOC_ENUM_DV_TIMINGS</constant> ioctl on a video node with a | |
| 66 | +pointer to this structure. Drivers fill the rest of the structure or return an | |
| 66 | 67 | &EINVAL; when the index is out of bounds. To enumerate all supported DV timings, |
| 67 | 68 | applications shall begin at index zero, incrementing by one until the |
| 68 | 69 | driver returns <errorcode>EINVAL</errorcode>. Note that drivers may enumerate a |
| 69 | 70 | different set of DV timings after switching the video input or |
| 70 | 71 | output.</para> |
| 71 | 72 | |
| 73 | + <para>When implemented by the driver DV timings of subdevices can be queried | |
| 74 | +by calling the <constant>VIDIOC_SUBDEV_ENUM_DV_TIMINGS</constant> ioctl directly | |
| 75 | +on a subdevice node. The DV timings are specific to inputs (for DV receivers) or | |
| 76 | +outputs (for DV transmitters), applications must specify the desired pad number | |
| 77 | +in the &v4l2-enum-dv-timings; <structfield>pad</structfield> field. Attempts to | |
| 78 | +enumerate timings on a pad that doesn't support them will return an &EINVAL;.</para> | |
| 79 | + | |
| 72 | 80 | <table pgwide="1" frame="none" id="v4l2-enum-dv-timings"> |
| 73 | 81 | <title>struct <structname>v4l2_enum_dv_timings</structname></title> |
| 74 | 82 | <tgroup cols="3"> |
| @@ -82,8 +90,16 @@ application.</entry> · 7 unmodified lines | ||
| 82 | 90 | </row> |
| 83 | 91 | <row> |
| 84 | 92 | <entry>__u32</entry> |
| 85 | − <entry><structfield>reserved</structfield>[3]</entry> | |
| 86 | − <entry>Reserved for future extensions. Drivers must set the array to zero.</entry> | |
| 93 | + <entry><structfield>pad</structfield></entry> | |
| 94 | + <entry>Pad number as reported by the media controller API. This field | |
| 95 | + is only used when operating on a subdevice node. When operating on a | |
| 96 | + video node applications must set this field to zero.</entry> | |
| 97 | + </row> | |
| 98 | + <row> | |
| 99 | + <entry>__u32</entry> | |
| 100 | + <entry><structfield>reserved</structfield>[2]</entry> | |
| 101 | + <entry>Reserved for future extensions. Drivers and applications must | |
| 102 | + set the array to zero.</entry> | |
| 87 | 103 | </row> |
| 88 | 104 | <row> |
| 89 | 105 | <entry>&v4l2-dv-timings;</entry> |
| @@ -103,7 +119,7 @@ application.</entry> · 13 unmodified lines | ||
| 103 | 119 | <term><errorcode>EINVAL</errorcode></term> |
| 104 | 120 | <listitem> |
| 105 | 121 | <para>The &v4l2-enum-dv-timings; <structfield>index</structfield> |
| 106 | −is out of bounds.</para> | |
| 122 | +is out of bounds or the <structfield>pad</structfield> number is invalid.</para> | |
| 107 | 123 | </listitem> |
| 108 | 124 | </varlistentry> |
| 109 | 125 | <varlistentry> |
| @@ -366,6 +366,33 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) · 365 unmodified lines | ||
| 366 | 366 | |
| 367 | 367 | case VIDIOC_S_EDID: |
| 368 | 368 | return v4l2_subdev_call(sd, pad, set_edid, arg); |
| 369 | + | |
| 370 | + case VIDIOC_SUBDEV_DV_TIMINGS_CAP: { | |
| 371 | + struct v4l2_dv_timings_cap *cap = arg; | |
| 372 | + | |
| 373 | + if (cap->pad >= sd->entity.num_pads) | |
| 374 | + return -EINVAL; | |
| 375 | + | |
| 376 | + return v4l2_subdev_call(sd, pad, dv_timings_cap, cap); | |
| 377 | + } | |
| 378 | + | |
| 379 | + case VIDIOC_SUBDEV_ENUM_DV_TIMINGS: { | |
| 380 | + struct v4l2_enum_dv_timings *dvt = arg; | |
| 381 | + | |
| 382 | + if (dvt->pad >= sd->entity.num_pads) | |
| 383 | + return -EINVAL; | |
| 384 | + | |
| 385 | + return v4l2_subdev_call(sd, pad, enum_dv_timings, dvt); | |
| 386 | + } | |
| 387 | + | |
| 388 | + case VIDIOC_SUBDEV_QUERY_DV_TIMINGS: | |
| 389 | + return v4l2_subdev_call(sd, video, query_dv_timings, arg); | |
| 390 | + | |
| 391 | + case VIDIOC_SUBDEV_G_DV_TIMINGS: | |
| 392 | + return v4l2_subdev_call(sd, video, g_dv_timings, arg); | |
| 393 | + | |
| 394 | + case VIDIOC_SUBDEV_S_DV_TIMINGS: | |
| 395 | + return v4l2_subdev_call(sd, video, s_dv_timings, arg); | |
| 369 | 396 | #endif |
| 370 | 397 | default: |
| 371 | 398 | return v4l2_subdev_call(sd, core, ioctl, cmd, arg); |
| @@ -162,8 +162,13 @@ struct v4l2_subdev_selection { · 161 unmodified lines | ||
| 162 | 162 | #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) |
| 163 | 163 | #define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection) |
| 164 | 164 | #define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection) |
| 165 | −/* These two G/S_EDID ioctls are identical to the ioctls in videodev2.h */ | |
| 165 | +/* The following ioctls are identical to the ioctls in videodev2.h */ | |
| 166 | 166 | #define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid) |
| 167 | 167 | #define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid) |
| 168 | +#define VIDIOC_SUBDEV_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) | |
| 169 | +#define VIDIOC_SUBDEV_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) | |
| 170 | +#define VIDIOC_SUBDEV_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings) | |
| 171 | +#define VIDIOC_SUBDEV_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings) | |
| 172 | +#define VIDIOC_SUBDEV_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap) | |
| 168 | 173 | |
| 169 | 174 | #endif |