1059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
254f38fcaSMauro Carvalho Chehab
354f38fcaSMauro Carvalho Chehab.. _dv-controls:
454f38fcaSMauro Carvalho Chehab
554f38fcaSMauro Carvalho Chehab*******************************
654f38fcaSMauro Carvalho ChehabDigital Video Control Reference
754f38fcaSMauro Carvalho Chehab*******************************
854f38fcaSMauro Carvalho Chehab
954f38fcaSMauro Carvalho ChehabThe Digital Video control class is intended to control receivers and
1054f38fcaSMauro Carvalho Chehabtransmitters for `VGA <http://en.wikipedia.org/wiki/Vga>`__,
1154f38fcaSMauro Carvalho Chehab`DVI <http://en.wikipedia.org/wiki/Digital_Visual_Interface>`__
1254f38fcaSMauro Carvalho Chehab(Digital Visual Interface), HDMI (:ref:`hdmi`) and DisplayPort
1354f38fcaSMauro Carvalho Chehab(:ref:`dp`). These controls are generally expected to be private to
1454f38fcaSMauro Carvalho Chehabthe receiver or transmitter subdevice that implements them, so they are
1554f38fcaSMauro Carvalho Chehabonly exposed on the ``/dev/v4l-subdev*`` device node.
1654f38fcaSMauro Carvalho Chehab
1754f38fcaSMauro Carvalho Chehab.. note::
1854f38fcaSMauro Carvalho Chehab
1954f38fcaSMauro Carvalho Chehab   Note that these devices can have multiple input or output pads which are
2054f38fcaSMauro Carvalho Chehab   hooked up to e.g. HDMI connectors. Even though the subdevice will
2154f38fcaSMauro Carvalho Chehab   receive or transmit video from/to only one of those pads, the other pads
2254f38fcaSMauro Carvalho Chehab   can still be active when it comes to EDID (Extended Display
2354f38fcaSMauro Carvalho Chehab   Identification Data, :ref:`vesaedid`) and HDCP (High-bandwidth Digital
2454f38fcaSMauro Carvalho Chehab   Content Protection System, :ref:`hdcp`) processing, allowing the
2554f38fcaSMauro Carvalho Chehab   device to do the fairly slow EDID/HDCP handling in advance. This allows
2654f38fcaSMauro Carvalho Chehab   for quick switching between connectors.
2754f38fcaSMauro Carvalho Chehab
2854f38fcaSMauro Carvalho ChehabThese pads appear in several of the controls in this section as
2954f38fcaSMauro Carvalho Chehabbitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad
3054f38fcaSMauro Carvalho Chehab1, etc. The maximum value of the control is the set of valid pads.
3154f38fcaSMauro Carvalho Chehab
3254f38fcaSMauro Carvalho Chehab
3354f38fcaSMauro Carvalho Chehab.. _dv-control-id:
3454f38fcaSMauro Carvalho Chehab
3554f38fcaSMauro Carvalho ChehabDigital Video Control IDs
3654f38fcaSMauro Carvalho Chehab=========================
3754f38fcaSMauro Carvalho Chehab
3854f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_CLASS (class)``
3954f38fcaSMauro Carvalho Chehab    The Digital Video class descriptor.
4054f38fcaSMauro Carvalho Chehab
4154f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_HOTPLUG (bitmask)``
4254f38fcaSMauro Carvalho Chehab    Many connectors have a hotplug pin which is high if EDID information
4354f38fcaSMauro Carvalho Chehab    is available from the source. This control shows the state of the
4454f38fcaSMauro Carvalho Chehab    hotplug pin as seen by the transmitter. Each bit corresponds to an
4554f38fcaSMauro Carvalho Chehab    output pad on the transmitter. If an output pad does not have an
4654f38fcaSMauro Carvalho Chehab    associated hotplug pin, then the bit for that pad will be 0. This
4754f38fcaSMauro Carvalho Chehab    read-only control is applicable to DVI-D, HDMI and DisplayPort
4854f38fcaSMauro Carvalho Chehab    connectors.
4954f38fcaSMauro Carvalho Chehab
5054f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_RXSENSE (bitmask)``
5154f38fcaSMauro Carvalho Chehab    Rx Sense is the detection of pull-ups on the TMDS clock lines. This
5254f38fcaSMauro Carvalho Chehab    normally means that the sink has left/entered standby (i.e. the
5354f38fcaSMauro Carvalho Chehab    transmitter can sense that the receiver is ready to receive video).
5454f38fcaSMauro Carvalho Chehab    Each bit corresponds to an output pad on the transmitter. If an
5554f38fcaSMauro Carvalho Chehab    output pad does not have an associated Rx Sense, then the bit for
5654f38fcaSMauro Carvalho Chehab    that pad will be 0. This read-only control is applicable to DVI-D
5754f38fcaSMauro Carvalho Chehab    and HDMI devices.
5854f38fcaSMauro Carvalho Chehab
5954f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_EDID_PRESENT (bitmask)``
6054f38fcaSMauro Carvalho Chehab    When the transmitter sees the hotplug signal from the receiver it
6154f38fcaSMauro Carvalho Chehab    will attempt to read the EDID. If set, then the transmitter has read
6254f38fcaSMauro Carvalho Chehab    at least the first block (= 128 bytes). Each bit corresponds to an
6354f38fcaSMauro Carvalho Chehab    output pad on the transmitter. If an output pad does not support
6454f38fcaSMauro Carvalho Chehab    EDIDs, then the bit for that pad will be 0. This read-only control
6554f38fcaSMauro Carvalho Chehab    is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
6654f38fcaSMauro Carvalho Chehab
6754f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_MODE``
6854f38fcaSMauro Carvalho Chehab    (enum)
6954f38fcaSMauro Carvalho Chehab
7054f38fcaSMauro Carvalho Chehabenum v4l2_dv_tx_mode -
7154f38fcaSMauro Carvalho Chehab    HDMI transmitters can transmit in DVI-D mode (just video) or in HDMI
7254f38fcaSMauro Carvalho Chehab    mode (video + audio + auxiliary data). This control selects which
7354f38fcaSMauro Carvalho Chehab    mode to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
7454f38fcaSMauro Carvalho Chehab    This control is applicable to HDMI connectors.
7554f38fcaSMauro Carvalho Chehab
7654f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_RGB_RANGE``
7754f38fcaSMauro Carvalho Chehab    (enum)
7854f38fcaSMauro Carvalho Chehab
7954f38fcaSMauro Carvalho Chehabenum v4l2_dv_rgb_range -
8054f38fcaSMauro Carvalho Chehab    Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
8154f38fcaSMauro Carvalho Chehab    follows the RGB quantization range specified in the standard for the
8254f38fcaSMauro Carvalho Chehab    video interface (ie. :ref:`cea861` for HDMI).
8354f38fcaSMauro Carvalho Chehab    V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
8454f38fcaSMauro Carvalho Chehab    standard to be compatible with sinks that have not implemented the
8554f38fcaSMauro Carvalho Chehab    standard correctly (unfortunately quite common for HDMI and DVI-D).
8654f38fcaSMauro Carvalho Chehab    Full range allows all possible values to be used whereas limited
8754f38fcaSMauro Carvalho Chehab    range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
8854f38fcaSMauro Carvalho Chehab    the number of bits per component. This control is applicable to VGA,
8954f38fcaSMauro Carvalho Chehab    DVI-A/D, HDMI and DisplayPort connectors.
9054f38fcaSMauro Carvalho Chehab
9154f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_TX_IT_CONTENT_TYPE``
9254f38fcaSMauro Carvalho Chehab    (enum)
9354f38fcaSMauro Carvalho Chehab
9454f38fcaSMauro Carvalho Chehabenum v4l2_dv_it_content_type -
9554f38fcaSMauro Carvalho Chehab    Configures the IT Content Type of the transmitted video. This
9654f38fcaSMauro Carvalho Chehab    information is sent over HDMI and DisplayPort connectors as part of
9754f38fcaSMauro Carvalho Chehab    the AVI InfoFrame. The term 'IT Content' is used for content that
9854f38fcaSMauro Carvalho Chehab    originates from a computer as opposed to content from a TV broadcast
9954f38fcaSMauro Carvalho Chehab    or an analog source. The enum v4l2_dv_it_content_type defines
10054f38fcaSMauro Carvalho Chehab    the possible content types:
10154f38fcaSMauro Carvalho Chehab
102*fea13a69SMauro Carvalho Chehab.. tabularcolumns:: |p{7.3cm}|p{10.2cm}|
10354f38fcaSMauro Carvalho Chehab
10454f38fcaSMauro Carvalho Chehab.. flat-table::
10554f38fcaSMauro Carvalho Chehab    :header-rows:  0
10654f38fcaSMauro Carvalho Chehab    :stub-columns: 0
10754f38fcaSMauro Carvalho Chehab
10854f38fcaSMauro Carvalho Chehab    * - ``V4L2_DV_IT_CONTENT_TYPE_GRAPHICS``
10954f38fcaSMauro Carvalho Chehab      - Graphics content. Pixel data should be passed unfiltered and
11054f38fcaSMauro Carvalho Chehab	without analog reconstruction.
11154f38fcaSMauro Carvalho Chehab    * - ``V4L2_DV_IT_CONTENT_TYPE_PHOTO``
11254f38fcaSMauro Carvalho Chehab      - Photo content. The content is derived from digital still pictures.
11354f38fcaSMauro Carvalho Chehab	The content should be passed through with minimal scaling and
11454f38fcaSMauro Carvalho Chehab	picture enhancements.
11554f38fcaSMauro Carvalho Chehab    * - ``V4L2_DV_IT_CONTENT_TYPE_CINEMA``
11654f38fcaSMauro Carvalho Chehab      - Cinema content.
11754f38fcaSMauro Carvalho Chehab    * - ``V4L2_DV_IT_CONTENT_TYPE_GAME``
11854f38fcaSMauro Carvalho Chehab      - Game content. Audio and video latency should be minimized.
11954f38fcaSMauro Carvalho Chehab    * - ``V4L2_DV_IT_CONTENT_TYPE_NO_ITC``
12054f38fcaSMauro Carvalho Chehab      - No IT Content information is available and the ITC bit in the AVI
12154f38fcaSMauro Carvalho Chehab	InfoFrame is set to 0.
12254f38fcaSMauro Carvalho Chehab
12354f38fcaSMauro Carvalho Chehab
12454f38fcaSMauro Carvalho Chehab
12554f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_RX_POWER_PRESENT (bitmask)``
12654f38fcaSMauro Carvalho Chehab    Detects whether the receiver receives power from the source (e.g.
12754f38fcaSMauro Carvalho Chehab    HDMI carries 5V on one of the pins). This is often used to power an
12854f38fcaSMauro Carvalho Chehab    eeprom which contains EDID information, such that the source can
12954f38fcaSMauro Carvalho Chehab    read the EDID even if the sink is in standby/power off. Each bit
13054f38fcaSMauro Carvalho Chehab    corresponds to an input pad on the receiver. If an input pad
13154f38fcaSMauro Carvalho Chehab    cannot detect whether power is present, then the bit for that pad
13254f38fcaSMauro Carvalho Chehab    will be 0. This read-only control is applicable to DVI-D, HDMI and
13354f38fcaSMauro Carvalho Chehab    DisplayPort connectors.
13454f38fcaSMauro Carvalho Chehab
13554f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_RX_RGB_RANGE``
13654f38fcaSMauro Carvalho Chehab    (enum)
13754f38fcaSMauro Carvalho Chehab
13854f38fcaSMauro Carvalho Chehabenum v4l2_dv_rgb_range -
13954f38fcaSMauro Carvalho Chehab    Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
14054f38fcaSMauro Carvalho Chehab    follows the RGB quantization range specified in the standard for the
14154f38fcaSMauro Carvalho Chehab    video interface (ie. :ref:`cea861` for HDMI).
14254f38fcaSMauro Carvalho Chehab    V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the
14354f38fcaSMauro Carvalho Chehab    standard to be compatible with sources that have not implemented the
14454f38fcaSMauro Carvalho Chehab    standard correctly (unfortunately quite common for HDMI and DVI-D).
14554f38fcaSMauro Carvalho Chehab    Full range allows all possible values to be used whereas limited
14654f38fcaSMauro Carvalho Chehab    range sets the range to (16 << (N-8)) - (235 << (N-8)) where N is
14754f38fcaSMauro Carvalho Chehab    the number of bits per component. This control is applicable to VGA,
14854f38fcaSMauro Carvalho Chehab    DVI-A/D, HDMI and DisplayPort connectors.
14954f38fcaSMauro Carvalho Chehab
15054f38fcaSMauro Carvalho Chehab``V4L2_CID_DV_RX_IT_CONTENT_TYPE``
15154f38fcaSMauro Carvalho Chehab    (enum)
15254f38fcaSMauro Carvalho Chehab
15354f38fcaSMauro Carvalho Chehabenum v4l2_dv_it_content_type -
15454f38fcaSMauro Carvalho Chehab    Reads the IT Content Type of the received video. This information is
15554f38fcaSMauro Carvalho Chehab    sent over HDMI and DisplayPort connectors as part of the AVI
15654f38fcaSMauro Carvalho Chehab    InfoFrame. The term 'IT Content' is used for content that originates
15754f38fcaSMauro Carvalho Chehab    from a computer as opposed to content from a TV broadcast or an
15854f38fcaSMauro Carvalho Chehab    analog source. See ``V4L2_CID_DV_TX_IT_CONTENT_TYPE`` for the
15954f38fcaSMauro Carvalho Chehab    available content types.
160