^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: V4L
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _VIDIOC_SUBDEV_ENUM_MBUS_CODE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) **********************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) **********************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: VIDIOC_SUBDEV_ENUM_MBUS_CODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_MBUS_CODE, struct v4l2_subdev_mbus_code_enum * argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to struct :c:type:`v4l2_subdev_mbus_code_enum`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) To enumerate media bus formats available at a given sub-device pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) applications initialize the ``pad``, ``which`` and ``index`` fields of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) :c:type:`v4l2_subdev_mbus_code_enum` and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl with a pointer to this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) structure. Drivers fill the rest of the structure or return an ``EINVAL``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) error code if either the ``pad`` or ``index`` are invalid. All media bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) formats are enumerable by beginning at index zero and incrementing by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) one until ``EINVAL`` is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Available media bus formats may depend on the current 'try' formats at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) other pads of the sub-device, as well as on the current active links.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) See :ref:`VIDIOC_SUBDEV_G_FMT` for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) information about the try formats.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) .. c:type:: v4l2_subdev_mbus_code_enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) .. flat-table:: struct v4l2_subdev_mbus_code_enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) - ``pad``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) - Pad number as reported by the media controller API.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) - ``index``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) - Number of the format in the enumeration, set by the application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) - ``code``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) - The media bus format code, as defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) :ref:`v4l2-mbus-format`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) - ``which``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) - Media bus format codes to be enumerated, from enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) - ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) - See :ref:`v4l2-subdev-mbus-code-flags`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * - __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) - ``reserved``\ [7]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) - Reserved for future extensions. Applications and drivers must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) the array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{7.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) .. _v4l2-subdev-mbus-code-flags:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) .. flat-table:: Subdev Media Bus Code Enumerate Flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) :widths: 1 1 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * - V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) - 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) - The driver allows the application to try to change the default colorspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) encoding. The application can ask to configure the colorspace of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) See :ref:`v4l2-mbus-format` on how to do this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * - V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) - 0x00000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) - The driver allows the application to try to change the default transform function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) The application can ask to configure the transform function of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) the subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) See :ref:`v4l2-mbus-format` on how to do this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * - V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) - 0x00000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) - The driver allows the application to try to change the default Y'CbCr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) encoding. The application can ask to configure the Y'CbCr encoding of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) See :ref:`v4l2-mbus-format` on how to do this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * - V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) - 0x00000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) - The driver allows the application to try to change the default HSV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) encoding. The application can ask to configure the HSV encoding of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) See :ref:`v4l2-mbus-format` on how to do this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * - V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) - 0x00000008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) - The driver allows the application to try to change the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) quantization. The application can ask to configure the quantization of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) the subdevice when calling the :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) ioctl with :ref:`V4L2_MBUS_FRAMEFMT_SET_CSC <mbus-framefmt-set-csc>` set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) See :ref:`v4l2-mbus-format` on how to do this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) The struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) :c:type:`v4l2_subdev_mbus_code_enum`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) ``pad`` references a non-existing pad, or the ``index`` field is out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) of bounds.