Blame view

include/drm/drm_bridge.h 32.8 KB
199e4e967   Daniel Vetter   drm: Extract drm_...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  /*
   * Copyright (c) 2016 Intel Corporation
   *
   * Permission to use, copy, modify, distribute, and sell this software and its
   * documentation for any purpose is hereby granted without fee, provided that
   * the above copyright notice appear in all copies and that both that copyright
   * notice and this permission notice appear in supporting documentation, and
   * that the name of the copyright holders not be used in advertising or
   * publicity pertaining to distribution of the software without specific,
   * written prior permission.  The copyright holders make no representations
   * about the suitability of this software for any purpose.  It is provided "as
   * is" without express or implied warranty.
   *
   * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
   * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
   * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
   * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
   * OF THIS SOFTWARE.
   */
  
  #ifndef __DRM_BRIDGE_H__
  #define __DRM_BRIDGE_H__
199e4e967   Daniel Vetter   drm: Extract drm_...
25
  #include <linux/ctype.h>
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
26
27
  #include <linux/list.h>
  #include <linux/mutex.h>
751465913   Boris Brezillon   drm/bridge: Add a...
28
29
  
  #include <drm/drm_atomic.h>
35a61fe92   Boris Brezillon   drm: Stop accessi...
30
  #include <drm/drm_encoder.h>
199e4e967   Daniel Vetter   drm: Extract drm_...
31
32
33
34
  #include <drm/drm_mode_object.h>
  #include <drm/drm_modes.h>
  
  struct drm_bridge;
36a776df6   Linus Walleij   drm/bridge: Provi...
35
  struct drm_bridge_timings;
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
36
  struct drm_connector;
12c683e12   Laurent Pinchart   drm: bridge: Pass...
37
  struct drm_display_info;
13dfc0540   Eric Anholt   drm/bridge: Refac...
38
  struct drm_panel;
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
39
40
  struct edid;
  struct i2c_adapter;
