History

media: uapi: Add generic serial metadata mbus formats

Add generic serial metadata mbus formats. These formats describe data width and packing but not the content itself. The reason for specifying such formats is that the formats as such are fairly device specific but they are still handled by CSI-2 receiver drivers that should not be aware of device specific formats. What makes generic metadata formats possible is that these formats are parsed by software only, after capturing the data to system memory. Also add a definition for "Data Unit" to cover what is essentially a pixel but is not image data.

Sakari Ailus committed 3 years ago

Commit f28bdda1 parent 7ba432f3 files · +270 −0Browse files

Unified · Split

3 files
  1. Documentation/userspace-api/media/glossary.rst +7 −0
  2. Documentation/userspace-api/media/v4l/subdev-formats.rst +254 −0
  3. include/uapi/linux/media-bus-format.h +9 −0
Documentation/userspace-api/media/glossary.rst+7−0
@@ -25,6 +25,13 @@ Glossary · 24 unmodified lines
2525
2626 See :ref:`cec`.
2727
28+ Data Unit
29+
30+ Unit of data transported by a bus. On parallel buses, the data unit
31+ consists of one or more related samples while on serial buses the data
32+ unit is logical. If the data unit is image data, it may also be called a
33+ pixel.
34+
2835 Device Driver
2936 Part of the Linux Kernel that implements support for a hardware
3037 component.
Documentation/userspace-api/media/v4l/subdev-formats.rst+254−0
@@ -8306,3 +8306,257 @@ The following table lists the existing metadata formats. · 8305 unmodified lines
83068306 both sides of the link and the bus format is a fixed
83078307 metadata format that is not configurable from userspace.
83088308 Width and height will be set to 0 for this format.
8309+
8310+Generic Serial Metadata Formats
8311+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8312+
8313+Generic serial metadata formats are used on serial buses where the actual data
8314+content is more or less device specific but the data is transmitted and received
8315+by multiple devices that do not process the data in any way, simply writing
8316+it to system memory for processing in software at the end of the pipeline.
8317+
8318+"b" in an array cell signifies a byte of data, followed by the number of the bit
8319+and finally the bit number in subscript. "x" indicates a padding bit.
8320+
8321+.. _media-bus-format-generic-meta:
8322+
8323+.. cssclass: longtable
8324+
8325+.. flat-table:: Generic Serial Metadata Formats
8326+ :header-rows: 2
8327+ :stub-columns: 0
8328+
8329+ * - Identifier
8330+ - Code
8331+ -
8332+ - :cspan:`23` Data organization within bus :term:`Data Unit`
8333+ * -
8334+ -
8335+ - Bit
8336+ - 23
8337+ - 22
8338+ - 21
8339+ - 20
8340+ - 19
8341+ - 18
8342+ - 17
8343+ - 16
8344+ - 15
8345+ - 14
8346+ - 13
8347+ - 12
8348+ - 11
8349+ - 10
8350+ - 9
8351+ - 8
8352+ - 7
8353+ - 6
8354+ - 5
8355+ - 4
8356+ - 3
8357+ - 2
8358+ - 1
8359+ - 0
8360+ * .. _MEDIA-BUS-FMT-META-8:
8361+
8362+ - MEDIA_BUS_FMT_META_8
8363+ - 0x8001
8364+ -
8365+ -
8366+ -
8367+ -
8368+ -
8369+ -
8370+ -
8371+ -
8372+ -
8373+ -
8374+ -
8375+ -
8376+ -
8377+ -
8378+ -
8379+ -
8380+ -
8381+ - b0\ :sub:`7`
8382+ - b0\ :sub:`6`
8383+ - b0\ :sub:`5`
8384+ - b0\ :sub:`4`
8385+ - b0\ :sub:`3`
8386+ - b0\ :sub:`2`
8387+ - b0\ :sub:`1`
8388+ - b0\ :sub:`0`
8389+ * .. _MEDIA-BUS-FMT-META-10:
8390+
8391+ - MEDIA_BUS_FMT_META_10
8392+ - 0x8002
8393+ -
8394+ -
8395+ -
8396+ -
8397+ -
8398+ -
8399+ -
8400+ -
8401+ -
8402+ -
8403+ -
8404+ -
8405+ -
8406+ -
8407+ -
8408+ - b0\ :sub:`7`
8409+ - b0\ :sub:`6`
8410+ - b0\ :sub:`5`
8411+ - b0\ :sub:`4`
8412+ - b0\ :sub:`3`
8413+ - b0\ :sub:`2`
8414+ - b0\ :sub:`1`
8415+ - b0\ :sub:`0`
8416+ - x
8417+ - x
8418+ * .. _MEDIA-BUS-FMT-META-12:
8419+
8420+ - MEDIA_BUS_FMT_META_12
8421+ - 0x8003
8422+ -
8423+ -
8424+ -
8425+ -
8426+ -
8427+ -
8428+ -
8429+ -
8430+ -
8431+ -
8432+ -
8433+ -
8434+ -
8435+ - b0\ :sub:`7`
8436+ - b0\ :sub:`6`
8437+ - b0\ :sub:`5`
8438+ - b0\ :sub:`4`
8439+ - b0\ :sub:`3`
8440+ - b0\ :sub:`2`
8441+ - b0\ :sub:`1`
8442+ - b0\ :sub:`0`
8443+ - x
8444+ - x
8445+ - x
8446+ - x
8447+ * .. _MEDIA-BUS-FMT-META-14:
8448+
8449+ - MEDIA_BUS_FMT_META_14
8450+ - 0x8004
8451+ -
8452+ -
8453+ -
8454+ -
8455+ -
8456+ -
8457+ -
8458+ -
8459+ -
8460+ -
8461+ -
8462+ - b0\ :sub:`7`
8463+ - b0\ :sub:`6`
8464+ - b0\ :sub:`5`
8465+ - b0\ :sub:`4`
8466+ - b0\ :sub:`3`
8467+ - b0\ :sub:`2`
8468+ - b0\ :sub:`1`
8469+ - b0\ :sub:`0`
8470+ - x
8471+ - x
8472+ - x
8473+ - x
8474+ - x
8475+ - x
8476+ * .. _MEDIA-BUS-FMT-META-16:
8477+
8478+ - MEDIA_BUS_FMT_META_16
8479+ - 0x8005
8480+ -
8481+ -
8482+ -
8483+ -
8484+ -
8485+ -
8486+ -
8487+ -
8488+ -
8489+ - b0\ :sub:`7`
8490+ - b0\ :sub:`6`
8491+ - b0\ :sub:`5`
8492+ - b0\ :sub:`4`
8493+ - b0\ :sub:`3`
8494+ - b0\ :sub:`2`
8495+ - b0\ :sub:`1`
8496+ - b0\ :sub:`0`
8497+ - x
8498+ - x
8499+ - x
8500+ - x
8501+ - x
8502+ - x
8503+ - x
8504+ - x
8505+ * .. _MEDIA-BUS-FMT-META-20:
8506+
8507+ - MEDIA_BUS_FMT_META_20
8508+ - 0x8006
8509+ -
8510+ -
8511+ -
8512+ -
8513+ -
8514+ - b0\ :sub:`7`
8515+ - b0\ :sub:`6`
8516+ - b0\ :sub:`5`
8517+ - b0\ :sub:`4`
8518+ - b0\ :sub:`3`
8519+ - b0\ :sub:`2`
8520+ - b0\ :sub:`1`
8521+ - b0\ :sub:`0`
8522+ - x
8523+ - x
8524+ - x
8525+ - x
8526+ - x
8527+ - x
8528+ - x
8529+ - x
8530+ - x
8531+ - x
8532+ - x
8533+ - x
8534+ * .. _MEDIA-BUS-FMT-META-24:
8535+
8536+ - MEDIA_BUS_FMT_META_24
8537+ - 0x8007
8538+ -
8539+ - b0\ :sub:`7`
8540+ - b0\ :sub:`6`
8541+ - b0\ :sub:`5`
8542+ - b0\ :sub:`4`
8543+ - b0\ :sub:`3`
8544+ - b0\ :sub:`2`
8545+ - b0\ :sub:`1`
8546+ - b0\ :sub:`0`
8547+ - x
8548+ - x
8549+ - x
8550+ - x
8551+ - x
8552+ - x
8553+ - x
8554+ - x
8555+ - x
8556+ - x
8557+ - x
8558+ - x
8559+ - x
8560+ - x
8561+ - x
8562+ - x
include/uapi/linux/media-bus-format.h+9−0
@@ -174,4 +174,13 @@ · 173 unmodified lines
174174 */
175175 #define MEDIA_BUS_FMT_METADATA_FIXED 0x7001
176176
177+/* Generic line based metadata formats for serial buses. Next is 0x8008. */
178+#define MEDIA_BUS_FMT_META_8 0x8001
179+#define MEDIA_BUS_FMT_META_10 0x8002
180+#define MEDIA_BUS_FMT_META_12 0x8003
181+#define MEDIA_BUS_FMT_META_14 0x8004
182+#define MEDIA_BUS_FMT_META_16 0x8005
183+#define MEDIA_BUS_FMT_META_20 0x8006
184+#define MEDIA_BUS_FMT_META_24 0x8007
185+
177186 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */