318 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_G_DV_TIMINGS:5 6**********************************************7ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS8**********************************************9 10Name11====12 13VIDIOC_G_DV_TIMINGS - VIDIOC_S_DV_TIMINGS - VIDIOC_SUBDEV_G_DV_TIMINGS - VIDIOC_SUBDEV_S_DV_TIMINGS - Get or set DV timings for input or output14 15Synopsis16========17 18.. c:macro:: VIDIOC_G_DV_TIMINGS19 20``int ioctl(int fd, VIDIOC_G_DV_TIMINGS, struct v4l2_dv_timings *argp)``21 22.. c:macro:: VIDIOC_S_DV_TIMINGS23 24``int ioctl(int fd, VIDIOC_S_DV_TIMINGS, struct v4l2_dv_timings *argp)``25 26.. c:macro:: VIDIOC_SUBDEV_G_DV_TIMINGS27 28``int ioctl(int fd, VIDIOC_SUBDEV_G_DV_TIMINGS, struct v4l2_dv_timings *argp)``29 30.. c:macro:: VIDIOC_SUBDEV_S_DV_TIMINGS31 32``int ioctl(int fd, VIDIOC_SUBDEV_S_DV_TIMINGS, struct v4l2_dv_timings *argp)``33 34Arguments35=========36 37``fd``38 File descriptor returned by :c:func:`open()`.39 40``argp``41 Pointer to struct :c:type:`v4l2_dv_timings`.42 43Description44===========45 46To set DV timings for the input or output, applications use the47:ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl and to get the current timings,48applications use the :ref:`VIDIOC_G_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl. The detailed timing49information is filled in using the structure struct50:c:type:`v4l2_dv_timings`. These ioctls take a51pointer to the struct :c:type:`v4l2_dv_timings`52structure as argument. If the ioctl is not supported or the timing53values are not correct, the driver returns ``EINVAL`` error code.54 55Calling ``VIDIOC_SUBDEV_S_DV_TIMINGS`` on a subdev device node that has been56registered in read-only mode is not allowed. An error is returned and the errno57variable is set to ``-EPERM``.58 59The ``linux/v4l2-dv-timings.h`` header can be used to get the timings of60the formats in the :ref:`cea861` and :ref:`vesadmt` standards. If61the current input or output does not support DV timings (e.g. if62:ref:`VIDIOC_ENUMINPUT` does not set the63``V4L2_IN_CAP_DV_TIMINGS`` flag), then ``ENODATA`` error code is returned.64 65Return Value66============67 68On success 0 is returned, on error -1 and the ``errno`` variable is set69appropriately. The generic error codes are described at the70:ref:`Generic Error Codes <gen-errors>` chapter.71 72EINVAL73 This ioctl is not supported, or the :ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>`74 parameter was unsuitable.75 76ENODATA77 Digital video timings are not supported for this input or output.78 79EBUSY80 The device is busy and therefore can not change the timings.81 82EPERM83 ``VIDIOC_SUBDEV_S_DV_TIMINGS`` has been called on a read-only subdevice.84 85.. c:type:: v4l2_bt_timings86 87.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|88 89.. cssclass:: longtable90 91.. flat-table:: struct v4l2_bt_timings92 :header-rows: 093 :stub-columns: 094 :widths: 1 1 295 96 * - __u3297 - ``width``98 - Width of the active video in pixels.99 * - __u32100 - ``height``101 - Height of the active video frame in lines. So for interlaced102 formats the height of the active video in each field is103 ``height``/2.104 * - __u32105 - ``interlaced``106 - Progressive (``V4L2_DV_PROGRESSIVE``) or interlaced (``V4L2_DV_INTERLACED``).107 * - __u32108 - ``polarities``109 - This is a bit mask that defines polarities of sync signals. bit 0110 (``V4L2_DV_VSYNC_POS_POL``) is for vertical sync polarity and bit111 1 (``V4L2_DV_HSYNC_POS_POL``) is for horizontal sync polarity. If112 the bit is set (1) it is positive polarity and if is cleared (0),113 it is negative polarity.114 * - __u64115 - ``pixelclock``116 - Pixel clock in Hz. Ex. 74.25MHz->74250000117 * - __u32118 - ``hfrontporch``119 - Horizontal front porch in pixels120 * - __u32121 - ``hsync``122 - Horizontal sync length in pixels123 * - __u32124 - ``hbackporch``125 - Horizontal back porch in pixels126 * - __u32127 - ``vfrontporch``128 - Vertical front porch in lines. For interlaced formats this refers129 to the odd field (aka field 1).130 * - __u32131 - ``vsync``132 - Vertical sync length in lines. For interlaced formats this refers133 to the odd field (aka field 1).134 * - __u32135 - ``vbackporch``136 - Vertical back porch in lines. For interlaced formats this refers137 to the odd field (aka field 1).138 * - __u32139 - ``il_vfrontporch``140 - Vertical front porch in lines for the even field (aka field 2) of141 interlaced field formats. Must be 0 for progressive formats.142 * - __u32143 - ``il_vsync``144 - Vertical sync length in lines for the even field (aka field 2) of145 interlaced field formats. Must be 0 for progressive formats.146 * - __u32147 - ``il_vbackporch``148 - Vertical back porch in lines for the even field (aka field 2) of149 interlaced field formats. Must be 0 for progressive formats.150 * - __u32151 - ``standards``152 - The video standard(s) this format belongs to. This will be filled153 in by the driver. Applications must set this to 0. See154 :ref:`dv-bt-standards` for a list of standards.155 * - __u32156 - ``flags``157 - Several flags giving more information about the format. See158 :ref:`dv-bt-flags` for a description of the flags.159 * - struct :c:type:`v4l2_fract`160 - ``picture_aspect``161 - The picture aspect if the pixels are not square. Only valid if the162 ``V4L2_DV_FL_HAS_PICTURE_ASPECT`` flag is set.163 * - __u8164 - ``cea861_vic``165 - The Video Identification Code according to the CEA-861 standard.166 Only valid if the ``V4L2_DV_FL_HAS_CEA861_VIC`` flag is set.167 * - __u8168 - ``hdmi_vic``169 - The Video Identification Code according to the HDMI standard.170 Only valid if the ``V4L2_DV_FL_HAS_HDMI_VIC`` flag is set.171 * - __u8172 - ``reserved[46]``173 - Reserved for future extensions. Drivers and applications must set174 the array to zero.175 176.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.1cm}|177 178.. c:type:: v4l2_dv_timings179 180.. flat-table:: struct v4l2_dv_timings181 :header-rows: 0182 :stub-columns: 0183 :widths: 1 1 2184 185 * - __u32186 - ``type``187 - Type of DV timings as listed in :ref:`dv-timing-types`.188 * - union {189 - (anonymous)190 * - struct :c:type:`v4l2_bt_timings`191 - ``bt``192 - Timings defined by BT.656/1120 specifications193 * - __u32194 - ``reserved``\ [32]195 -196 * - }197 -198 199.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|200 201.. _dv-timing-types:202 203.. flat-table:: DV Timing types204 :header-rows: 0205 :stub-columns: 0206 :widths: 1 1 2207 208 * - Timing type209 - value210 - Description211 * -212 -213 -214 * - ``V4L2_DV_BT_656_1120``215 - 0216 - BT.656/1120 timings217 218.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|219 220.. cssclass:: longtable221 222.. _dv-bt-standards:223 224.. flat-table:: DV BT Timing standards225 :header-rows: 0226 :stub-columns: 0227 228 * - Timing standard229 - Description230 * - ``V4L2_DV_BT_STD_CEA861``231 - The timings follow the CEA-861 Digital TV Profile standard232 * - ``V4L2_DV_BT_STD_DMT``233 - The timings follow the VESA Discrete Monitor Timings standard234 * - ``V4L2_DV_BT_STD_CVT``235 - The timings follow the VESA Coordinated Video Timings standard236 * - ``V4L2_DV_BT_STD_GTF``237 - The timings follow the VESA Generalized Timings Formula standard238 * - ``V4L2_DV_BT_STD_SDI``239 - The timings follow the SDI Timings standard.240 There are no horizontal syncs/porches at all in this format.241 Total blanking timings must be set in hsync or vsync fields only.242 243.. tabularcolumns:: |p{7.7cm}|p{9.8cm}|244 245.. cssclass:: longtable246 247.. _dv-bt-flags:248 249.. flat-table:: DV BT Timing flags250 :header-rows: 0251 :stub-columns: 0252 253 * - Flag254 - Description255 * - ``V4L2_DV_FL_REDUCED_BLANKING``256 - CVT/GTF specific: the timings use reduced blanking (CVT) or the257 'Secondary GTF' curve (GTF). In both cases the horizontal and/or258 vertical blanking intervals are reduced, allowing a higher259 resolution over the same bandwidth. This is a read-only flag,260 applications must not set this.261 * - ``V4L2_DV_FL_CAN_REDUCE_FPS``262 - CEA-861 specific: set for CEA-861 formats with a framerate that is263 a multiple of six. These formats can be optionally played at 1 /264 1.001 speed to be compatible with 60 Hz based standards such as265 NTSC and PAL-M that use a framerate of 29.97 frames per second. If266 the transmitter can't generate such frequencies, then the flag267 will also be cleared. This is a read-only flag, applications must268 not set this.269 * - ``V4L2_DV_FL_REDUCED_FPS``270 - CEA-861 specific: only valid for video transmitters or video271 receivers that have the ``V4L2_DV_FL_CAN_DETECT_REDUCED_FPS``272 set. This flag is cleared otherwise. It is also only valid for273 formats with the ``V4L2_DV_FL_CAN_REDUCE_FPS`` flag set, for other274 formats the flag will be cleared by the driver.275 276 If the application sets this flag for a transmitter, then the277 pixelclock used to set up the transmitter is divided by 1.001 to278 make it compatible with NTSC framerates. If the transmitter can't279 generate such frequencies, then the flag will be cleared.280 281 If a video receiver detects that the format uses a reduced framerate,282 then it will set this flag to signal this to the application.283 * - ``V4L2_DV_FL_HALF_LINE``284 - Specific to interlaced formats: if set, then the vertical285 frontporch of field 1 (aka the odd field) is really one half-line286 longer and the vertical backporch of field 2 (aka the even field)287 is really one half-line shorter, so each field has exactly the288 same number of half-lines. Whether half-lines can be detected or289 used depends on the hardware.290 * - ``V4L2_DV_FL_IS_CE_VIDEO``291 - If set, then this is a Consumer Electronics (CE) video format.292 Such formats differ from other formats (commonly called IT293 formats) in that if R'G'B' encoding is used then by default the294 R'G'B' values use limited range (i.e. 16-235) as opposed to full295 range (i.e. 0-255). All formats defined in CEA-861 except for the296 640x480p59.94 format are CE formats.297 * - ``V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE``298 - Some formats like SMPTE-125M have an interlaced signal with a odd299 total height. For these formats, if this flag is set, the first300 field has the extra line. Else, it is the second field.301 * - ``V4L2_DV_FL_HAS_PICTURE_ASPECT``302 - If set, then the picture_aspect field is valid. Otherwise assume that303 the pixels are square, so the picture aspect ratio is the same as the304 width to height ratio.305 * - ``V4L2_DV_FL_HAS_CEA861_VIC``306 - If set, then the cea861_vic field is valid and contains the Video307 Identification Code as per the CEA-861 standard.308 * - ``V4L2_DV_FL_HAS_HDMI_VIC``309 - If set, then the hdmi_vic field is valid and contains the Video310 Identification Code as per the HDMI standard (HDMI Vendor Specific311 InfoFrame).312 * - ``V4L2_DV_FL_CAN_DETECT_REDUCED_FPS``313 - CEA-861 specific: only valid for video receivers, the flag is314 cleared by transmitters.315 If set, then the hardware can detect the difference between316 regular framerates and framerates reduced by 1000/1001. E.g.:317 60 vs 59.94 Hz, 30 vs 29.97 Hz or 24 vs 23.976 Hz.318