199e4e967   Daniel Vetter   drm: Extract drm_...
41
42
  
  /**
a25b988ff   Laurent Pinchart   drm/bridge: Exten...
43
44
45
46
47
48
49
50
51
52
53
   * enum drm_bridge_attach_flags - Flags for &drm_bridge_funcs.attach
   */
  enum drm_bridge_attach_flags {
  	/**
  	 * @DRM_BRIDGE_ATTACH_NO_CONNECTOR: When this flag is set the bridge
  	 * shall not create a drm_connector.
  	 */
  	DRM_BRIDGE_ATTACH_NO_CONNECTOR = BIT(0),
  };
  
  /**
199e4e967   Daniel Vetter   drm: Extract drm_...
54
55
56
57
58
59
60
   * struct drm_bridge_funcs - drm_bridge control functions
   */
  struct drm_bridge_funcs {
  	/**
  	 * @attach:
  	 *
  	 * This callback is invoked whenever our bridge is being attached to a
a25b988ff   Laurent Pinchart   drm/bridge: Exten...
61
62
  	 * &drm_encoder. The flags argument tunes the behaviour of the attach
  	 * operation (see DRM_BRIDGE_ATTACH_*).
199e4e967   Daniel Vetter   drm: Extract drm_...
63
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
64
  	 * The @attach callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
65
66
67
68
69
  	 *
  	 * RETURNS:
  	 *
  	 * Zero on success, error code on failure.
  	 */
a25b988ff   Laurent Pinchart   drm/bridge: Exten...
70
71
  	int (*attach)(struct drm_bridge *bridge,
  		      enum drm_bridge_attach_flags flags);
199e4e967   Daniel Vetter   drm: Extract drm_...
72
73
74
75
76
77
78
  
  	/**
  	 * @detach:
  	 *
  	 * This callback is invoked whenever our bridge is being detached from a
  	 * &drm_encoder.
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
79
  	 * The @detach callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
80
81
82
83
  	 */
  	void (*detach)(struct drm_bridge *bridge);
  
  	/**
3eb220a53   Jose Abreu   drm: Add crtc/enc...
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  	 * @mode_valid:
  	 *
  	 * This callback is used to check if a specific mode is valid in this
  	 * bridge. This should be implemented if the bridge has some sort of
  	 * restriction in the modes it can display. For example, a given bridge
  	 * may be responsible to set a clock value. If the clock can not
  	 * produce all the values for the available modes then this callback
  	 * can be used to restrict the number of modes to only the ones that
  	 * can be displayed.
  	 *
  	 * This hook is used by the probe helpers to filter the mode list in
  	 * drm_helper_probe_single_connector_modes(), and it is used by the
  	 * atomic helpers to validate modes supplied by userspace in
  	 * drm_atomic_helper_check_modeset().
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
99
  	 * The @mode_valid callback is optional.
3eb220a53   Jose Abreu   drm: Add crtc/enc...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  	 *
  	 * NOTE:
  	 *
  	 * Since this function is both called from the check phase of an atomic
  	 * commit, and the mode validation in the probe paths it is not allowed
  	 * to look at anything else but the passed-in mode, and validate it
  	 * against configuration-invariant hardward constraints. Any further
  	 * limits which depend upon the configuration can only be checked in
  	 * @mode_fixup.
  	 *
  	 * RETURNS:
  	 *
  	 * drm_mode_status Enum
  	 */
312924d3b   Linus Walleij   drm/bridge: Renam...
114
  	enum drm_mode_status (*mode_valid)(struct drm_bridge *bridge,
12c683e12   Laurent Pinchart   drm: bridge: Pass...
115
  					   const struct drm_display_info *info,
3eb220a53   Jose Abreu   drm: Add crtc/enc...
116
117
118
  					   const struct drm_display_mode *mode);
  
  	/**
199e4e967   Daniel Vetter   drm: Extract drm_...
119
120
  	 * @mode_fixup:
  	 *
5d435b46f   Philippe Cornu   drm/bridge: spell...
121
  	 * This callback is used to validate and adjust a mode. The parameter
199e4e967   Daniel Vetter   drm: Extract drm_...
122
123
124
125
  	 * mode is the display mode that should be fed to the next element in
  	 * the display chain, either the final &drm_connector or the next
  	 * &drm_bridge. The parameter adjusted_mode is the input mode the bridge
  	 * requires. It can be modified by this callback and does not need to
9de5d4a61   Daniel Vetter   drm/doc: Document...
126
  	 * match mode. See also &drm_crtc_state.adjusted_mode for more details.
199e4e967   Daniel Vetter   drm: Extract drm_...
127
128
129
130
131
  	 *
  	 * This is the only hook that allows a bridge to reject a modeset. If
  	 * this function passes all other callbacks must succeed for this
  	 * configuration.
  	 *
5061b8a96   Boris Brezillon   drm/bridge: Add a...
132
133
134
  	 * The mode_fixup callback is optional. &drm_bridge_funcs.mode_fixup()
  	 * is not called when &drm_bridge_funcs.atomic_check() is implemented,
  	 * so only one of them should be provided.
199e4e967   Daniel Vetter   drm: Extract drm_...
135
136
137
138
139
140
141
142
143
  	 *
  	 * NOTE:
  	 *
  	 * This function is called in the check phase of atomic modesets, which
  	 * can be aborted for any reason (including on userspace's request to
  	 * just check whether a configuration would be possible). Drivers MUST
  	 * NOT touch any persistent state (hardware or software) or data
  	 * structures except the passed in @state parameter.
  	 *
3eb220a53   Jose Abreu   drm: Add crtc/enc...
144
145
146
147
148
149
  	 * Also beware that userspace can request its own custom modes, neither
  	 * core nor helpers filter modes to the list of probe modes reported by
  	 * the GETCONNECTOR IOCTL and stored in &drm_connector.modes. To ensure
  	 * that modes are filtered consistently put any bridge constraints and
  	 * limits checks into @mode_valid.
  	 *
199e4e967   Daniel Vetter   drm: Extract drm_...
150
151
152
153
154
155
156
157
158
159
160
161
162
163
  	 * RETURNS:
  	 *
  	 * True if an acceptable configuration is possible, false if the modeset
  	 * operation should be rejected.
  	 */
  	bool (*mode_fixup)(struct drm_bridge *bridge,
  			   const struct drm_display_mode *mode,
  			   struct drm_display_mode *adjusted_mode);
  	/**
  	 * @disable:
  	 *
  	 * This callback should disable the bridge. It is called right before
  	 * the preceding element in the display pipe is disabled. If the
  	 * preceding element is a bridge this means it's called before that
4541d31e2   Daniel Vetter   drm/bridge: Use r...
164
165
166
167
  	 * bridge's @disable vfunc. If the preceding element is a &drm_encoder
  	 * it's called right before the &drm_encoder_helper_funcs.disable,
  	 * &drm_encoder_helper_funcs.prepare or &drm_encoder_helper_funcs.dpms
  	 * hook.
199e4e967   Daniel Vetter   drm: Extract drm_...
168
169
170
171
  	 *
  	 * The bridge can assume that the display pipe (i.e. clocks and timing
  	 * signals) feeding it is still running when this callback is called.
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
172
  	 * The @disable callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
173
174
175
176
177
178
  	 */
  	void (*disable)(struct drm_bridge *bridge);
  
  	/**
  	 * @post_disable:
  	 *
4541d31e2   Daniel Vetter   drm/bridge: Use r...
179
180
181
182
183
184
185
  	 * This callback should disable the bridge. It is called right after the
  	 * preceding element in the display pipe is disabled. If the preceding
  	 * element is a bridge this means it's called after that bridge's
  	 * @post_disable function. If the preceding element is a &drm_encoder
  	 * it's called right after the encoder's
  	 * &drm_encoder_helper_funcs.disable, &drm_encoder_helper_funcs.prepare
  	 * or &drm_encoder_helper_funcs.dpms hook.
199e4e967   Daniel Vetter   drm: Extract drm_...
186
187
188
189
190
  	 *
  	 * The bridge must assume that the display pipe (i.e. clocks and timing
  	 * singals) feeding it is no longer running when this callback is
  	 * called.
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
191
  	 * The @post_disable callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
192
193
194
195
196
197
198
  	 */
  	void (*post_disable)(struct drm_bridge *bridge);
  
  	/**
  	 * @mode_set:
  	 *
  	 * This callback should set the given mode on the bridge. It is called
4541d31e2   Daniel Vetter   drm/bridge: Use r...
199
200
201
202
203
  	 * after the @mode_set callback for the preceding element in the display
  	 * pipeline has been called already. If the bridge is the first element
  	 * then this would be &drm_encoder_helper_funcs.mode_set. The display
  	 * pipe (i.e.  clocks and timing signals) is off when this function is
  	 * called.
584a0146e   Philippe Cornu   drm: clarify adju...
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
  	 *
  	 * The adjusted_mode parameter is the mode output by the CRTC for the
  	 * first bridge in the chain. It can be different from the mode
  	 * parameter that contains the desired mode for the connector at the end
  	 * of the bridges chain, for instance when the first bridge in the chain
  	 * performs scaling. The adjusted mode is mostly useful for the first
  	 * bridge in the chain and is likely irrelevant for the other bridges.
  	 *
  	 * For atomic drivers the adjusted_mode is the mode stored in
  	 * &drm_crtc_state.adjusted_mode.
  	 *
  	 * NOTE:
  	 *
  	 * If a need arises to store and access modes adjusted for other
  	 * locations than the connection between the CRTC and the first bridge,
  	 * the DRM framework will have to be extended with DRM bridge states.
199e4e967   Daniel Vetter   drm: Extract drm_...
220
221
  	 */
  	void (*mode_set)(struct drm_bridge *bridge,
63f8f3bad   Laurent Pinchart   drm: bridge: Cons...
222
223
  			 const struct drm_display_mode *mode,
  			 const struct drm_display_mode *adjusted_mode);
199e4e967   Daniel Vetter   drm: Extract drm_...
224
225
226
227
228
229
  	/**
  	 * @pre_enable:
  	 *
  	 * This callback should enable the bridge. It is called right before
  	 * the preceding element in the display pipe is enabled. If the
  	 * preceding element is a bridge this means it's called before that
4541d31e2   Daniel Vetter   drm/bridge: Use r...
230
231
232
233
  	 * bridge's @pre_enable function. If the preceding element is a
  	 * &drm_encoder it's called right before the encoder's
  	 * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
  	 * &drm_encoder_helper_funcs.dpms hook.
199e4e967   Daniel Vetter   drm: Extract drm_...
234
235
236
237
238
239
  	 *
  	 * The display pipe (i.e. clocks and timing signals) feeding this bridge
  	 * will not yet be running when this callback is called. The bridge must
  	 * not enable the display link feeding the next bridge in the chain (if
  	 * there is one) when this callback is called.
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
240
  	 * The @pre_enable callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
241
242
243
244
245
246
247
248
249
  	 */
  	void (*pre_enable)(struct drm_bridge *bridge);
  
  	/**
  	 * @enable:
  	 *
  	 * This callback should enable the bridge. It is called right after
  	 * the preceding element in the display pipe is enabled. If the
  	 * preceding element is a bridge this means it's called after that
4541d31e2   Daniel Vetter   drm/bridge: Use r...
250
251
252
253
  	 * bridge's @enable function. If the preceding element is a
  	 * &drm_encoder it's called right after the encoder's
  	 * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
  	 * &drm_encoder_helper_funcs.dpms hook.
199e4e967   Daniel Vetter   drm: Extract drm_...
254
255
256
257
258
259
  	 *
  	 * The bridge can assume that the display pipe (i.e. clocks and timing
  	 * signals) feeding it is running when this callback is called. This
  	 * callback must enable the display link feeding the next bridge in the
  	 * chain if there is one.
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
260
  	 * The @enable callback is optional.
199e4e967   Daniel Vetter   drm: Extract drm_...
261
262
  	 */
  	void (*enable)(struct drm_bridge *bridge);
5ade071ba   Sean Paul   drm: Add atomic v...
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
  
  	/**
  	 * @atomic_pre_enable:
  	 *
  	 * This callback should enable the bridge. It is called right before
  	 * the preceding element in the display pipe is enabled. If the
  	 * preceding element is a bridge this means it's called before that
  	 * bridge's @atomic_pre_enable or @pre_enable function. If the preceding
  	 * element is a &drm_encoder it's called right before the encoder's
  	 * &drm_encoder_helper_funcs.atomic_enable hook.
  	 *
  	 * The display pipe (i.e. clocks and timing signals) feeding this bridge
  	 * will not yet be running when this callback is called. The bridge must
  	 * not enable the display link feeding the next bridge in the chain (if
  	 * there is one) when this callback is called.
  	 *
  	 * Note that this function will only be invoked in the context of an
ea099adfd   Boris Brezillon   drm/bridge: Renam...
280
281
282
283
  	 * atomic commit. It will not be invoked from
  	 * &drm_bridge_chain_pre_enable. It would be prudent to also provide an
  	 * implementation of @pre_enable if you are expecting driver calls into
  	 * &drm_bridge_chain_pre_enable.
5ade071ba   Sean Paul   drm: Add atomic v...
284
285
286
287
  	 *
  	 * The @atomic_pre_enable callback is optional.
  	 */
  	void (*atomic_pre_enable)(struct drm_bridge *bridge,
41cf57124   Boris Brezillon   drm/bridge: Patch...
288
  				  struct drm_bridge_state *old_bridge_state);
5ade071ba   Sean Paul   drm: Add atomic v...
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
  
  	/**
  	 * @atomic_enable:
  	 *
  	 * This callback should enable the bridge. It is called right after
  	 * the preceding element in the display pipe is enabled. If the
  	 * preceding element is a bridge this means it's called after that
  	 * bridge's @atomic_enable or @enable function. If the preceding element
  	 * is a &drm_encoder it's called right after the encoder's
  	 * &drm_encoder_helper_funcs.atomic_enable hook.
  	 *
  	 * The bridge can assume that the display pipe (i.e. clocks and timing
  	 * signals) feeding it is running when this callback is called. This
  	 * callback must enable the display link feeding the next bridge in the
  	 * chain if there is one.
  	 *
  	 * Note that this function will only be invoked in the context of an
ea099adfd   Boris Brezillon   drm/bridge: Renam...
306
307
308
  	 * atomic commit. It will not be invoked from &drm_bridge_chain_enable.
  	 * It would be prudent to also provide an implementation of @enable if
  	 * you are expecting driver calls into &drm_bridge_chain_enable.
5ade071ba   Sean Paul   drm: Add atomic v...
309
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
310
  	 * The @atomic_enable callback is optional.
5ade071ba   Sean Paul   drm: Add atomic v...
311
312
  	 */
  	void (*atomic_enable)(struct drm_bridge *bridge,
41cf57124   Boris Brezillon   drm/bridge: Patch...
313
  			      struct drm_bridge_state *old_bridge_state);
5ade071ba   Sean Paul   drm: Add atomic v...
314
315
316
317
318
319
320
321
322
323
324
325
326
327
  	/**
  	 * @atomic_disable:
  	 *
  	 * This callback should disable the bridge. It is called right before
  	 * the preceding element in the display pipe is disabled. If the
  	 * preceding element is a bridge this means it's called before that
  	 * bridge's @atomic_disable or @disable vfunc. If the preceding element
  	 * is a &drm_encoder it's called right before the
  	 * &drm_encoder_helper_funcs.atomic_disable hook.
  	 *
  	 * The bridge can assume that the display pipe (i.e. clocks and timing
  	 * signals) feeding it is still running when this callback is called.
  	 *
  	 * Note that this function will only be invoked in the context of an
ea099adfd   Boris Brezillon   drm/bridge: Renam...
328
329
330
331
  	 * atomic commit. It will not be invoked from
  	 * &drm_bridge_chain_disable. It would be prudent to also provide an
  	 * implementation of @disable if you are expecting driver calls into
  	 * &drm_bridge_chain_disable.
5ade071ba   Sean Paul   drm: Add atomic v...
332
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
333
  	 * The @atomic_disable callback is optional.
5ade071ba   Sean Paul   drm: Add atomic v...
334
335
  	 */
  	void (*atomic_disable)(struct drm_bridge *bridge,
41cf57124   Boris Brezillon   drm/bridge: Patch...
336
  			       struct drm_bridge_state *old_bridge_state);
5ade071ba   Sean Paul   drm: Add atomic v...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
  
  	/**
  	 * @atomic_post_disable:
  	 *
  	 * This callback should disable the bridge. It is called right after the
  	 * preceding element in the display pipe is disabled. If the preceding
  	 * element is a bridge this means it's called after that bridge's
  	 * @atomic_post_disable or @post_disable function. If the preceding
  	 * element is a &drm_encoder it's called right after the encoder's
  	 * &drm_encoder_helper_funcs.atomic_disable hook.
  	 *
  	 * The bridge must assume that the display pipe (i.e. clocks and timing
  	 * signals) feeding it is no longer running when this callback is
  	 * called.
  	 *
  	 * Note that this function will only be invoked in the context of an
ea099adfd   Boris Brezillon   drm/bridge: Renam...
353
354
  	 * atomic commit. It will not be invoked from
  	 * &drm_bridge_chain_post_disable.
5ade071ba   Sean Paul   drm: Add atomic v...
355
356
  	 * It would be prudent to also provide an implementation of
  	 * @post_disable if you are expecting driver calls into
ea099adfd   Boris Brezillon   drm/bridge: Renam...
357
  	 * &drm_bridge_chain_post_disable.
5ade071ba   Sean Paul   drm: Add atomic v...
358
  	 *
fe9e557df   Laurent Pinchart   drm/bridge: Fix r...
359
  	 * The @atomic_post_disable callback is optional.
5ade071ba   Sean Paul   drm: Add atomic v...
360
361
  	 */
  	void (*atomic_post_disable)(struct drm_bridge *bridge,
41cf57124   Boris Brezillon   drm/bridge: Patch...
362
  				    struct drm_bridge_state *old_bridge_state);
751465913   Boris Brezillon   drm/bridge: Add a...
363
364
365
366
367
368
369
  
  	/**
  	 * @atomic_duplicate_state:
  	 *
  	 * Duplicate the current bridge state object (which is guaranteed to be
  	 * non-NULL).
  	 *
282f713c6   Laurent Pinchart   drm/bridge: Fix a...
370
371
372
373
374
  	 * The atomic_duplicate_state hook is mandatory if the bridge
  	 * implements any of the atomic hooks, and should be left unassigned
  	 * otherwise. For bridges that don't subclass &drm_bridge_state, the
  	 * drm_atomic_helper_bridge_duplicate_state() helper function shall be
  	 * used to implement this hook.
751465913   Boris Brezillon   drm/bridge: Add a...
375
376
377
378
379
380
381
382
383
384
385
386
  	 *
  	 * RETURNS:
  	 * A valid drm_bridge_state object or NULL if the allocation fails.
  	 */
  	struct drm_bridge_state *(*atomic_duplicate_state)(struct drm_bridge *bridge);
  
  	/**
  	 * @atomic_destroy_state:
  	 *
  	 * Destroy a bridge state object previously allocated by
  	 * &drm_bridge_funcs.atomic_duplicate_state().
  	 *
282f713c6   Laurent Pinchart   drm/bridge: Fix a...
387
388
389
390
391
  	 * The atomic_destroy_state hook is mandatory if the bridge implements
  	 * any of the atomic hooks, and should be left unassigned otherwise.
  	 * For bridges that don't subclass &drm_bridge_state, the
  	 * drm_atomic_helper_bridge_destroy_state() helper function shall be
  	 * used to implement this hook.
751465913   Boris Brezillon   drm/bridge: Add a...
392
393
394
395
396
  	 */
  	void (*atomic_destroy_state)(struct drm_bridge *bridge,
  				     struct drm_bridge_state *state);
  
  	/**
f32df58ac   Boris Brezillon   drm/bridge: Add t...
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
  	 * @atomic_get_output_bus_fmts:
  	 *
  	 * Return the supported bus formats on the output end of a bridge.
  	 * The returned array must be allocated with kmalloc() and will be
  	 * freed by the caller. If the allocation fails, NULL should be
  	 * returned. num_output_fmts must be set to the returned array size.
  	 * Formats listed in the returned array should be listed in decreasing
  	 * preference order (the core will try all formats until it finds one
  	 * that works).
  	 *
  	 * This method is only called on the last element of the bridge chain
  	 * as part of the bus format negotiation process that happens in
  	 * &drm_atomic_bridge_chain_select_bus_fmts().
  	 * This method is optional. When not implemented, the core will
  	 * fall back to &drm_connector.display_info.bus_formats[0] if
  	 * &drm_connector.display_info.num_bus_formats > 0,
  	 * or to MEDIA_BUS_FMT_FIXED otherwise.
  	 */
  	u32 *(*atomic_get_output_bus_fmts)(struct drm_bridge *bridge,
  					   struct drm_bridge_state *bridge_state,
  					   struct drm_crtc_state *crtc_state,
  					   struct drm_connector_state *conn_state,
  					   unsigned int *num_output_fmts);
  
  	/**
  	 * @atomic_get_input_bus_fmts:
  	 *
  	 * Return the supported bus formats on the input end of a bridge for
  	 * a specific output bus format.
  	 *
  	 * The returned array must be allocated with kmalloc() and will be
  	 * freed by the caller. If the allocation fails, NULL should be
  	 * returned. num_output_fmts must be set to the returned array size.
  	 * Formats listed in the returned array should be listed in decreasing
  	 * preference order (the core will try all formats until it finds one
  	 * that works). When the format is not supported NULL should be
91ea83306   Boris Brezillon   drm/bridge: Fix t...
433
  	 * returned and num_output_fmts should be set to 0.
f32df58ac   Boris Brezillon   drm/bridge: Add t...
434
435
436
  	 *
  	 * This method is called on all elements of the bridge chain as part of
  	 * the bus format negotiation process that happens in
91ea83306   Boris Brezillon   drm/bridge: Fix t...
437
  	 * drm_atomic_bridge_chain_select_bus_fmts().
f32df58ac   Boris Brezillon   drm/bridge: Add t...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
  	 * This method is optional. When not implemented, the core will bypass
  	 * bus format negotiation on this element of the bridge without
  	 * failing, and the previous element in the chain will be passed
  	 * MEDIA_BUS_FMT_FIXED as its output bus format.
  	 *
  	 * Bridge drivers that need to support being linked to bridges that are
  	 * not supporting bus format negotiation should handle the
  	 * output_fmt == MEDIA_BUS_FMT_FIXED case appropriately, by selecting a
  	 * sensible default value or extracting this information from somewhere
  	 * else (FW property, &drm_display_mode, &drm_display_info, ...)
  	 *
  	 * Note: Even if input format selection on the first bridge has no
  	 * impact on the negotiation process (bus format negotiation stops once
  	 * we reach the first element of the chain), drivers are expected to
  	 * return accurate input formats as the input format may be used to
  	 * configure the CRTC output appropriately.
  	 */
  	u32 *(*atomic_get_input_bus_fmts)(struct drm_bridge *bridge,
  					  struct drm_bridge_state *bridge_state,
  					  struct drm_crtc_state *crtc_state,
  					  struct drm_connector_state *conn_state,
  					  u32 output_fmt,
  					  unsigned int *num_input_fmts);
  
  	/**
5061b8a96   Boris Brezillon   drm/bridge: Add a...
463
464
465
466
467
468
469
470
471
472
473
474
475
  	 * @atomic_check:
  	 *
  	 * This method is responsible for checking bridge state correctness.
  	 * It can also check the state of the surrounding components in chain
  	 * to make sure the whole pipeline can work properly.
  	 *
  	 * &drm_bridge_funcs.atomic_check() hooks are called in reverse
  	 * order (from the last to the first bridge).
  	 *
  	 * This method is optional. &drm_bridge_funcs.mode_fixup() is not
  	 * called when &drm_bridge_funcs.atomic_check() is implemented, so only
  	 * one of them should be provided.
  	 *
f32df58ac   Boris Brezillon   drm/bridge: Add t...
476
  	 * If drivers need to tweak &drm_bridge_state.input_bus_cfg.flags or
19d97fd66   Randy Dunlap   drm: drm_bridge.h...
477
  	 * &drm_bridge_state.output_bus_cfg.flags it should happen in
f32df58ac   Boris Brezillon   drm/bridge: Add t...
478
479
480
481
482
483
  	 * this function. By default the &drm_bridge_state.output_bus_cfg.flags
  	 * field is set to the next bridge
  	 * &drm_bridge_state.input_bus_cfg.flags value or
  	 * &drm_connector.display_info.bus_flags if the bridge is the last
  	 * element in the chain.
  	 *
5061b8a96   Boris Brezillon   drm/bridge: Add a...
484
485
486
487
488
489
490
491
492
  	 * RETURNS:
  	 * zero if the check passed, a negative error code otherwise.
  	 */
  	int (*atomic_check)(struct drm_bridge *bridge,
  			    struct drm_bridge_state *bridge_state,
  			    struct drm_crtc_state *crtc_state,
  			    struct drm_connector_state *conn_state);
  
  	/**
751465913   Boris Brezillon   drm/bridge: Add a...
493
494
495
496
497
498
499
  	 * @atomic_reset:
  	 *
  	 * Reset the bridge to a predefined state (or retrieve its current
  	 * state) and return a &drm_bridge_state object matching this state.
  	 * This function is called at attach time.
  	 *
  	 * The atomic_reset hook is mandatory if the bridge implements any of
282f713c6   Laurent Pinchart   drm/bridge: Fix a...
500
501
502
503
  	 * the atomic hooks, and should be left unassigned otherwise. For
  	 * bridges that don't subclass &drm_bridge_state, the
  	 * drm_atomic_helper_bridge_reset() helper function shall be used to
  	 * implement this hook.
751465913   Boris Brezillon   drm/bridge: Add a...
504
505
506
  	 *
  	 * Note that the atomic_reset() semantics is not exactly matching the
  	 * reset() semantics found on other components (connector, plane, ...).
91ea83306   Boris Brezillon   drm/bridge: Fix t...
507
508
  	 *
  	 * 1. The reset operation happens when the bridge is attached, not when
751465913   Boris Brezillon   drm/bridge: Add a...
509
  	 *    drm_mode_config_reset() is called
91ea83306   Boris Brezillon   drm/bridge: Fix t...
510
  	 * 2. It's meant to be used exclusively on bridges that have been
751465913   Boris Brezillon   drm/bridge: Add a...
511
512
513
514
515
516
517
  	 *    converted to the ATOMIC API
  	 *
  	 * RETURNS:
  	 * A valid drm_bridge_state object in case of success, an ERR_PTR()
  	 * giving the reason of the failure otherwise.
  	 */
  	struct drm_bridge_state *(*atomic_reset)(struct drm_bridge *bridge);
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
  
  	/**
  	 * @detect:
  	 *
  	 * Check if anything is attached to the bridge output.
  	 *
  	 * This callback is optional, if not implemented the bridge will be
  	 * considered as always having a component attached to its output.
  	 * Bridges that implement this callback shall set the
  	 * DRM_BRIDGE_OP_DETECT flag in their &drm_bridge->ops.
  	 *
  	 * RETURNS:
  	 *
  	 * drm_connector_status indicating the bridge output status.
  	 */
  	enum drm_connector_status (*detect)(struct drm_bridge *bridge);
  
  	/**
  	 * @get_modes:
  	 *
  	 * Fill all modes currently valid for the sink into the &drm_connector
  	 * with drm_mode_probed_add().
  	 *
  	 * The @get_modes callback is mostly intended to support non-probeable
  	 * displays such as many fixed panels. Bridges that support reading
  	 * EDID shall leave @get_modes unimplemented and implement the
  	 * &drm_bridge_funcs->get_edid callback instead.
  	 *
  	 * This callback is optional. Bridges that implement it shall set the
  	 * DRM_BRIDGE_OP_MODES flag in their &drm_bridge->ops.
  	 *
  	 * The connector parameter shall be used for the sole purpose of
  	 * filling modes, and shall not be stored internally by bridge drivers
  	 * for future usage.
  	 *
  	 * RETURNS:
  	 *
  	 * The number of modes added by calling drm_mode_probed_add().
  	 */
  	int (*get_modes)(struct drm_bridge *bridge,
  			 struct drm_connector *connector);
  
  	/**
  	 * @get_edid:
  	 *
  	 * Read and parse the EDID data of the connected display.
  	 *
  	 * The @get_edid callback is the preferred way of reporting mode
  	 * information for a display connected to the bridge output. Bridges
  	 * that support reading EDID shall implement this callback and leave
  	 * the @get_modes callback unimplemented.
  	 *
  	 * The caller of this operation shall first verify the output
  	 * connection status and refrain from reading EDID from a disconnected
  	 * output.
  	 *
  	 * This callback is optional. Bridges that implement it shall set the
  	 * DRM_BRIDGE_OP_EDID flag in their &drm_bridge->ops.
  	 *
  	 * The connector parameter shall be used for the sole purpose of EDID
  	 * retrieval and parsing, and shall not be stored internally by bridge
  	 * drivers for future usage.
  	 *
  	 * RETURNS:
  	 *
  	 * An edid structure newly allocated with kmalloc() (or similar) on
  	 * success, or NULL otherwise. The caller is responsible for freeing
  	 * the returned edid structure with kfree().
  	 */
  	struct edid *(*get_edid)(struct drm_bridge *bridge,
  				 struct drm_connector *connector);
  
  	/**
  	 * @hpd_notify:
  	 *
  	 * Notify the bridge of hot plug detection.
  	 *
  	 * This callback is optional, it may be implemented by bridges that
  	 * need to be notified of display connection or disconnection for
  	 * internal reasons. One use case is to reset the internal state of CEC
  	 * controllers for HDMI bridges.
  	 */
  	void (*hpd_notify)(struct drm_bridge *bridge,
  			   enum drm_connector_status status);
  
  	/**
  	 * @hpd_enable:
  	 *
  	 * Enable hot plug detection. From now on the bridge shall call
  	 * drm_bridge_hpd_notify() each time a change is detected in the output
  	 * connection status, until hot plug detection gets disabled with
  	 * @hpd_disable.
  	 *
  	 * This callback is optional and shall only be implemented by bridges
  	 * that support hot-plug notification without polling. Bridges that
  	 * implement it shall also implement the @hpd_disable callback and set
  	 * the DRM_BRIDGE_OP_HPD flag in their &drm_bridge->ops.
  	 */
  	void (*hpd_enable)(struct drm_bridge *bridge);
  
  	/**
  	 * @hpd_disable:
  	 *
  	 * Disable hot plug detection. Once this function returns the bridge
  	 * shall not call drm_bridge_hpd_notify() when a change in the output
  	 * connection status occurs.
  	 *
  	 * This callback is optional and shall only be implemented by bridges
  	 * that support hot-plug notification without polling. Bridges that
  	 * implement it shall also implement the @hpd_enable callback and set
  	 * the DRM_BRIDGE_OP_HPD flag in their &drm_bridge->ops.
  	 */
  	void (*hpd_disable)(struct drm_bridge *bridge);
199e4e967   Daniel Vetter   drm: Extract drm_...
631
632
633
  };
  
  /**
36a776df6   Linus Walleij   drm/bridge: Provi...
634
635
636
637
   * struct drm_bridge_timings - timing information for the bridge
   */
  struct drm_bridge_timings {
  	/**
d23286ff3   Stefan Agner   drm/bridge: use b...
638
  	 * @input_bus_flags:
36a776df6   Linus Walleij   drm/bridge: Provi...
639
  	 *
d23286ff3   Stefan Agner   drm/bridge: use b...
640
641
642
  	 * Tells what additional settings for the pixel data on the bus
  	 * this bridge requires (like pixel signal polarity). See also
  	 * &drm_display_info->bus_flags.
36a776df6   Linus Walleij   drm/bridge: Provi...
643
  	 */
d23286ff3   Stefan Agner   drm/bridge: use b...
644
  	u32 input_bus_flags;
36a776df6   Linus Walleij   drm/bridge: Provi...
645
646
647
648
649
650
651
652
653
654
655
656
657
658
  	/**
  	 * @setup_time_ps:
  	 *
  	 * Defines the time in picoseconds the input data lines must be
  	 * stable before the clock edge.
  	 */
  	u32 setup_time_ps;
  	/**
  	 * @hold_time_ps:
  	 *
  	 * Defines the time in picoseconds taken for the bridge to sample the
  	 * input signal after the clock edge.
  	 */
  	u32 hold_time_ps;
b0a6b9402   Laurent Pinchart   drm: bridge: Add ...
659
660
661
662
663
664
665
666
  	/**
  	 * @dual_link:
  	 *
  	 * True if the bus operates in dual-link mode. The exact meaning is
  	 * dependent on the bus type. For LVDS buses, this indicates that even-
  	 * and odd-numbered pixels are received on separate links.
  	 */
  	bool dual_link;
36a776df6   Linus Walleij   drm/bridge: Provi...
667
668
669
  };
  
  /**
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
   * enum drm_bridge_ops - Bitmask of operations supported by the bridge
   */
  enum drm_bridge_ops {
  	/**
  	 * @DRM_BRIDGE_OP_DETECT: The bridge can detect displays connected to
  	 * its output. Bridges that set this flag shall implement the
  	 * &drm_bridge_funcs->detect callback.
  	 */
  	DRM_BRIDGE_OP_DETECT = BIT(0),
  	/**
  	 * @DRM_BRIDGE_OP_EDID: The bridge can retrieve the EDID of the display
  	 * connected to its output. Bridges that set this flag shall implement
  	 * the &drm_bridge_funcs->get_edid callback.
  	 */
  	DRM_BRIDGE_OP_EDID = BIT(1),
  	/**
  	 * @DRM_BRIDGE_OP_HPD: The bridge can detect hot-plug and hot-unplug
  	 * without requiring polling. Bridges that set this flag shall
  	 * implement the &drm_bridge_funcs->hpd_enable and
  	 * &drm_bridge_funcs->hpd_disable callbacks if they support enabling
  	 * and disabling hot-plug detection dynamically.
  	 */
  	DRM_BRIDGE_OP_HPD = BIT(2),
  	/**
  	 * @DRM_BRIDGE_OP_MODES: The bridge can retrieve the modes supported
  	 * by the display at its output. This does not include reading EDID
  	 * which is separately covered by @DRM_BRIDGE_OP_EDID. Bridges that set
  	 * this flag shall implement the &drm_bridge_funcs->get_modes callback.
  	 */
  	DRM_BRIDGE_OP_MODES = BIT(3),
  };
  
  /**
199e4e967   Daniel Vetter   drm: Extract drm_...
703
   * struct drm_bridge - central DRM bridge control structure
199e4e967   Daniel Vetter   drm: Extract drm_...
704
705
   */
  struct drm_bridge {
751465913   Boris Brezillon   drm/bridge: Add a...
706
707
  	/** @base: inherit from &drm_private_object */
  	struct drm_private_obj base;
6aa13402c   Eric Anholt   drm/bridge: Move ...
708
  	/** @dev: DRM device this bridge belongs to */
199e4e967   Daniel Vetter   drm: Extract drm_...
709
  	struct drm_device *dev;
6aa13402c   Eric Anholt   drm/bridge: Move ...
710
  	/** @encoder: encoder to which this bridge is connected */
199e4e967   Daniel Vetter   drm: Extract drm_...
711
  	struct drm_encoder *encoder;
05193dc38   Boris Brezillon   drm/bridge: Make ...
712
713
  	/** @chain_node: used to form a bridge chain */
  	struct list_head chain_node;
199e4e967   Daniel Vetter   drm: Extract drm_...
714
  #ifdef CONFIG_OF
6aa13402c   Eric Anholt   drm/bridge: Move ...
715
  	/** @of_node: device node pointer to the bridge */
199e4e967   Daniel Vetter   drm: Extract drm_...
716
717
  	struct device_node *of_node;
  #endif
6aa13402c   Eric Anholt   drm/bridge: Move ...
718
  	/** @list: to keep track of all added bridges */
199e4e967   Daniel Vetter   drm: Extract drm_...
719
  	struct list_head list;
6aa13402c   Eric Anholt   drm/bridge: Move ...
720
721
722
723
724
  	/**
  	 * @timings:
  	 *
  	 * the timing specification for the bridge, if any (may be NULL)
  	 */
36a776df6   Linus Walleij   drm/bridge: Provi...
725
  	const struct drm_bridge_timings *timings;
6aa13402c   Eric Anholt   drm/bridge: Move ...
726
  	/** @funcs: control functions */
199e4e967   Daniel Vetter   drm: Extract drm_...
727
  	const struct drm_bridge_funcs *funcs;
6aa13402c   Eric Anholt   drm/bridge: Move ...
728
  	/** @driver_private: pointer to the bridge driver's internal context */
199e4e967   Daniel Vetter   drm: Extract drm_...
729
  	void *driver_private;
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
730
731
732
733
734
735
736
737
738
  	/** @ops: bitmask of operations supported by the bridge */
  	enum drm_bridge_ops ops;
  	/**
  	 * @type: Type of the connection at the bridge output
  	 * (DRM_MODE_CONNECTOR_*). For bridges at the end of this chain this
  	 * identifies the type of connected display.
  	 */
  	int type;
  	/**
64d05ff75   Laurent Pinchart   drm/bridge: Add i...
739
740
741
742
743
  	 * @interlace_allowed: Indicate that the bridge can handle interlaced
  	 * modes.
  	 */
  	bool interlace_allowed;
  	/**
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
  	 * @ddc: Associated I2C adapter for DDC access, if any.
  	 */
  	struct i2c_adapter *ddc;
  	/** private: */
  	/**
  	 * @hpd_mutex: Protects the @hpd_cb and @hpd_data fields.
  	 */
  	struct mutex hpd_mutex;
  	/**
  	 * @hpd_cb: Hot plug detection callback, registered with
  	 * drm_bridge_hpd_enable().
  	 */
  	void (*hpd_cb)(void *data, enum drm_connector_status status);
  	/**
  	 * @hpd_data: Private data passed to the Hot plug detection callback
  	 * @hpd_cb.
  	 */
  	void *hpd_data;
199e4e967   Daniel Vetter   drm: Extract drm_...
762
  };
