Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2014 Red Hat. |
| 3 | * |
| 4 | * Permission to use, copy, modify, distribute, and sell this software and its |
| 5 | * documentation for any purpose is hereby granted without fee, provided that |
| 6 | * the above copyright notice appear in all copies and that both that copyright |
| 7 | * notice and this permission notice appear in supporting documentation, and |
| 8 | * that the name of the copyright holders not be used in advertising or |
| 9 | * publicity pertaining to distribution of the software without specific, |
| 10 | * written prior permission. The copyright holders make no representations |
| 11 | * about the suitability of this software for any purpose. It is provided "as |
| 12 | * is" without express or implied warranty. |
| 13 | * |
| 14 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
| 15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
| 16 | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
| 17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
| 18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
| 20 | * OF THIS SOFTWARE. |
| 21 | */ |
| 22 | #ifndef _DRM_DP_MST_HELPER_H_ |
| 23 | #define _DRM_DP_MST_HELPER_H_ |
| 24 | |
| 25 | #include <linux/types.h> |
| 26 | #include <drm/drm_dp_helper.h> |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 27 | #include <drm/drm_atomic.h> |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 28 | |
| 29 | struct drm_dp_mst_branch; |
| 30 | |
| 31 | /** |
Masanari Iida | 32197aa | 2014-10-20 23:53:13 +0900 | [diff] [blame] | 32 | * struct drm_dp_vcpi - Virtual Channel Payload Identifier |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 33 | * @vcpi: Virtual channel ID. |
| 34 | * @pbn: Payload Bandwidth Number for this channel |
| 35 | * @aligned_pbn: PBN aligned with slot size |
| 36 | * @num_slots: number of slots for this PBN |
| 37 | */ |
| 38 | struct drm_dp_vcpi { |
| 39 | int vcpi; |
| 40 | int pbn; |
| 41 | int aligned_pbn; |
| 42 | int num_slots; |
| 43 | }; |
| 44 | |
| 45 | /** |
| 46 | * struct drm_dp_mst_port - MST port |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 47 | * @port_num: port number |
| 48 | * @input: if this port is an input port. |
| 49 | * @mcs: message capability status - DP 1.2 spec. |
| 50 | * @ddps: DisplayPort Device Plug Status - DP 1.2 |
| 51 | * @pdt: Peer Device Type |
| 52 | * @ldps: Legacy Device Plug Status |
| 53 | * @dpcd_rev: DPCD revision of device on this port |
| 54 | * @num_sdp_streams: Number of simultaneous streams |
| 55 | * @num_sdp_stream_sinks: Number of stream sinks |
| 56 | * @available_pbn: Available bandwidth for this port. |
| 57 | * @next: link to next port on this branch device |
| 58 | * @mstb: branch device attach below this port |
| 59 | * @aux: i2c aux transport to talk to device connected to this port. |
| 60 | * @parent: branch device parent of this port |
| 61 | * @vcpi: Virtual Channel Payload info for this port. |
| 62 | * @connector: DRM connector this port is connected to. |
| 63 | * @mgr: topology manager this port lives under. |
| 64 | * |
| 65 | * This structure represents an MST port endpoint on a device somewhere |
| 66 | * in the MST topology. |
| 67 | */ |
| 68 | struct drm_dp_mst_port { |
Lyude Paul | ebcc0e6 | 2019-01-10 19:53:29 -0500 | [diff] [blame] | 69 | /** |
| 70 | * @topology_kref: refcount for this port's lifetime in the topology, |
| 71 | * only the DP MST helpers should need to touch this |
| 72 | */ |
| 73 | struct kref topology_kref; |
| 74 | |
| 75 | /** |
| 76 | * @malloc_kref: refcount for the memory allocation containing this |
| 77 | * structure. See drm_dp_mst_get_port_malloc() and |
| 78 | * drm_dp_mst_put_port_malloc(). |
| 79 | */ |
| 80 | struct kref malloc_kref; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 81 | |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 82 | u8 port_num; |
| 83 | bool input; |
| 84 | bool mcs; |
| 85 | bool ddps; |
| 86 | u8 pdt; |
| 87 | bool ldps; |
| 88 | u8 dpcd_rev; |
| 89 | u8 num_sdp_streams; |
| 90 | u8 num_sdp_stream_sinks; |
| 91 | uint16_t available_pbn; |
| 92 | struct list_head next; |
| 93 | struct drm_dp_mst_branch *mstb; /* pointer to an mstb if this port has one */ |
| 94 | struct drm_dp_aux aux; /* i2c bus for this port? */ |
| 95 | struct drm_dp_mst_branch *parent; |
| 96 | |
| 97 | struct drm_dp_vcpi vcpi; |
| 98 | struct drm_connector *connector; |
| 99 | struct drm_dp_mst_topology_mgr *mgr; |
Dave Airlie | c6a0aed | 2014-10-20 16:28:02 +1000 | [diff] [blame] | 100 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 101 | /** |
| 102 | * @cached_edid: for DP logical ports - make tiling work by ensuring |
| 103 | * that the EDID for all connectors is read immediately. |
| 104 | */ |
| 105 | struct edid *cached_edid; |
| 106 | /** |
| 107 | * @has_audio: Tracks whether the sink connector to this port is |
| 108 | * audio-capable. |
| 109 | */ |
Libin Yang | ef8f9be | 2015-12-02 14:09:43 +0800 | [diff] [blame] | 110 | bool has_audio; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 111 | }; |
| 112 | |
| 113 | /** |
| 114 | * struct drm_dp_mst_branch - MST branch device. |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 115 | * @rad: Relative Address to talk to this branch device. |
| 116 | * @lct: Link count total to talk to this branch device. |
| 117 | * @num_ports: number of ports on the branch. |
| 118 | * @msg_slots: one bit per transmitted msg slot. |
| 119 | * @ports: linked list of ports on this branch. |
| 120 | * @port_parent: pointer to the port parent, NULL if toplevel. |
| 121 | * @mgr: topology manager for this branch device. |
| 122 | * @tx_slots: transmission slots for this device. |
| 123 | * @last_seqno: last sequence number used to talk to this. |
| 124 | * @link_address_sent: if a link address message has been sent to this device yet. |
Hersen Wu | 5e93b82 | 2016-01-22 17:07:28 -0500 | [diff] [blame] | 125 | * @guid: guid for DP 1.2 branch device. port under this branch can be |
| 126 | * identified by port #. |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 127 | * |
| 128 | * This structure represents an MST branch device, there is one |
Hersen Wu | 5e93b82 | 2016-01-22 17:07:28 -0500 | [diff] [blame] | 129 | * primary branch device at the root, along with any other branches connected |
| 130 | * to downstream port of parent branches. |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 131 | */ |
| 132 | struct drm_dp_mst_branch { |
Lyude Paul | ebcc0e6 | 2019-01-10 19:53:29 -0500 | [diff] [blame] | 133 | /** |
| 134 | * @topology_kref: refcount for this branch device's lifetime in the |
| 135 | * topology, only the DP MST helpers should need to touch this |
| 136 | */ |
| 137 | struct kref topology_kref; |
| 138 | |
| 139 | /** |
| 140 | * @malloc_kref: refcount for the memory allocation containing this |
| 141 | * structure. See drm_dp_mst_get_mstb_malloc() and |
| 142 | * drm_dp_mst_put_mstb_malloc(). |
| 143 | */ |
| 144 | struct kref malloc_kref; |
| 145 | |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 146 | u8 rad[8]; |
| 147 | u8 lct; |
| 148 | int num_ports; |
| 149 | |
| 150 | int msg_slots; |
| 151 | struct list_head ports; |
| 152 | |
| 153 | /* list of tx ops queue for this port */ |
| 154 | struct drm_dp_mst_port *port_parent; |
| 155 | struct drm_dp_mst_topology_mgr *mgr; |
| 156 | |
| 157 | /* slots are protected by mstb->mgr->qlock */ |
| 158 | struct drm_dp_sideband_msg_tx *tx_slots[2]; |
| 159 | int last_seqno; |
| 160 | bool link_address_sent; |
Hersen Wu | 5e93b82 | 2016-01-22 17:07:28 -0500 | [diff] [blame] | 161 | |
| 162 | /* global unique identifier to identify branch devices */ |
| 163 | u8 guid[16]; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 164 | }; |
| 165 | |
| 166 | |
| 167 | /* sideband msg header - not bit struct */ |
| 168 | struct drm_dp_sideband_msg_hdr { |
| 169 | u8 lct; |
| 170 | u8 lcr; |
| 171 | u8 rad[8]; |
| 172 | bool broadcast; |
| 173 | bool path_msg; |
| 174 | u8 msg_len; |
| 175 | bool somt; |
| 176 | bool eomt; |
| 177 | bool seqno; |
| 178 | }; |
| 179 | |
| 180 | struct drm_dp_nak_reply { |
| 181 | u8 guid[16]; |
| 182 | u8 reason; |
| 183 | u8 nak_data; |
| 184 | }; |
| 185 | |
| 186 | struct drm_dp_link_address_ack_reply { |
| 187 | u8 guid[16]; |
| 188 | u8 nports; |
| 189 | struct drm_dp_link_addr_reply_port { |
| 190 | bool input_port; |
| 191 | u8 peer_device_type; |
| 192 | u8 port_number; |
| 193 | bool mcs; |
| 194 | bool ddps; |
| 195 | bool legacy_device_plug_status; |
| 196 | u8 dpcd_revision; |
| 197 | u8 peer_guid[16]; |
| 198 | u8 num_sdp_streams; |
| 199 | u8 num_sdp_stream_sinks; |
| 200 | } ports[16]; |
| 201 | }; |
| 202 | |
| 203 | struct drm_dp_remote_dpcd_read_ack_reply { |
| 204 | u8 port_number; |
| 205 | u8 num_bytes; |
| 206 | u8 bytes[255]; |
| 207 | }; |
| 208 | |
| 209 | struct drm_dp_remote_dpcd_write_ack_reply { |
| 210 | u8 port_number; |
| 211 | }; |
| 212 | |
| 213 | struct drm_dp_remote_dpcd_write_nak_reply { |
| 214 | u8 port_number; |
| 215 | u8 reason; |
| 216 | u8 bytes_written_before_failure; |
| 217 | }; |
| 218 | |
| 219 | struct drm_dp_remote_i2c_read_ack_reply { |
| 220 | u8 port_number; |
| 221 | u8 num_bytes; |
| 222 | u8 bytes[255]; |
| 223 | }; |
| 224 | |
| 225 | struct drm_dp_remote_i2c_read_nak_reply { |
| 226 | u8 port_number; |
| 227 | u8 nak_reason; |
| 228 | u8 i2c_nak_transaction; |
| 229 | }; |
| 230 | |
| 231 | struct drm_dp_remote_i2c_write_ack_reply { |
| 232 | u8 port_number; |
| 233 | }; |
| 234 | |
| 235 | |
| 236 | struct drm_dp_sideband_msg_rx { |
| 237 | u8 chunk[48]; |
| 238 | u8 msg[256]; |
| 239 | u8 curchunk_len; |
| 240 | u8 curchunk_idx; /* chunk we are parsing now */ |
| 241 | u8 curchunk_hdrlen; |
| 242 | u8 curlen; /* total length of the msg */ |
| 243 | bool have_somt; |
| 244 | bool have_eomt; |
| 245 | struct drm_dp_sideband_msg_hdr initial_hdr; |
| 246 | }; |
| 247 | |
Libin Yang | ef8f9be | 2015-12-02 14:09:43 +0800 | [diff] [blame] | 248 | #define DRM_DP_MAX_SDP_STREAMS 16 |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 249 | struct drm_dp_allocate_payload { |
| 250 | u8 port_number; |
| 251 | u8 number_sdp_streams; |
| 252 | u8 vcpi; |
| 253 | u16 pbn; |
Libin Yang | ef8f9be | 2015-12-02 14:09:43 +0800 | [diff] [blame] | 254 | u8 sdp_stream_sink[DRM_DP_MAX_SDP_STREAMS]; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 255 | }; |
| 256 | |
| 257 | struct drm_dp_allocate_payload_ack_reply { |
| 258 | u8 port_number; |
| 259 | u8 vcpi; |
| 260 | u16 allocated_pbn; |
| 261 | }; |
| 262 | |
| 263 | struct drm_dp_connection_status_notify { |
| 264 | u8 guid[16]; |
| 265 | u8 port_number; |
| 266 | bool legacy_device_plug_status; |
| 267 | bool displayport_device_plug_status; |
| 268 | bool message_capability_status; |
| 269 | bool input_port; |
| 270 | u8 peer_device_type; |
| 271 | }; |
| 272 | |
| 273 | struct drm_dp_remote_dpcd_read { |
| 274 | u8 port_number; |
| 275 | u32 dpcd_address; |
| 276 | u8 num_bytes; |
| 277 | }; |
| 278 | |
| 279 | struct drm_dp_remote_dpcd_write { |
| 280 | u8 port_number; |
| 281 | u32 dpcd_address; |
| 282 | u8 num_bytes; |
| 283 | u8 *bytes; |
| 284 | }; |
| 285 | |
Dave Airlie | ae49154 | 2015-10-14 18:51:17 +1000 | [diff] [blame] | 286 | #define DP_REMOTE_I2C_READ_MAX_TRANSACTIONS 4 |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 287 | struct drm_dp_remote_i2c_read { |
| 288 | u8 num_transactions; |
| 289 | u8 port_number; |
| 290 | struct { |
| 291 | u8 i2c_dev_id; |
| 292 | u8 num_bytes; |
| 293 | u8 *bytes; |
| 294 | u8 no_stop_bit; |
| 295 | u8 i2c_transaction_delay; |
Dave Airlie | ae49154 | 2015-10-14 18:51:17 +1000 | [diff] [blame] | 296 | } transactions[DP_REMOTE_I2C_READ_MAX_TRANSACTIONS]; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 297 | u8 read_i2c_device_id; |
| 298 | u8 num_bytes_read; |
| 299 | }; |
| 300 | |
| 301 | struct drm_dp_remote_i2c_write { |
| 302 | u8 port_number; |
| 303 | u8 write_i2c_device_id; |
| 304 | u8 num_bytes; |
| 305 | u8 *bytes; |
| 306 | }; |
| 307 | |
| 308 | /* this covers ENUM_RESOURCES, POWER_DOWN_PHY, POWER_UP_PHY */ |
| 309 | struct drm_dp_port_number_req { |
| 310 | u8 port_number; |
| 311 | }; |
| 312 | |
| 313 | struct drm_dp_enum_path_resources_ack_reply { |
| 314 | u8 port_number; |
| 315 | u16 full_payload_bw_number; |
| 316 | u16 avail_payload_bw_number; |
| 317 | }; |
| 318 | |
| 319 | /* covers POWER_DOWN_PHY, POWER_UP_PHY */ |
| 320 | struct drm_dp_port_number_rep { |
| 321 | u8 port_number; |
| 322 | }; |
| 323 | |
| 324 | struct drm_dp_query_payload { |
| 325 | u8 port_number; |
| 326 | u8 vcpi; |
| 327 | }; |
| 328 | |
| 329 | struct drm_dp_resource_status_notify { |
| 330 | u8 port_number; |
| 331 | u8 guid[16]; |
| 332 | u16 available_pbn; |
| 333 | }; |
| 334 | |
| 335 | struct drm_dp_query_payload_ack_reply { |
| 336 | u8 port_number; |
| 337 | u8 allocated_pbn; |
| 338 | }; |
| 339 | |
| 340 | struct drm_dp_sideband_msg_req_body { |
| 341 | u8 req_type; |
| 342 | union ack_req { |
| 343 | struct drm_dp_connection_status_notify conn_stat; |
| 344 | struct drm_dp_port_number_req port_num; |
| 345 | struct drm_dp_resource_status_notify resource_stat; |
| 346 | |
| 347 | struct drm_dp_query_payload query_payload; |
| 348 | struct drm_dp_allocate_payload allocate_payload; |
| 349 | |
| 350 | struct drm_dp_remote_dpcd_read dpcd_read; |
| 351 | struct drm_dp_remote_dpcd_write dpcd_write; |
| 352 | |
| 353 | struct drm_dp_remote_i2c_read i2c_read; |
| 354 | struct drm_dp_remote_i2c_write i2c_write; |
| 355 | } u; |
| 356 | }; |
| 357 | |
| 358 | struct drm_dp_sideband_msg_reply_body { |
| 359 | u8 reply_type; |
| 360 | u8 req_type; |
| 361 | union ack_replies { |
| 362 | struct drm_dp_nak_reply nak; |
| 363 | struct drm_dp_link_address_ack_reply link_addr; |
| 364 | struct drm_dp_port_number_rep port_number; |
| 365 | |
| 366 | struct drm_dp_enum_path_resources_ack_reply path_resources; |
| 367 | struct drm_dp_allocate_payload_ack_reply allocate_payload; |
| 368 | struct drm_dp_query_payload_ack_reply query_payload; |
| 369 | |
| 370 | struct drm_dp_remote_dpcd_read_ack_reply remote_dpcd_read_ack; |
| 371 | struct drm_dp_remote_dpcd_write_ack_reply remote_dpcd_write_ack; |
| 372 | struct drm_dp_remote_dpcd_write_nak_reply remote_dpcd_write_nack; |
| 373 | |
| 374 | struct drm_dp_remote_i2c_read_ack_reply remote_i2c_read_ack; |
| 375 | struct drm_dp_remote_i2c_read_nak_reply remote_i2c_read_nack; |
| 376 | struct drm_dp_remote_i2c_write_ack_reply remote_i2c_write_ack; |
| 377 | } u; |
| 378 | }; |
| 379 | |
| 380 | /* msg is queued to be put into a slot */ |
| 381 | #define DRM_DP_SIDEBAND_TX_QUEUED 0 |
| 382 | /* msg has started transmitting on a slot - still on msgq */ |
| 383 | #define DRM_DP_SIDEBAND_TX_START_SEND 1 |
| 384 | /* msg has finished transmitting on a slot - removed from msgq only in slot */ |
| 385 | #define DRM_DP_SIDEBAND_TX_SENT 2 |
| 386 | /* msg has received a response - removed from slot */ |
| 387 | #define DRM_DP_SIDEBAND_TX_RX 3 |
| 388 | #define DRM_DP_SIDEBAND_TX_TIMEOUT 4 |
| 389 | |
| 390 | struct drm_dp_sideband_msg_tx { |
| 391 | u8 msg[256]; |
| 392 | u8 chunk[48]; |
| 393 | u8 cur_offset; |
| 394 | u8 cur_len; |
| 395 | struct drm_dp_mst_branch *dst; |
| 396 | struct list_head next; |
| 397 | int seqno; |
| 398 | int state; |
| 399 | bool path_msg; |
| 400 | struct drm_dp_sideband_msg_reply_body reply; |
| 401 | }; |
| 402 | |
| 403 | /* sideband msg handler */ |
| 404 | struct drm_dp_mst_topology_mgr; |
| 405 | struct drm_dp_mst_topology_cbs { |
| 406 | /* create a connector for a port */ |
Thierry Reding | 12e6cec | 2014-05-13 11:38:36 +0200 | [diff] [blame] | 407 | struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path); |
Dave Airlie | d9515c5 | 2015-09-16 17:55:23 +1000 | [diff] [blame] | 408 | void (*register_connector)(struct drm_connector *connector); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 409 | void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr, |
| 410 | struct drm_connector *connector); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 411 | }; |
| 412 | |
| 413 | #define DP_MAX_PAYLOAD (sizeof(unsigned long) * 8) |
| 414 | |
| 415 | #define DP_PAYLOAD_LOCAL 1 |
| 416 | #define DP_PAYLOAD_REMOTE 2 |
| 417 | #define DP_PAYLOAD_DELETE_LOCAL 3 |
| 418 | |
| 419 | struct drm_dp_payload { |
| 420 | int payload_state; |
| 421 | int start_slot; |
| 422 | int num_slots; |
Dave Airlie | dfda0df | 2014-08-06 16:26:21 +1000 | [diff] [blame] | 423 | int vcpi; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 424 | }; |
| 425 | |
Ville Syrjälä | a4370c7 | 2017-07-12 18:51:02 +0300 | [diff] [blame] | 426 | #define to_dp_mst_topology_state(x) container_of(x, struct drm_dp_mst_topology_state, base) |
| 427 | |
Lyude Paul | eceae14 | 2019-01-10 19:53:41 -0500 | [diff] [blame] | 428 | struct drm_dp_vcpi_allocation { |
| 429 | struct drm_dp_mst_port *port; |
| 430 | int vcpi; |
| 431 | struct list_head next; |
| 432 | }; |
| 433 | |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 434 | struct drm_dp_mst_topology_state { |
Ville Syrjälä | a4370c7 | 2017-07-12 18:51:02 +0300 | [diff] [blame] | 435 | struct drm_private_state base; |
Lyude Paul | eceae14 | 2019-01-10 19:53:41 -0500 | [diff] [blame] | 436 | struct list_head vcpis; |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 437 | struct drm_dp_mst_topology_mgr *mgr; |
| 438 | }; |
| 439 | |
Ville Syrjälä | a4370c7 | 2017-07-12 18:51:02 +0300 | [diff] [blame] | 440 | #define to_dp_mst_topology_mgr(x) container_of(x, struct drm_dp_mst_topology_mgr, base) |
| 441 | |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 442 | /** |
| 443 | * struct drm_dp_mst_topology_mgr - DisplayPort MST manager |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 444 | * |
| 445 | * This struct represents the toplevel displayport MST topology manager. |
| 446 | * There should be one instance of this for every MST capable DP connector |
| 447 | * on the GPU. |
| 448 | */ |
| 449 | struct drm_dp_mst_topology_mgr { |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 450 | /** |
Ville Syrjälä | a4370c7 | 2017-07-12 18:51:02 +0300 | [diff] [blame] | 451 | * @base: Base private object for atomic |
| 452 | */ |
| 453 | struct drm_private_obj base; |
| 454 | |
| 455 | /** |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 456 | * @dev: device pointer for adding i2c devices etc. |
| 457 | */ |
Dhinakaran Pandiyan | 7b0a89a | 2017-01-24 15:49:29 -0800 | [diff] [blame] | 458 | struct drm_device *dev; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 459 | /** |
| 460 | * @cbs: callbacks for connector addition and destruction. |
| 461 | */ |
Julia Lawall | 69a0f89 | 2015-12-30 22:20:30 +0100 | [diff] [blame] | 462 | const struct drm_dp_mst_topology_cbs *cbs; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 463 | /** |
| 464 | * @max_dpcd_transaction_bytes: maximum number of bytes to read/write |
| 465 | * in one go. |
| 466 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 467 | int max_dpcd_transaction_bytes; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 468 | /** |
| 469 | * @aux: AUX channel for the DP MST connector this topolgy mgr is |
| 470 | * controlling. |
| 471 | */ |
| 472 | struct drm_dp_aux *aux; |
| 473 | /** |
| 474 | * @max_payloads: maximum number of payloads the GPU can generate. |
| 475 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 476 | int max_payloads; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 477 | /** |
| 478 | * @conn_base_id: DRM connector ID this mgr is connected to. Only used |
| 479 | * to build the MST connector path value. |
| 480 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 481 | int conn_base_id; |
| 482 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 483 | /** |
| 484 | * @down_rep_recv: Message receiver state for down replies. This and |
| 485 | * @up_req_recv are only ever access from the work item, which is |
| 486 | * serialised. |
| 487 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 488 | struct drm_dp_sideband_msg_rx down_rep_recv; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 489 | /** |
| 490 | * @up_req_recv: Message receiver state for up requests. This and |
| 491 | * @down_rep_recv are only ever access from the work item, which is |
| 492 | * serialised. |
| 493 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 494 | struct drm_dp_sideband_msg_rx up_req_recv; |
| 495 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 496 | /** |
| 497 | * @lock: protects mst state, primary, dpcd. |
| 498 | */ |
| 499 | struct mutex lock; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 500 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 501 | /** |
| 502 | * @mst_state: If this manager is enabled for an MST capable port. False |
| 503 | * if no MST sink/branch devices is connected. |
| 504 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 505 | bool mst_state; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 506 | /** |
| 507 | * @mst_primary: Pointer to the primary/first branch device. |
| 508 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 509 | struct drm_dp_mst_branch *mst_primary; |
Hersen Wu | 5e93b82 | 2016-01-22 17:07:28 -0500 | [diff] [blame] | 510 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 511 | /** |
| 512 | * @dpcd: Cache of DPCD for primary port. |
| 513 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 514 | u8 dpcd[DP_RECEIVER_CAP_SIZE]; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 515 | /** |
| 516 | * @sink_count: Sink count from DEVICE_SERVICE_IRQ_VECTOR_ESI0. |
| 517 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 518 | u8 sink_count; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 519 | /** |
| 520 | * @pbn_div: PBN to slots divisor. |
| 521 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 522 | int pbn_div; |
Pandiyan, Dhinakaran | a538d61 | 2017-03-16 00:10:24 -0700 | [diff] [blame] | 523 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 524 | /** |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 525 | * @funcs: Atomic helper callbacks |
| 526 | */ |
| 527 | const struct drm_private_state_funcs *funcs; |
| 528 | |
| 529 | /** |
Daniel Vetter | 6806cdf | 2017-01-25 07:26:43 +0100 | [diff] [blame] | 530 | * @qlock: protects @tx_msg_downq, the &drm_dp_mst_branch.txslost and |
| 531 | * &drm_dp_sideband_msg_tx.state once they are queued |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 532 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 533 | struct mutex qlock; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 534 | /** |
| 535 | * @tx_msg_downq: List of pending down replies. |
| 536 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 537 | struct list_head tx_msg_downq; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 538 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 539 | /** |
| 540 | * @payload_lock: Protect payload information. |
| 541 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 542 | struct mutex payload_lock; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 543 | /** |
| 544 | * @proposed_vcpis: Array of pointers for the new VCPI allocation. The |
Daniel Vetter | 6806cdf | 2017-01-25 07:26:43 +0100 | [diff] [blame] | 545 | * VCPI structure itself is &drm_dp_mst_port.vcpi. |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 546 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 547 | struct drm_dp_vcpi **proposed_vcpis; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 548 | /** |
| 549 | * @payloads: Array of payloads. |
| 550 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 551 | struct drm_dp_payload *payloads; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 552 | /** |
| 553 | * @payload_mask: Elements of @payloads actually in use. Since |
| 554 | * reallocation of active outputs isn't possible gaps can be created by |
| 555 | * disabling outputs out of order compared to how they've been enabled. |
| 556 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 557 | unsigned long payload_mask; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 558 | /** |
| 559 | * @vcpi_mask: Similar to @payload_mask, but for @proposed_vcpis. |
| 560 | */ |
Dave Airlie | dfda0df | 2014-08-06 16:26:21 +1000 | [diff] [blame] | 561 | unsigned long vcpi_mask; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 562 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 563 | /** |
| 564 | * @tx_waitq: Wait to queue stall for the tx worker. |
| 565 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 566 | wait_queue_head_t tx_waitq; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 567 | /** |
| 568 | * @work: Probe work. |
| 569 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 570 | struct work_struct work; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 571 | /** |
| 572 | * @tx_work: Sideband transmit worker. This can nest within the main |
| 573 | * @work worker for each transaction @work launches. |
| 574 | */ |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 575 | struct work_struct tx_work; |
Dave Airlie | 6b8eeca | 2015-06-15 10:34:28 +1000 | [diff] [blame] | 576 | |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 577 | /** |
| 578 | * @destroy_connector_list: List of to be destroyed connectors. |
| 579 | */ |
Dave Airlie | 6b8eeca | 2015-06-15 10:34:28 +1000 | [diff] [blame] | 580 | struct list_head destroy_connector_list; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 581 | /** |
| 582 | * @destroy_connector_lock: Protects @connector_list. |
| 583 | */ |
Dave Airlie | 6b8eeca | 2015-06-15 10:34:28 +1000 | [diff] [blame] | 584 | struct mutex destroy_connector_lock; |
Daniel Vetter | 132d49d | 2016-07-15 21:48:04 +0200 | [diff] [blame] | 585 | /** |
| 586 | * @destroy_connector_work: Work item to destroy connectors. Needed to |
| 587 | * avoid locking inversion. |
| 588 | */ |
Dave Airlie | 6b8eeca | 2015-06-15 10:34:28 +1000 | [diff] [blame] | 589 | struct work_struct destroy_connector_work; |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 590 | }; |
| 591 | |
Dhinakaran Pandiyan | 7b0a89a | 2017-01-24 15:49:29 -0800 | [diff] [blame] | 592 | int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, |
| 593 | struct drm_device *dev, struct drm_dp_aux *aux, |
| 594 | int max_dpcd_transaction_bytes, |
| 595 | int max_payloads, int conn_base_id); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 596 | |
| 597 | void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr); |
| 598 | |
| 599 | |
| 600 | int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool mst_state); |
| 601 | |
| 602 | |
| 603 | int drm_dp_mst_hpd_irq(struct drm_dp_mst_topology_mgr *mgr, u8 *esi, bool *handled); |
| 604 | |
| 605 | |
Dave Airlie | c6a0aed | 2014-10-20 16:28:02 +1000 | [diff] [blame] | 606 | enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 607 | |
Libin Yang | ef8f9be | 2015-12-02 14:09:43 +0800 | [diff] [blame] | 608 | bool drm_dp_mst_port_has_audio(struct drm_dp_mst_topology_mgr *mgr, |
| 609 | struct drm_dp_mst_port *port); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 610 | struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); |
| 611 | |
| 612 | |
| 613 | int drm_dp_calc_pbn_mode(int clock, int bpp); |
| 614 | |
| 615 | |
Pandiyan, Dhinakaran | 1e797f5 | 2017-03-16 00:10:26 -0700 | [diff] [blame] | 616 | bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, |
| 617 | struct drm_dp_mst_port *port, int pbn, int slots); |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 618 | |
Dave Airlie | 87f5942 | 2015-02-24 09:23:55 +1000 | [diff] [blame] | 619 | int drm_dp_mst_get_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); |
| 620 | |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 621 | |
| 622 | void drm_dp_mst_reset_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); |
| 623 | |
| 624 | |
| 625 | void drm_dp_mst_deallocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, |
| 626 | struct drm_dp_mst_port *port); |
| 627 | |
| 628 | |
| 629 | int drm_dp_find_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, |
| 630 | int pbn); |
| 631 | |
| 632 | |
| 633 | int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr); |
| 634 | |
| 635 | |
| 636 | int drm_dp_update_payload_part2(struct drm_dp_mst_topology_mgr *mgr); |
| 637 | |
| 638 | int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr); |
| 639 | |
| 640 | void drm_dp_mst_dump_topology(struct seq_file *m, |
| 641 | struct drm_dp_mst_topology_mgr *mgr); |
| 642 | |
| 643 | void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr); |
Lyude Paul | c235316 | 2019-01-08 16:11:29 -0500 | [diff] [blame] | 644 | int __must_check |
| 645 | drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr); |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 646 | struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_atomic_state *state, |
| 647 | struct drm_dp_mst_topology_mgr *mgr); |
Lyude Paul | eceae14 | 2019-01-10 19:53:41 -0500 | [diff] [blame] | 648 | int __must_check |
| 649 | drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, |
| 650 | struct drm_dp_mst_topology_mgr *mgr, |
| 651 | struct drm_dp_mst_port *port, int pbn); |
| 652 | int __must_check |
| 653 | drm_dp_atomic_release_vcpi_slots(struct drm_atomic_state *state, |
| 654 | struct drm_dp_mst_topology_mgr *mgr, |
| 655 | struct drm_dp_mst_port *port); |
Dhinakaran Pandiyan | 0bb9c2b | 2017-09-06 17:14:58 -0700 | [diff] [blame] | 656 | int drm_dp_send_power_updown_phy(struct drm_dp_mst_topology_mgr *mgr, |
| 657 | struct drm_dp_mst_port *port, bool power_up); |
Lyude Paul | eceae14 | 2019-01-10 19:53:41 -0500 | [diff] [blame] | 658 | int __must_check drm_dp_mst_atomic_check(struct drm_atomic_state *state); |
Pandiyan, Dhinakaran | 3f3353b | 2017-04-20 22:51:31 -0700 | [diff] [blame] | 659 | |
Lyude Paul | ebcc0e6 | 2019-01-10 19:53:29 -0500 | [diff] [blame] | 660 | void drm_dp_mst_get_port_malloc(struct drm_dp_mst_port *port); |
| 661 | void drm_dp_mst_put_port_malloc(struct drm_dp_mst_port *port); |
| 662 | |
Lyude Paul | bea5c38 | 2019-01-10 19:53:40 -0500 | [diff] [blame] | 663 | extern const struct drm_private_state_funcs drm_dp_mst_topology_state_funcs; |
| 664 | |
| 665 | /** |
| 666 | * __drm_dp_mst_state_iter_get - private atomic state iterator function for |
| 667 | * macro-internal use |
| 668 | * @state: &struct drm_atomic_state pointer |
| 669 | * @mgr: pointer to the &struct drm_dp_mst_topology_mgr iteration cursor |
| 670 | * @old_state: optional pointer to the old &struct drm_dp_mst_topology_state |
| 671 | * iteration cursor |
| 672 | * @new_state: optional pointer to the new &struct drm_dp_mst_topology_state |
| 673 | * iteration cursor |
| 674 | * @i: int iteration cursor, for macro-internal use |
| 675 | * |
| 676 | * Used by for_each_oldnew_mst_mgr_in_state(), |
| 677 | * for_each_old_mst_mgr_in_state(), and for_each_new_mst_mgr_in_state(). Don't |
| 678 | * call this directly. |
| 679 | * |
| 680 | * Returns: |
| 681 | * True if the current &struct drm_private_obj is a &struct |
| 682 | * drm_dp_mst_topology_mgr, false otherwise. |
| 683 | */ |
| 684 | static inline bool |
| 685 | __drm_dp_mst_state_iter_get(struct drm_atomic_state *state, |
| 686 | struct drm_dp_mst_topology_mgr **mgr, |
| 687 | struct drm_dp_mst_topology_state **old_state, |
| 688 | struct drm_dp_mst_topology_state **new_state, |
| 689 | int i) |
| 690 | { |
| 691 | struct __drm_private_objs_state *objs_state = &state->private_objs[i]; |
| 692 | |
| 693 | if (objs_state->ptr->funcs != &drm_dp_mst_topology_state_funcs) |
| 694 | return false; |
| 695 | |
| 696 | *mgr = to_dp_mst_topology_mgr(objs_state->ptr); |
| 697 | if (old_state) |
| 698 | *old_state = to_dp_mst_topology_state(objs_state->old_state); |
| 699 | if (new_state) |
| 700 | *new_state = to_dp_mst_topology_state(objs_state->new_state); |
| 701 | |
| 702 | return true; |
| 703 | } |
| 704 | |
| 705 | /** |
| 706 | * for_each_oldnew_mst_mgr_in_state - iterate over all DP MST topology |
| 707 | * managers in an atomic update |
| 708 | * @__state: &struct drm_atomic_state pointer |
| 709 | * @mgr: &struct drm_dp_mst_topology_mgr iteration cursor |
| 710 | * @old_state: &struct drm_dp_mst_topology_state iteration cursor for the old |
| 711 | * state |
| 712 | * @new_state: &struct drm_dp_mst_topology_state iteration cursor for the new |
| 713 | * state |
| 714 | * @__i: int iteration cursor, for macro-internal use |
| 715 | * |
| 716 | * This iterates over all DRM DP MST topology managers in an atomic update, |
| 717 | * tracking both old and new state. This is useful in places where the state |
| 718 | * delta needs to be considered, for example in atomic check functions. |
| 719 | */ |
| 720 | #define for_each_oldnew_mst_mgr_in_state(__state, mgr, old_state, new_state, __i) \ |
| 721 | for ((__i) = 0; (__i) < (__state)->num_private_objs; (__i)++) \ |
| 722 | for_each_if(__drm_dp_mst_state_iter_get((__state), &(mgr), &(old_state), &(new_state), (__i))) |
| 723 | |
| 724 | /** |
| 725 | * for_each_old_mst_mgr_in_state - iterate over all DP MST topology managers |
| 726 | * in an atomic update |
| 727 | * @__state: &struct drm_atomic_state pointer |
| 728 | * @mgr: &struct drm_dp_mst_topology_mgr iteration cursor |
| 729 | * @old_state: &struct drm_dp_mst_topology_state iteration cursor for the old |
| 730 | * state |
| 731 | * @__i: int iteration cursor, for macro-internal use |
| 732 | * |
| 733 | * This iterates over all DRM DP MST topology managers in an atomic update, |
| 734 | * tracking only the old state. This is useful in disable functions, where we |
| 735 | * need the old state the hardware is still in. |
| 736 | */ |
| 737 | #define for_each_old_mst_mgr_in_state(__state, mgr, old_state, __i) \ |
| 738 | for ((__i) = 0; (__i) < (__state)->num_private_objs; (__i)++) \ |
| 739 | for_each_if(__drm_dp_mst_state_iter_get((__state), &(mgr), &(old_state), NULL, (__i))) |
| 740 | |
| 741 | /** |
| 742 | * for_each_new_mst_mgr_in_state - iterate over all DP MST topology managers |
| 743 | * in an atomic update |
| 744 | * @__state: &struct drm_atomic_state pointer |
| 745 | * @mgr: &struct drm_dp_mst_topology_mgr iteration cursor |
| 746 | * @new_state: &struct drm_dp_mst_topology_state iteration cursor for the new |
| 747 | * state |
| 748 | * @__i: int iteration cursor, for macro-internal use |
| 749 | * |
| 750 | * This iterates over all DRM DP MST topology managers in an atomic update, |
| 751 | * tracking only the new state. This is useful in enable functions, where we |
| 752 | * need the new state the hardware should be in when the atomic commit |
| 753 | * operation has completed. |
| 754 | */ |
| 755 | #define for_each_new_mst_mgr_in_state(__state, mgr, new_state, __i) \ |
| 756 | for ((__i) = 0; (__i) < (__state)->num_private_objs; (__i)++) \ |
| 757 | for_each_if(__drm_dp_mst_state_iter_get((__state), &(mgr), NULL, &(new_state), (__i))) |
| 758 | |
Dave Airlie | ad7f8a1 | 2014-06-05 14:01:32 +1000 | [diff] [blame] | 759 | #endif |