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