751465913   Boris Brezillon   drm/bridge: Add a...
763
764
765
766
767
  static inline struct drm_bridge *
  drm_priv_to_bridge(struct drm_private_obj *priv)
  {
  	return container_of(priv, struct drm_bridge, base);
  }
992868849   Inki Dae   drm/bridge: chang...
768
  void drm_bridge_add(struct drm_bridge *bridge);
199e4e967   Daniel Vetter   drm: Extract drm_...
769
770
  void drm_bridge_remove(struct drm_bridge *bridge);
  struct drm_bridge *of_drm_find_bridge(struct device_node *np);
3bb80f249   Laurent Pinchart   drm: bridge: Link...
771
  int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
a25b988ff   Laurent Pinchart   drm/bridge: Exten...
772
773
  		      struct drm_bridge *previous,
  		      enum drm_bridge_attach_flags flags);
199e4e967   Daniel Vetter   drm: Extract drm_...
774

fadf872d9   Boris Brezillon   drm/bridge: Intro...
775
776
777
778
779
780
781
782
783
784
  /**
   * drm_bridge_get_next_bridge() - Get the next bridge in the chain
   * @bridge: bridge object
   *
   * RETURNS:
   * the next bridge in the chain after @bridge, or NULL if @bridge is the last.
   */
  static inline struct drm_bridge *
  drm_bridge_get_next_bridge(struct drm_bridge *bridge)
  {
05193dc38   Boris Brezillon   drm/bridge: Make ...
785
786
787
788
  	if (list_is_last(&bridge->chain_node, &bridge->encoder->bridge_chain))
  		return NULL;
  
  	return list_next_entry(bridge, chain_node);
fadf872d9   Boris Brezillon   drm/bridge: Intro...
789
  }
