Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
Mauro Carvalho Chehab | d2c6815 | 2016-07-09 08:54:35 -0300 | [diff] [blame] | 3 | .. _media_ioc_g_topology: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 4 | |
| 5 | ************************** |
| 6 | ioctl MEDIA_IOC_G_TOPOLOGY |
| 7 | ************************** |
| 8 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 9 | Name |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 10 | ==== |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 11 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 12 | MEDIA_IOC_G_TOPOLOGY - Enumerate the graph topology and graph element properties |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 13 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 14 | |
| 15 | Synopsis |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 16 | ======== |
| 17 | |
Mauro Carvalho Chehab | 5ccbb18 | 2016-08-19 16:59:55 -0300 | [diff] [blame] | 18 | .. c:function:: int ioctl( int fd, MEDIA_IOC_G_TOPOLOGY, struct media_v2_topology *argp ) |
| 19 | :name: MEDIA_IOC_G_TOPOLOGY |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 21 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 22 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 23 | ========= |
| 24 | |
| 25 | ``fd`` |
| 26 | File descriptor returned by :ref:`open() <media-func-open>`. |
| 27 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 28 | ``argp`` |
Hans Verkuil | b4ae675 | 2018-08-04 05:48:36 -0400 | [diff] [blame^] | 29 | Pointer to struct :c:type:`media_v2_topology`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 30 | |
| 31 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 32 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 33 | =========== |
| 34 | |
| 35 | The typical usage of this ioctl is to call it twice. On the first call, |
| 36 | the structure defined at struct |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 37 | :c:type:`media_v2_topology` should be zeroed. At |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 38 | return, if no errors happen, this ioctl will return the |
| 39 | ``topology_version`` and the total number of entities, interfaces, pads |
| 40 | and links. |
| 41 | |
| 42 | Before the second call, the userspace should allocate arrays to store |
| 43 | the graph elements that are desired, putting the pointers to them at the |
| 44 | ptr_entities, ptr_interfaces, ptr_links and/or ptr_pads, keeping the |
| 45 | other values untouched. |
| 46 | |
| 47 | If the ``topology_version`` remains the same, the ioctl should fill the |
| 48 | desired arrays with the media graph elements. |
| 49 | |
Mauro Carvalho Chehab | 1367f4e | 2017-09-02 19:29:53 -0400 | [diff] [blame] | 50 | .. tabularcolumns:: |p{1.6cm}|p{3.4cm}|p{12.5cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 51 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 52 | .. c:type:: media_v2_topology |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 53 | |
| 54 | .. flat-table:: struct media_v2_topology |
| 55 | :header-rows: 0 |
| 56 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 57 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 58 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 59 | * - __u64 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 60 | - ``topology_version`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 61 | - Version of the media graph topology. When the graph is created, |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 62 | this field starts with zero. Every time a graph element is added |
| 63 | or removed, this field is incremented. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 64 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 65 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 66 | - ``num_entities`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 67 | - Number of entities in the graph |
| 68 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 69 | * - __u32 |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 70 | - ``reserved1`` |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 71 | - Applications and drivers shall set this to 0. |
| 72 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 73 | * - __u64 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 74 | - ``ptr_entities`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 75 | - A pointer to a memory area where the entities array will be |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 76 | stored, converted to a 64-bits integer. It can be zero. if zero, |
| 77 | the ioctl won't store the entities. It will just update |
| 78 | ``num_entities`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 79 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 80 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 81 | - ``num_interfaces`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 82 | - Number of interfaces in the graph |
| 83 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 84 | * - __u32 |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 85 | - ``reserved2`` |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 86 | - Applications and drivers shall set this to 0. |
| 87 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 88 | * - __u64 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 89 | - ``ptr_interfaces`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 90 | - A pointer to a memory area where the interfaces array will be |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 91 | stored, converted to a 64-bits integer. It can be zero. if zero, |
| 92 | the ioctl won't store the interfaces. It will just update |
| 93 | ``num_interfaces`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 94 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 95 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 96 | - ``num_pads`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 97 | - Total number of pads in the graph |
| 98 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 99 | * - __u32 |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 100 | - ``reserved3`` |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 101 | - Applications and drivers shall set this to 0. |
| 102 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 103 | * - __u64 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 104 | - ``ptr_pads`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 105 | - A pointer to a memory area where the pads array will be stored, |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 106 | converted to a 64-bits integer. It can be zero. if zero, the ioctl |
| 107 | won't store the pads. It will just update ``num_pads`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 108 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 109 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 110 | - ``num_links`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 111 | - Total number of data and interface links in the graph |
| 112 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 113 | * - __u32 |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 114 | - ``reserved4`` |
Hans Verkuil | ccac77d | 2018-02-03 13:06:01 -0500 | [diff] [blame] | 115 | - Applications and drivers shall set this to 0. |
| 116 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 117 | * - __u64 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 118 | - ``ptr_links`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 119 | - A pointer to a memory area where the links array will be stored, |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 120 | converted to a 64-bits integer. It can be zero. if zero, the ioctl |
| 121 | won't store the links. It will just update ``num_links`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 122 | |
| 123 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 124 | .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 125 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 126 | .. c:type:: media_v2_entity |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 127 | |
| 128 | .. flat-table:: struct media_v2_entity |
| 129 | :header-rows: 0 |
| 130 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 131 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 132 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 133 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 134 | - ``id`` |
Hans Verkuil | 8601494 | 2018-06-29 07:31:20 -0400 | [diff] [blame] | 135 | - Unique ID for the entity. Do not expect that the ID will |
| 136 | always be the same for each instance of the device. In other words, |
| 137 | do not hardcode entity IDs in an application. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 138 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 139 | * - char |
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 140 | - ``name``\ [64] |
Hans Verkuil | 8601494 | 2018-06-29 07:31:20 -0400 | [diff] [blame] | 141 | - Entity name as an UTF-8 NULL-terminated string. This name must be unique |
| 142 | within the media topology. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 143 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 144 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 145 | - ``function`` |
Hans Verkuil | cccc41f | 2018-03-19 11:43:24 -0400 | [diff] [blame] | 146 | - Entity main function, see :ref:`media-entity-functions` for details. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 147 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 148 | * - __u32 |
Hans Verkuil | d2dc644 | 2018-03-19 11:17:17 -0400 | [diff] [blame] | 149 | - ``flags`` |
| 150 | - Entity flags, see :ref:`media-entity-flag` for details. |
| 151 | Only valid if ``MEDIA_V2_ENTITY_HAS_FLAGS(media_version)`` |
| 152 | returns true. The ``media_version`` is defined in struct |
| 153 | :c:type:`media_device_info` and can be retrieved using |
| 154 | :ref:`MEDIA_IOC_DEVICE_INFO`. |
| 155 | |
| 156 | * - __u32 |
| 157 | - ``reserved``\ [5] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 158 | - Reserved for future extensions. Drivers and applications must set |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 159 | this array to zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 160 | |
| 161 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 162 | .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 163 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 164 | .. c:type:: media_v2_interface |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 165 | |
| 166 | .. flat-table:: struct media_v2_interface |
| 167 | :header-rows: 0 |
| 168 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 169 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 170 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 171 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 172 | - ``id`` |
Hans Verkuil | 8601494 | 2018-06-29 07:31:20 -0400 | [diff] [blame] | 173 | - Unique ID for the interface. Do not expect that the ID will |
| 174 | always be the same for each instance of the device. In other words, |
| 175 | do not hardcode interface IDs in an application. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 176 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 177 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 178 | - ``intf_type`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 179 | - Interface type, see :ref:`media-intf-type` for details. |
| 180 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 181 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 182 | - ``flags`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 183 | - Interface flags. Currently unused. |
| 184 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 185 | * - __u32 |
Mauro Carvalho Chehab | 8968da9 | 2016-07-13 08:43:30 -0300 | [diff] [blame] | 186 | - ``reserved``\ [9] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 187 | - Reserved for future extensions. Drivers and applications must set |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 188 | this array to zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 189 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 190 | * - struct media_v2_intf_devnode |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 191 | - ``devnode`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 192 | - Used only for device node interfaces. See |
Hans Verkuil | b054900 | 2018-03-19 11:11:10 -0400 | [diff] [blame] | 193 | :c:type:`media_v2_intf_devnode` for details. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 194 | |
| 195 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 196 | .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 197 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 198 | .. c:type:: media_v2_intf_devnode |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 199 | |
Alexandre Courbot | 7eb2bcb | 2017-06-07 06:33:02 -0300 | [diff] [blame] | 200 | .. flat-table:: struct media_v2_intf_devnode |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 201 | :header-rows: 0 |
| 202 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 203 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 204 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 205 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 206 | - ``major`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 207 | - Device node major number. |
| 208 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 209 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 210 | - ``minor`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 211 | - Device node minor number. |
| 212 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 213 | .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 214 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 215 | .. c:type:: media_v2_pad |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 216 | |
| 217 | .. flat-table:: struct media_v2_pad |
| 218 | :header-rows: 0 |
| 219 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 220 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 221 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 222 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 223 | - ``id`` |
Hans Verkuil | 8601494 | 2018-06-29 07:31:20 -0400 | [diff] [blame] | 224 | - Unique ID for the pad. Do not expect that the ID will |
| 225 | always be the same for each instance of the device. In other words, |
| 226 | do not hardcode pad IDs in an application. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 227 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 228 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 229 | - ``entity_id`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 230 | - Unique ID for the entity where this pad belongs. |
| 231 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 232 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 233 | - ``flags`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 234 | - Pad flags, see :ref:`media-pad-flag` for more details. |
| 235 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 236 | * - __u32 |
Hans Verkuil | b054900 | 2018-03-19 11:11:10 -0400 | [diff] [blame] | 237 | - ``index`` |
| 238 | - Pad index, starts at 0. Only valid if ``MEDIA_V2_PAD_HAS_INDEX(media_version)`` |
| 239 | returns true. The ``media_version`` is defined in struct |
| 240 | :c:type:`media_device_info` and can be retrieved using |
| 241 | :ref:`MEDIA_IOC_DEVICE_INFO`. |
| 242 | |
| 243 | * - __u32 |
| 244 | - ``reserved``\ [4] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 245 | - Reserved for future extensions. Drivers and applications must set |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 246 | this array to zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 247 | |
| 248 | |
Mauro Carvalho Chehab | fa92b04d | 2016-08-19 11:14:23 -0300 | [diff] [blame] | 249 | .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}| |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 250 | |
Mauro Carvalho Chehab | e8be7e9 | 2016-08-29 17:37:59 -0300 | [diff] [blame] | 251 | .. c:type:: media_v2_link |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 252 | |
Alexandre Courbot | 7eb2bcb | 2017-06-07 06:33:02 -0300 | [diff] [blame] | 253 | .. flat-table:: struct media_v2_link |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 254 | :header-rows: 0 |
| 255 | :stub-columns: 0 |
Mauro Carvalho Chehab | 8926814 | 2016-07-06 07:31:59 -0300 | [diff] [blame] | 256 | :widths: 1 2 8 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 257 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 258 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 259 | - ``id`` |
Hans Verkuil | 8601494 | 2018-06-29 07:31:20 -0400 | [diff] [blame] | 260 | - Unique ID for the link. Do not expect that the ID will |
| 261 | always be the same for each instance of the device. In other words, |
| 262 | do not hardcode link IDs in an application. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 263 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 264 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 265 | - ``source_id`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 266 | - On pad to pad links: unique ID for the source pad. |
| 267 | |
Hans Verkuil | afd1179 | 2018-02-03 14:18:38 -0500 | [diff] [blame] | 268 | On interface to entity links: unique ID for the interface. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 269 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 270 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 271 | - ``sink_id`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 272 | - On pad to pad links: unique ID for the sink pad. |
| 273 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 274 | On interface to entity links: unique ID for the entity. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 275 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 276 | * - __u32 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 277 | - ``flags`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 278 | - Link flags, see :ref:`media-link-flag` for more details. |
| 279 | |
Hans Verkuil | 8c4fe24 | 2018-06-15 09:19:44 -0400 | [diff] [blame] | 280 | * - __u32 |
Hans Verkuil | 793d2a9 | 2018-03-19 11:43:17 -0400 | [diff] [blame] | 281 | - ``reserved``\ [6] |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 282 | - Reserved for future extensions. Drivers and applications must set |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 283 | this array to zero. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 284 | |
| 285 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 286 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 287 | ============ |
| 288 | |
| 289 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 290 | appropriately. The generic error codes are described at the |
| 291 | :ref:`Generic Error Codes <gen-errors>` chapter. |
| 292 | |
| 293 | ENOSPC |
| 294 | This is returned when either one or more of the num_entities, |
| 295 | num_interfaces, num_links or num_pads are non-zero and are |
| 296 | smaller than the actual number of elements inside the graph. This |
| 297 | may happen if the ``topology_version`` changed when compared to the |
| 298 | last time this ioctl was called. Userspace should usually free the |
| 299 | area for the pointers, zero the struct elements and call this ioctl |
| 300 | again. |