35a61fe92   Boris Brezillon   drm: Stop accessi...
790
  /**
ac877c64c   Boris Brezillon   drm/bridge: Add t...
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
   * drm_bridge_get_prev_bridge() - Get the previous bridge in the chain
   * @bridge: bridge object
   *
   * RETURNS:
   * the previous bridge in the chain, or NULL if @bridge is the first.
   */
  static inline struct drm_bridge *
  drm_bridge_get_prev_bridge(struct drm_bridge *bridge)
  {
  	if (list_is_first(&bridge->chain_node, &bridge->encoder->bridge_chain))
  		return NULL;
  
  	return list_prev_entry(bridge, chain_node);
  }
  
  /**
35a61fe92   Boris Brezillon   drm: Stop accessi...
807
808
809
810
811
812
813
814
815
816
   * drm_bridge_chain_get_first_bridge() - Get the first bridge in the chain
   * @encoder: encoder object
   *
   * RETURNS:
   * the first bridge in the chain, or NULL if @encoder has no bridge attached
   * to it.
   */
  static inline struct drm_bridge *
  drm_bridge_chain_get_first_bridge(struct drm_encoder *encoder)
  {
05193dc38   Boris Brezillon   drm/bridge: Make ...
817
818
  	return list_first_entry_or_null(&encoder->bridge_chain,
  					struct drm_bridge, chain_node);
35a61fe92   Boris Brezillon   drm: Stop accessi...
819
  }
4ec5c9050   Boris Brezillon   drm/bridge: Add t...
820
821
822
823
824
825
826
827
828
829
  /**
   * drm_for_each_bridge_in_chain() - Iterate over all bridges present in a chain
   * @encoder: the encoder to iterate bridges on
   * @bridge: a bridge pointer updated to point to the current bridge at each
   *	    iteration
   *
   * Iterate over all bridges present in the bridge chain attached to @encoder.
   */
  #define drm_for_each_bridge_in_chain(encoder, bridge)			\
  	list_for_each_entry(bridge, &(encoder)->bridge_chain, chain_node)
ea099adfd   Boris Brezillon   drm/bridge: Renam...
830
831
832
833
834
  bool drm_bridge_chain_mode_fixup(struct drm_bridge *bridge,
  				 const struct drm_display_mode *mode,
  				 struct drm_display_mode *adjusted_mode);
  enum drm_mode_status
  drm_bridge_chain_mode_valid(struct drm_bridge *bridge,
12c683e12   Laurent Pinchart   drm: bridge: Pass...
835
  			    const struct drm_display_info *info,
ea099adfd   Boris Brezillon   drm/bridge: Renam...
836
837
838
839
840
841
842
843
  			    const struct drm_display_mode *mode);
  void drm_bridge_chain_disable(struct drm_bridge *bridge);
  void drm_bridge_chain_post_disable(struct drm_bridge *bridge);
  void drm_bridge_chain_mode_set(struct drm_bridge *bridge,
  			       const struct drm_display_mode *mode,
  			       const struct drm_display_mode *adjusted_mode);
  void drm_bridge_chain_pre_enable(struct drm_bridge *bridge);
  void drm_bridge_chain_enable(struct drm_bridge *bridge);
199e4e967   Daniel Vetter   drm: Extract drm_...
844

5061b8a96   Boris Brezillon   drm/bridge: Add a...
845
846
847
  int drm_atomic_bridge_chain_check(struct drm_bridge *bridge,
  				  struct drm_crtc_state *crtc_state,
  				  struct drm_connector_state *conn_state);
ea099adfd   Boris Brezillon   drm/bridge: Renam...
848
849
850
851
852
853
854
  void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge,
  				     struct drm_atomic_state *state);
  void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
  					  struct drm_atomic_state *state);
  void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,
  					struct drm_atomic_state *state);
  void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge,
5ade071ba   Sean Paul   drm: Add atomic v...
855
  				    struct drm_atomic_state *state);
5ade071ba   Sean Paul   drm: Add atomic v...
856

f32df58ac   Boris Brezillon   drm/bridge: Add t...
857
858
859
860
861
862
863
  u32 *
  drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge,
  					struct drm_bridge_state *bridge_state,
  					struct drm_crtc_state *crtc_state,
  					struct drm_connector_state *conn_state,
  					u32 output_fmt,
  					unsigned int *num_input_fmts);
11f6c4b1b   Laurent Pinchart   drm/bridge: Add c...
864
865
866
867
868
869
870
871
872
873
874
875
  enum drm_connector_status drm_bridge_detect(struct drm_bridge *bridge);
  int drm_bridge_get_modes(struct drm_bridge *bridge,
  			 struct drm_connector *connector);
  struct edid *drm_bridge_get_edid(struct drm_bridge *bridge,
  				 struct drm_connector *connector);
  void drm_bridge_hpd_enable(struct drm_bridge *bridge,
  			   void (*cb)(void *data,
  				      enum drm_connector_status status),
  			   void *data);
  void drm_bridge_hpd_disable(struct drm_bridge *bridge);
  void drm_bridge_hpd_notify(struct drm_bridge *bridge,
  			   enum drm_connector_status status);
13dfc0540   Eric Anholt   drm/bridge: Refac...
876
  #ifdef CONFIG_DRM_PANEL_BRIDGE
89958b7cd   Laurent Pinchart   drm/bridge: panel...
877
878
879
  struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel);
  struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel,
  					      u32 connector_type);
13dfc0540   Eric Anholt   drm/bridge: Refac...
880
  void drm_panel_bridge_remove(struct drm_bridge *bridge);
67022227f   Eric Anholt   drm/bridge: Add a...
881
  struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev,
89958b7cd   Laurent Pinchart   drm/bridge: panel...
882
883
884
885
  					     struct drm_panel *panel);
  struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev,
  						   struct drm_panel *panel,
  						   u32 connector_type);
d383fb5f8   Sam Ravnborg   drm: get drm_brid...
886
  struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge);
13dfc0540   Eric Anholt   drm/bridge: Refac...
887
  #endif
199e4e967   Daniel Vetter   drm: Extract drm_...
888
  #endif