1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Mode Setting Helper Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux GPU Driver Developer's Guide"><link rel="up" href="drmInternals.html" title="Chapter 2. DRM Internals"><link rel="prev" href="API-drm-modeset-unlock.html" title="drm_modeset_unlock"><link rel="next" href="API-drm-atomic-crtc-for-each-plane.html" title="drm_atomic_crtc_for_each_plane"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Mode Setting Helper Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-drm-modeset-unlock.html">Prev</a> </td><th width="60%" align="center">Chapter 2. DRM Internals</th><td width="20%" align="right"> <a accesskey="n" href="API-drm-atomic-crtc-for-each-plane.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id-1.3.4.9"></a>Mode Setting Helper Functions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.6">Helper Functions</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.7">CRTC Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.8">Encoder Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.9">Connector Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.10">Atomic Modeset Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.11">Modeset Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.12">Output Probing Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.13">fbdev Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.14">Display Port Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.15">Display Port MST Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.16">MIPI DSI Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.17">EDID Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.18">Rectangle Utilities Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.19">Flip-work Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.20">HDMI Infoframes Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.21">Plane Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.22">Tile group</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#id-1.3.4.9.23">Bridges</a></span></dt></dl></div><p>
2      The plane, CRTC, encoder and connector functions provided by the drivers
3      implement the DRM API. They're called by the DRM core and ioctl handlers
4      to handle device state changes and configuration request. As implementing
5      those functions often requires logic not specific to drivers, mid-layer
6      helper functions are available to avoid duplicating boilerplate code.
7    </p><p>
8      The DRM core contains one mid-layer implementation. The mid-layer provides
9      implementations of several plane, CRTC, encoder and connector functions
10      (called from the top of the mid-layer) that pre-process requests and call
11      lower-level functions provided by the driver (at the bottom of the
12      mid-layer). For instance, the
13      <code class="function"><a class="link" href="API-drm-crtc-helper-set-config.html" title="drm_crtc_helper_set_config">drm_crtc_helper_set_config</a></code> function can be used to
14      fill the struct <span class="structname"><a class="link" href="API-struct-drm-crtc-funcs.html" title="struct drm_crtc_funcs">drm_crtc_funcs</a></span>
15      <em class="structfield"><code>set_config</code></em> field. When called, it will split
16      the <code class="methodname">set_config</code> operation in smaller, simpler
17      operations and call the driver to handle them.
18    </p><p>
19      To use the mid-layer, drivers call <code class="function">drm_crtc_helper_add</code>,
20      <code class="function">drm_encoder_helper_add</code> and
21      <code class="function">drm_connector_helper_add</code> functions to install their
22      mid-layer bottom operations handlers, and fill the
23      <span class="structname"><a class="link" href="API-struct-drm-crtc-funcs.html" title="struct drm_crtc_funcs">drm_crtc_funcs</a></span>,
24      <span class="structname"><a class="link" href="API-struct-drm-encoder-funcs.html" title="struct drm_encoder_funcs">drm_encoder_funcs</a></span> and
25      <span class="structname"><a class="link" href="API-struct-drm-connector-funcs.html" title="struct drm_connector_funcs">drm_connector_funcs</a></span> structures with pointers to
26      the mid-layer top API functions. Installing the mid-layer bottom operation
27      handlers is best done right after registering the corresponding KMS object.
28    </p><p>
29      The mid-layer is not split between CRTC, encoder and connector operations.
30      To use it, a driver must provide bottom functions for all of the three KMS
31      entities.
32    </p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.6"></a>Helper Functions</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><pre class="synopsis">int drm_crtc_helper_set_config(struct drm_mode_set *set);</pre><p>
33            The <code class="function"><a class="link" href="API-drm-crtc-helper-set-config.html" title="drm_crtc_helper_set_config">drm_crtc_helper_set_config</a></code> helper function
34            is a CRTC <code class="methodname">set_config</code> implementation. It
35            first tries to locate the best encoder for each connector by calling
36            the connector <code class="methodname">best_encoder</code> helper
37            operation.
38          </p><p>
39            After locating the appropriate encoders, the helper function will
40            call the <code class="methodname">mode_fixup</code> encoder and CRTC helper
41            operations to adjust the requested mode, or reject it completely in
42            which case an error will be returned to the application. If the new
43            configuration after mode adjustment is identical to the current
44            configuration the helper function will return without performing any
45            other operation.
46          </p><p>
47            If the adjusted mode is identical to the current mode but changes to
48            the frame buffer need to be applied, the
49            <code class="function"><a class="link" href="API-drm-crtc-helper-set-config.html" title="drm_crtc_helper_set_config">drm_crtc_helper_set_config</a></code> function will call
50            the CRTC <code class="methodname">mode_set_base</code> helper operation. If
51            the adjusted mode differs from the current mode, or if the
52            <code class="methodname">mode_set_base</code> helper operation is not
53            provided, the helper function performs a full mode set sequence by
54            calling the <code class="methodname">prepare</code>,
55            <code class="methodname">mode_set</code> and
56            <code class="methodname">commit</code> CRTC and encoder helper operations,
57            in that order.
58          </p></li><li class="listitem"><pre class="synopsis">void drm_helper_connector_dpms(struct drm_connector *connector, int mode);</pre><p>
59            The <code class="function"><a class="link" href="API-drm-helper-connector-dpms.html" title="drm_helper_connector_dpms">drm_helper_connector_dpms</a></code> helper function
60            is a connector <code class="methodname">dpms</code> implementation that
61            tracks power state of connectors. To use the function, drivers must
62            provide <code class="methodname">dpms</code> helper operations for CRTCs
63            and encoders to apply the DPMS state to the device.
64          </p><p>
65            The mid-layer doesn't track the power state of CRTCs and encoders.
66            The <code class="methodname">dpms</code> helper operations can thus be
67            called with a mode identical to the currently active mode.
68          </p></li><li class="listitem"><pre class="synopsis">int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
69                                            uint32_t maxX, uint32_t maxY);</pre><p>
70            The <code class="function"><a class="link" href="API-drm-helper-probe-single-connector-modes.html" title="drm_helper_probe_single_connector_modes">drm_helper_probe_single_connector_modes</a></code> helper
71            function is a connector <code class="methodname">fill_modes</code>
72            implementation that updates the connection status for the connector
73            and then retrieves a list of modes by calling the connector
74            <code class="methodname">get_modes</code> helper operation.
75          </p><p>
76            If the helper operation returns no mode, and if the connector status
77            is connector_status_connected, standard VESA DMT modes up to
78            1024x768 are automatically added to the modes list by a call to
79            <code class="function"><a class="link" href="API-drm-add-modes-noedid.html" title="drm_add_modes_noedid">drm_add_modes_noedid</a></code>.
80          </p><p>
81            The function then filters out modes larger than
82            <em class="parameter"><code>max_width</code></em> and <em class="parameter"><code>max_height</code></em>
83            if specified. It finally calls the optional connector
84            <code class="methodname">mode_valid</code> helper operation for each mode in
85            the probed list to check whether the mode is valid for the connector.
86          </p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.7"></a>CRTC Helper Operations</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a name="drm-helper-crtc-mode-fixup"></a><pre class="synopsis">bool (*mode_fixup)(struct drm_crtc *crtc,
87                       const struct drm_display_mode *mode,
88                       struct drm_display_mode *adjusted_mode);</pre><p>
89            Let CRTCs adjust the requested mode or reject it completely. This
90            operation returns true if the mode is accepted (possibly after being
91            adjusted) or false if it is rejected.
92          </p><p>
93            The <code class="methodname">mode_fixup</code> operation should reject the
94            mode if it can't reasonably use it. The definition of "reasonable"
95            is currently fuzzy in this context. One possible behaviour would be
96            to set the adjusted mode to the panel timings when a fixed-mode
97            panel is used with hardware capable of scaling. Another behaviour
98            would be to accept any input mode and adjust it to the closest mode
99            supported by the hardware (FIXME: This needs to be clarified).
100          </p></li><li class="listitem"><pre class="synopsis">int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
101                     struct drm_framebuffer *old_fb)</pre><p>
102            Move the CRTC on the current frame buffer (stored in
103            <code class="literal">crtc-&gt;fb</code>) to position (x,y). Any of the frame
104            buffer, x position or y position may have been modified.
105          </p><p>
106            This helper operation is optional. If not provided, the
107            <code class="function"><a class="link" href="API-drm-crtc-helper-set-config.html" title="drm_crtc_helper_set_config">drm_crtc_helper_set_config</a></code> function will fall
108            back to the <code class="methodname">mode_set</code> helper operation.
109          </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
110            FIXME: Why are x and y passed as arguments, as they can be accessed
111            through <code class="literal">crtc-&gt;x</code> and
112            <code class="literal">crtc-&gt;y</code>?
113          </p></div></li><li class="listitem"><pre class="synopsis">void (*prepare)(struct drm_crtc *crtc);</pre><p>
114            Prepare the CRTC for mode setting. This operation is called after
115            validating the requested mode. Drivers use it to perform
116            device-specific operations required before setting the new mode.
117          </p></li><li class="listitem"><pre class="synopsis">int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
118                struct drm_display_mode *adjusted_mode, int x, int y,
119                struct drm_framebuffer *old_fb);</pre><p>
120            Set a new mode, position and frame buffer. Depending on the device
121            requirements, the mode can be stored internally by the driver and
122            applied in the <code class="methodname">commit</code> operation, or
123            programmed to the hardware immediately.
124          </p><p>
125            The <code class="methodname">mode_set</code> operation returns 0 on success
126	    or a negative error code if an error occurs.
127          </p></li><li class="listitem"><pre class="synopsis">void (*commit)(struct drm_crtc *crtc);</pre><p>
128            Commit a mode. This operation is called after setting the new mode.
129            Upon return the device must use the new mode and be fully
130            operational.
131          </p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.8"></a>Encoder Helper Operations</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><pre class="synopsis">bool (*mode_fixup)(struct drm_encoder *encoder,
132                       const struct drm_display_mode *mode,
133                       struct drm_display_mode *adjusted_mode);</pre><p>
134            Let encoders adjust the requested mode or reject it completely. This
135            operation returns true if the mode is accepted (possibly after being
136            adjusted) or false if it is rejected. See the
137            <a class="link" href="ch02s05.html#drm-helper-crtc-mode-fixup">mode_fixup CRTC helper
138            operation</a> for an explanation of the allowed adjustments.
139          </p></li><li class="listitem"><pre class="synopsis">void (*prepare)(struct drm_encoder *encoder);</pre><p>
140            Prepare the encoder for mode setting. This operation is called after
141            validating the requested mode. Drivers use it to perform
142            device-specific operations required before setting the new mode.
143          </p></li><li class="listitem"><pre class="synopsis">void (*mode_set)(struct drm_encoder *encoder,
144                 struct drm_display_mode *mode,
145                 struct drm_display_mode *adjusted_mode);</pre><p>
146            Set a new mode. Depending on the device requirements, the mode can
147            be stored internally by the driver and applied in the
148            <code class="methodname">commit</code> operation, or programmed to the
149            hardware immediately.
150          </p></li><li class="listitem"><pre class="synopsis">void (*commit)(struct drm_encoder *encoder);</pre><p>
151            Commit a mode. This operation is called after setting the new mode.
152            Upon return the device must use the new mode and be fully
153            operational.
154          </p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.9"></a>Connector Helper Operations</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><pre class="synopsis">struct drm_encoder *(*best_encoder)(struct drm_connector *connector);</pre><p>
155            Return a pointer to the best encoder for the connecter. Device that
156            map connectors to encoders 1:1 simply return the pointer to the
157            associated encoder. This operation is mandatory.
158          </p></li><li class="listitem"><pre class="synopsis">int (*get_modes)(struct drm_connector *connector);</pre><p>
159            Fill the connector's <em class="structfield"><code>probed_modes</code></em> list
160            by parsing EDID data with <code class="function"><a class="link" href="API-drm-add-edid-modes.html" title="drm_add_edid_modes">drm_add_edid_modes</a></code>,
161            adding standard VESA DMT modes with <code class="function"><a class="link" href="API-drm-add-modes-noedid.html" title="drm_add_modes_noedid">drm_add_modes_noedid</a></code>,
162            or calling <code class="function"><a class="link" href="API-drm-mode-probed-add.html" title="drm_mode_probed_add">drm_mode_probed_add</a></code> directly for every
163            supported mode and return the number of modes it has detected. This
164            operation is mandatory.
165          </p><p>
166            Note that the caller function will automatically add standard VESA
167            DMT modes up to 1024x768 if the <code class="methodname">get_modes</code>
168            helper operation returns no mode and if the connector status is
169            connector_status_connected. There is no need to call
170            <code class="function"><a class="link" href="API-drm-add-edid-modes.html" title="drm_add_edid_modes">drm_add_edid_modes</a></code> manually in that case.
171          </p><p>
172            When adding modes manually the driver creates each mode with a call to
173            <code class="function"><a class="link" href="API-drm-mode-create.html" title="drm_mode_create">drm_mode_create</a></code> and must fill the following fields.
174            </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><pre class="synopsis">__u32 type;</pre><p>
175                  Mode type bitmask, a combination of
176                  </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">DRM_MODE_TYPE_BUILTIN</span></dt><dd><p>not used?</p></dd><dt><span class="term">DRM_MODE_TYPE_CLOCK_C</span></dt><dd><p>not used?</p></dd><dt><span class="term">DRM_MODE_TYPE_CRTC_C</span></dt><dd><p>not used?</p></dd><dt><span class="term">
177        DRM_MODE_TYPE_PREFERRED - The preferred mode for the connector
178                      </span></dt><dd><p>not used?</p></dd><dt><span class="term">DRM_MODE_TYPE_DEFAULT</span></dt><dd><p>not used?</p></dd><dt><span class="term">DRM_MODE_TYPE_USERDEF</span></dt><dd><p>not used?</p></dd><dt><span class="term">DRM_MODE_TYPE_DRIVER</span></dt><dd><p>
179                          The mode has been created by the driver (as opposed to
180                          to user-created modes).
181                        </p></dd></dl></div><p>
182                  Drivers must set the DRM_MODE_TYPE_DRIVER bit for all modes they
183                  create, and set the DRM_MODE_TYPE_PREFERRED bit for the preferred
184                  mode.
185                </p></li><li class="listitem"><pre class="synopsis">__u32 clock;</pre><p>Pixel clock frequency in kHz unit</p></li><li class="listitem"><pre class="synopsis">__u16 hdisplay, hsync_start, hsync_end, htotal;
186    __u16 vdisplay, vsync_start, vsync_end, vtotal;</pre><p>Horizontal and vertical timing information</p><pre class="screen">
187             Active                 Front           Sync           Back
188             Region                 Porch                          Porch
189    &lt;-----------------------&gt;&lt;----------------&gt;&lt;-------------&gt;&lt;--------------&gt;
190
191      //////////////////////|
192     ////////////////////// |
193    //////////////////////  |..................               ................
194                                               _______________
195
196    &lt;----- [hv]display -----&gt;
197    &lt;------------- [hv]sync_start ------------&gt;
198    &lt;--------------------- [hv]sync_end ---------------------&gt;
199    &lt;-------------------------------- [hv]total -----------------------------&gt;
200</pre></li><li class="listitem"><pre class="synopsis">__u16 hskew;
201    __u16 vscan;</pre><p>Unknown</p></li><li class="listitem"><pre class="synopsis">__u32 flags;</pre><p>
202                  Mode flags, a combination of
203                  </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">DRM_MODE_FLAG_PHSYNC</span></dt><dd><p>
204                        Horizontal sync is active high
205                      </p></dd><dt><span class="term">DRM_MODE_FLAG_NHSYNC</span></dt><dd><p>
206                        Horizontal sync is active low
207                      </p></dd><dt><span class="term">DRM_MODE_FLAG_PVSYNC</span></dt><dd><p>
208                        Vertical sync is active high
209                      </p></dd><dt><span class="term">DRM_MODE_FLAG_NVSYNC</span></dt><dd><p>
210                        Vertical sync is active low
211                      </p></dd><dt><span class="term">DRM_MODE_FLAG_INTERLACE</span></dt><dd><p>
212                        Mode is interlaced
213                      </p></dd><dt><span class="term">DRM_MODE_FLAG_DBLSCAN</span></dt><dd><p>
214                        Mode uses doublescan
215                      </p></dd><dt><span class="term">DRM_MODE_FLAG_CSYNC</span></dt><dd><p>
216                        Mode uses composite sync
217                      </p></dd><dt><span class="term">DRM_MODE_FLAG_PCSYNC</span></dt><dd><p>
218                        Composite sync is active high
219                      </p></dd><dt><span class="term">DRM_MODE_FLAG_NCSYNC</span></dt><dd><p>
220                        Composite sync is active low
221                      </p></dd><dt><span class="term">DRM_MODE_FLAG_HSKEW</span></dt><dd><p>
222                        hskew provided (not used?)
223                      </p></dd><dt><span class="term">DRM_MODE_FLAG_BCAST</span></dt><dd><p>
224                        not used?
225                      </p></dd><dt><span class="term">DRM_MODE_FLAG_PIXMUX</span></dt><dd><p>
226                        not used?
227                      </p></dd><dt><span class="term">DRM_MODE_FLAG_DBLCLK</span></dt><dd><p>
228                        not used?
229                      </p></dd><dt><span class="term">DRM_MODE_FLAG_CLKDIV2</span></dt><dd><p>
230                        ?
231                      </p></dd></dl></div><p>
232                </p><p>
233                  Note that modes marked with the INTERLACE or DBLSCAN flags will be
234                  filtered out by
235                  <code class="function"><a class="link" href="API-drm-helper-probe-single-connector-modes.html" title="drm_helper_probe_single_connector_modes">drm_helper_probe_single_connector_modes</a></code> if
236                  the connector's <em class="structfield"><code>interlace_allowed</code></em> or
237                  <em class="structfield"><code>doublescan_allowed</code></em> field is set to 0.
238                </p></li><li class="listitem"><pre class="synopsis">char name[DRM_DISPLAY_MODE_LEN];</pre><p>
239                  Mode name. The driver must call
240                  <code class="function"><a class="link" href="API-drm-mode-set-name.html" title="drm_mode_set_name">drm_mode_set_name</a></code> to fill the mode name from
241                  <em class="structfield"><code>hdisplay</code></em>,
242                  <em class="structfield"><code>vdisplay</code></em> and interlace flag after
243                  filling the corresponding fields.
244                </p></li></ul></div><p>
245          </p><p>
246            The <em class="structfield"><code>vrefresh</code></em> value is computed by
247            <code class="function"><a class="link" href="API-drm-helper-probe-single-connector-modes.html" title="drm_helper_probe_single_connector_modes">drm_helper_probe_single_connector_modes</a></code>.
248          </p><p>
249            When parsing EDID data, <code class="function"><a class="link" href="API-drm-add-edid-modes.html" title="drm_add_edid_modes">drm_add_edid_modes</a></code> fills the
250            connector <em class="structfield"><code>display_info</code></em>
251            <em class="structfield"><code>width_mm</code></em> and
252            <em class="structfield"><code>height_mm</code></em> fields. When creating modes
253            manually the <code class="methodname">get_modes</code> helper operation must
254            set the <em class="structfield"><code>display_info</code></em>
255            <em class="structfield"><code>width_mm</code></em> and
256            <em class="structfield"><code>height_mm</code></em> fields if they haven't been set
257            already (for instance at initialization time when a fixed-size panel is
258            attached to the connector). The mode <em class="structfield"><code>width_mm</code></em>
259            and <em class="structfield"><code>height_mm</code></em> fields are only used internally
260            during EDID parsing and should not be set when creating modes manually.
261          </p></li><li class="listitem"><pre class="synopsis">int (*mode_valid)(struct drm_connector *connector,
262		  struct drm_display_mode *mode);</pre><p>
263            Verify whether a mode is valid for the connector. Return MODE_OK for
264            supported modes and one of the enum drm_mode_status values (MODE_*)
265            for unsupported modes. This operation is optional.
266          </p><p>
267            As the mode rejection reason is currently not used beside for
268            immediately removing the unsupported mode, an implementation can
269            return MODE_BAD regardless of the exact reason why the mode is not
270            valid.
271          </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
272            Note that the <code class="methodname">mode_valid</code> helper operation is
273            only called for modes detected by the device, and
274            <span class="emphasis"><em>not</em></span> for modes set by the user through the CRTC
275            <code class="methodname">set_config</code> operation.
276          </p></div></li></ul></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.10"></a>Atomic Modeset Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect3"><a href="ch02s05.html#id-1.3.4.9.10.2">Overview</a></span></dt><dt><span class="sect3"><a href="ch02s05.html#id-1.3.4.9.10.3">Implementing Asynchronous Atomic Commit</a></span></dt><dt><span class="sect3"><a href="ch02s05.html#id-1.3.4.9.10.4">Atomic State Reset and Initialization</a></span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-crtc-for-each-plane.html"><span class="phrase">drm_atomic_crtc_for_each_plane</span></a></span><span class="refpurpose"> — 
277  iterate over planes currently attached to CRTC
278 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-crtc-state-for-each-plane.html"><span class="phrase">drm_atomic_crtc_state_for_each_plane</span></a></span><span class="refpurpose"> — 
279     iterate over attached planes in new state
280 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-check-modeset.html"><span class="phrase">drm_atomic_helper_check_modeset</span></a></span><span class="refpurpose"> — 
281  validate state object for modeset changes
282 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-check-planes.html"><span class="phrase">drm_atomic_helper_check_planes</span></a></span><span class="refpurpose"> — 
283     validate state object for planes changes
284 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-check.html"><span class="phrase">drm_atomic_helper_check</span></a></span><span class="refpurpose"> — 
285     validate state object
286 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-update-legacy-modeset-state.html"><span class="phrase">drm_atomic_helper_update_legacy_modeset_state</span></a></span><span class="refpurpose"> — 
287     update legacy modeset state
288 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-commit-modeset-disables.html"><span class="phrase">drm_atomic_helper_commit_modeset_disables</span></a></span><span class="refpurpose"> — 
289     modeset commit to disable outputs
290 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-commit-modeset-enables.html"><span class="phrase">drm_atomic_helper_commit_modeset_enables</span></a></span><span class="refpurpose"> — 
291     modeset commit to enable outputs
292 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-wait-for-vblanks.html"><span class="phrase">drm_atomic_helper_wait_for_vblanks</span></a></span><span class="refpurpose"> — 
293     wait for vblank on crtcs
294 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-commit.html"><span class="phrase">drm_atomic_helper_commit</span></a></span><span class="refpurpose"> — 
295     commit validated state object
296 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-prepare-planes.html"><span class="phrase">drm_atomic_helper_prepare_planes</span></a></span><span class="refpurpose"> — 
297     prepare plane resources before commit
298 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-commit-planes.html"><span class="phrase">drm_atomic_helper_commit_planes</span></a></span><span class="refpurpose"> — 
299     commit plane state
300 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-commit-planes-on-crtc.html"><span class="phrase">drm_atomic_helper_commit_planes_on_crtc</span></a></span><span class="refpurpose"> — 
301     commit plane state for a crtc
302 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-cleanup-planes.html"><span class="phrase">drm_atomic_helper_cleanup_planes</span></a></span><span class="refpurpose"> — 
303     cleanup plane resources after commit
304 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-swap-state.html"><span class="phrase">drm_atomic_helper_swap_state</span></a></span><span class="refpurpose"> — 
305     store atomic state into current sw state
306 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-update-plane.html"><span class="phrase">drm_atomic_helper_update_plane</span></a></span><span class="refpurpose"> — 
307     Helper for primary plane update using atomic
308 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-disable-plane.html"><span class="phrase">drm_atomic_helper_disable_plane</span></a></span><span class="refpurpose"> — 
309     Helper for primary plane disable using * atomic
310 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-set-config.html"><span class="phrase">drm_atomic_helper_set_config</span></a></span><span class="refpurpose"> — 
311     set a new config from userspace
312 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-crtc-set-property.html"><span class="phrase">drm_atomic_helper_crtc_set_property</span></a></span><span class="refpurpose"> — 
313     helper for crtc properties
314 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-plane-set-property.html"><span class="phrase">drm_atomic_helper_plane_set_property</span></a></span><span class="refpurpose"> — 
315     helper for plane properties
316 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-connector-set-property.html"><span class="phrase">drm_atomic_helper_connector_set_property</span></a></span><span class="refpurpose"> — 
317     helper for connector properties
318 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-page-flip.html"><span class="phrase">drm_atomic_helper_page_flip</span></a></span><span class="refpurpose"> — 
319     execute a legacy page flip
320 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-connector-dpms.html"><span class="phrase">drm_atomic_helper_connector_dpms</span></a></span><span class="refpurpose"> — 
321     connector dpms helper implementation
322 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-crtc-reset.html"><span class="phrase">drm_atomic_helper_crtc_reset</span></a></span><span class="refpurpose"> — 
323     default -&gt;reset hook for CRTCs
324 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-crtc-duplicate-state.html"><span class="phrase">__drm_atomic_helper_crtc_duplicate_state</span></a></span><span class="refpurpose"> — 
325     copy atomic CRTC state
326 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-crtc-duplicate-state.html"><span class="phrase">drm_atomic_helper_crtc_duplicate_state</span></a></span><span class="refpurpose"> — 
327     default state duplicate hook
328 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-crtc-destroy-state.html"><span class="phrase">__drm_atomic_helper_crtc_destroy_state</span></a></span><span class="refpurpose"> — 
329     release CRTC state
330 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-crtc-destroy-state.html"><span class="phrase">drm_atomic_helper_crtc_destroy_state</span></a></span><span class="refpurpose"> — 
331     default state destroy hook
332 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-plane-reset.html"><span class="phrase">drm_atomic_helper_plane_reset</span></a></span><span class="refpurpose"> — 
333     default -&gt;reset hook for planes
334 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-plane-duplicate-state.html"><span class="phrase">__drm_atomic_helper_plane_duplicate_state</span></a></span><span class="refpurpose"> — 
335     copy atomic plane state
336 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-plane-duplicate-state.html"><span class="phrase">drm_atomic_helper_plane_duplicate_state</span></a></span><span class="refpurpose"> — 
337     default state duplicate hook
338 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-plane-destroy-state.html"><span class="phrase">__drm_atomic_helper_plane_destroy_state</span></a></span><span class="refpurpose"> — 
339     release plane state
340 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-plane-destroy-state.html"><span class="phrase">drm_atomic_helper_plane_destroy_state</span></a></span><span class="refpurpose"> — 
341     default state destroy hook
342 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-connector-reset.html"><span class="phrase">drm_atomic_helper_connector_reset</span></a></span><span class="refpurpose"> — 
343     default -&gt;reset hook for connectors
344 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-connector-duplicate-state.html"><span class="phrase">__drm_atomic_helper_connector_duplicate_state</span></a></span><span class="refpurpose"> — 
345     copy atomic connector state
346 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-connector-duplicate-state.html"><span class="phrase">drm_atomic_helper_connector_duplicate_state</span></a></span><span class="refpurpose"> — 
347     default state duplicate hook
348 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-duplicate-state.html"><span class="phrase">drm_atomic_helper_duplicate_state</span></a></span><span class="refpurpose"> — 
349     duplicate an atomic state object
350 </span></dt><dt><span class="refentrytitle"><a href="API---drm-atomic-helper-connector-destroy-state.html"><span class="phrase">__drm_atomic_helper_connector_destroy_state</span></a></span><span class="refpurpose"> — 
351     release connector state
352 </span></dt><dt><span class="refentrytitle"><a href="API-drm-atomic-helper-connector-destroy-state.html"><span class="phrase">drm_atomic_helper_connector_destroy_state</span></a></span><span class="refpurpose"> — 
353     default state destroy hook
354 </span></dt></dl></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="id-1.3.4.9.10.2"></a>Overview</h4></div></div></div><p>
355   </p><p>
356   This helper library provides implementations of check and commit functions on
357   top of the CRTC modeset helper callbacks and the plane helper callbacks. It
358   also provides convenience implementations for the atomic state handling
359   callbacks for drivers which don't need to subclass the drm core structures to
360   add their own additional internal state.
361   </p><p>
362   This library also provides default implementations for the check callback in
363   <code class="function"><a class="link" href="API-drm-atomic-helper-check.html" title="drm_atomic_helper_check">drm_atomic_helper_check</a></code> and for the commit callback with
364   <code class="function"><a class="link" href="API-drm-atomic-helper-commit.html" title="drm_atomic_helper_commit">drm_atomic_helper_commit</a></code>. But the individual stages and callbacks are
365   exposed to allow drivers to mix and match and e.g. use the plane helpers only
366   together with a driver private modeset implementation.
367   </p><p>
368   This library also provides implementations for all the legacy driver
369   interfaces on top of the atomic interface. See <code class="function"><a class="link" href="API-drm-atomic-helper-set-config.html" title="drm_atomic_helper_set_config">drm_atomic_helper_set_config</a></code>,
370   <code class="function"><a class="link" href="API-drm-atomic-helper-disable-plane.html" title="drm_atomic_helper_disable_plane">drm_atomic_helper_disable_plane</a></code>, <code class="function"><a class="link" href="API-drm-atomic-helper-disable-plane.html" title="drm_atomic_helper_disable_plane">drm_atomic_helper_disable_plane</a></code> and the
371   various functions to implement set_property callbacks. New drivers must not
372   implement these functions themselves but must use the provided helpers.
373</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="id-1.3.4.9.10.3"></a>Implementing Asynchronous Atomic Commit</h4></div></div></div><p>
374   </p><p>
375   For now the atomic helpers don't support async commit directly. If there is
376   real need it could be added though, using the dma-buf fence infrastructure
377   for generic synchronization with outstanding rendering.
378   </p><p>
379   For now drivers have to implement async commit themselves, with the following
380   sequence being the recommended one:
381   </p><p>
382   1. Run <code class="function"><a class="link" href="API-drm-atomic-helper-prepare-planes.html" title="drm_atomic_helper_prepare_planes">drm_atomic_helper_prepare_planes</a></code> first. This is the only function
383   which commit needs to call which can fail, so we want to run it first and
384   synchronously.
385   </p><p>
386   2. Synchronize with any outstanding asynchronous commit worker threads which
387   might be affected the new state update. This can be done by either cancelling
388   or flushing the work items, depending upon whether the driver can deal with
389   cancelled updates. Note that it is important to ensure that the framebuffer
390   cleanup is still done when cancelling.
391   </p><p>
392   For sufficient parallelism it is recommended to have a work item per crtc
393   (for updates which don't touch global state) and a global one. Then we only
394   need to synchronize with the crtc work items for changed crtcs and the global
395   work item, which allows nice concurrent updates on disjoint sets of crtcs.
396   </p><p>
397   3. The software state is updated synchronously with
398   <code class="function"><a class="link" href="API-drm-atomic-helper-swap-state.html" title="drm_atomic_helper_swap_state">drm_atomic_helper_swap_state</a></code>. Doing this under the protection of all modeset
399   locks means concurrent callers never see inconsistent state. And doing this
400   while it's guaranteed that no relevant async worker runs means that async
401   workers do not need grab any locks. Actually they must not grab locks, for
402   otherwise the work flushing will deadlock.
403   </p><p>
404   4. Schedule a work item to do all subsequent steps, using the split-out
405   commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and
406   then cleaning up the framebuffers after the old framebuffer is no longer
407   being displayed.
408</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="id-1.3.4.9.10.4"></a>Atomic State Reset and Initialization</h4></div></div></div><p>
409   </p><p>
410   Both the drm core and the atomic helpers assume that there is always the full
411   and correct atomic software state for all connectors, CRTCs and planes
412   available. Which is a bit a problem on driver load and also after system
413   suspend. One way to solve this is to have a hardware state read-out
414   infrastructure which reconstructs the full software state (e.g. the i915
415   driver).
416   </p><p>
417   The simpler solution is to just reset the software state to everything off,
418   which is easiest to do by calling <code class="function"><a class="link" href="API-drm-mode-config-reset.html" title="drm_mode_config_reset">drm_mode_config_reset</a></code>. To facilitate this
419   the atomic helpers provide default reset implementations for all hooks.
420</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.11"></a>Modeset Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-drm-crtc-helper-funcs.html"><span class="phrase">struct drm_crtc_helper_funcs</span></a></span><span class="refpurpose"> — 
421  helper operations for CRTCs
422 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-encoder-helper-funcs.html"><span class="phrase">struct drm_encoder_helper_funcs</span></a></span><span class="refpurpose"> — 
423     helper operations for encoders
424 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-connector-helper-funcs.html"><span class="phrase">struct drm_connector_helper_funcs</span></a></span><span class="refpurpose"> — 
425     helper operations for connectors
426 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-move-panel-connectors-to-head.html"><span class="phrase">drm_helper_move_panel_connectors_to_head</span></a></span><span class="refpurpose"> — 
427  move panels to the front in the connector list
428 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-encoder-in-use.html"><span class="phrase">drm_helper_encoder_in_use</span></a></span><span class="refpurpose"> — 
429     check if a given encoder is in use
430 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-crtc-in-use.html"><span class="phrase">drm_helper_crtc_in_use</span></a></span><span class="refpurpose"> — 
431     check if a given CRTC is in a mode_config
432 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-disable-unused-functions.html"><span class="phrase">drm_helper_disable_unused_functions</span></a></span><span class="refpurpose"> — 
433     disable unused objects
434 </span></dt><dt><span class="refentrytitle"><a href="API-drm-crtc-helper-set-mode.html"><span class="phrase">drm_crtc_helper_set_mode</span></a></span><span class="refpurpose"> — 
435     internal helper to set a mode
436 </span></dt><dt><span class="refentrytitle"><a href="API-drm-crtc-helper-set-config.html"><span class="phrase">drm_crtc_helper_set_config</span></a></span><span class="refpurpose"> — 
437     set a new config from userspace
438 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-connector-dpms.html"><span class="phrase">drm_helper_connector_dpms</span></a></span><span class="refpurpose"> — 
439     connector dpms helper implementation
440 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-mode-fill-fb-struct.html"><span class="phrase">drm_helper_mode_fill_fb_struct</span></a></span><span class="refpurpose"> — 
441     fill out framebuffer metadata
442 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-resume-force-mode.html"><span class="phrase">drm_helper_resume_force_mode</span></a></span><span class="refpurpose"> — 
443     force-restore mode setting configuration
444 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-crtc-mode-set.html"><span class="phrase">drm_helper_crtc_mode_set</span></a></span><span class="refpurpose"> — 
445     mode_set implementation for atomic plane helpers
446 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-crtc-mode-set-base.html"><span class="phrase">drm_helper_crtc_mode_set_base</span></a></span><span class="refpurpose"> — 
447     mode_set_base implementation for atomic plane helpers
448 </span></dt></dl></div><p>
449   </p><p>
450   The CRTC modeset helper library provides a default set_config implementation
451   in <code class="function"><a class="link" href="API-drm-crtc-helper-set-config.html" title="drm_crtc_helper_set_config">drm_crtc_helper_set_config</a></code>. Plus a few other convenience functions using
452   the same callbacks which drivers can use to e.g. restore the modeset
453   configuration on resume with <code class="function"><a class="link" href="API-drm-helper-resume-force-mode.html" title="drm_helper_resume_force_mode">drm_helper_resume_force_mode</a></code>.
454   </p><p>
455   The driver callbacks are mostly compatible with the atomic modeset helpers,
456   except for the handling of the primary plane: Atomic helpers require that the
457   primary plane is implemented as a real standalone plane and not directly tied
458   to the CRTC state. For easier transition this library provides functions to
459   implement the old semantics required by the CRTC helpers using the new plane
460   and atomic helper callbacks.
461   </p><p>
462   Drivers are strongly urged to convert to the atomic helpers (by way of first
463   converting to the plane helpers). New drivers must not use these functions
464   but need to implement the atomic interface instead, potentially using the
465   atomic helpers for that.
466</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.12"></a>Output Probing Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-drm-kms-helper-poll-enable-locked.html"><span class="phrase">drm_kms_helper_poll_enable_locked</span></a></span><span class="refpurpose"> — 
467  re-enable output polling.
468 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-probe-single-connector-modes.html"><span class="phrase">drm_helper_probe_single_connector_modes</span></a></span><span class="refpurpose"> — 
469     get complete set of display modes
470 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-probe-single-connector-modes-nomerge.html"><span class="phrase">drm_helper_probe_single_connector_modes_nomerge</span></a></span><span class="refpurpose"> — 
471     get complete set of display modes
472 </span></dt><dt><span class="refentrytitle"><a href="API-drm-kms-helper-hotplug-event.html"><span class="phrase">drm_kms_helper_hotplug_event</span></a></span><span class="refpurpose"> — 
473     fire off KMS hotplug events
474 </span></dt><dt><span class="refentrytitle"><a href="API-drm-kms-helper-poll-disable.html"><span class="phrase">drm_kms_helper_poll_disable</span></a></span><span class="refpurpose"> — 
475     disable output polling
476 </span></dt><dt><span class="refentrytitle"><a href="API-drm-kms-helper-poll-enable.html"><span class="phrase">drm_kms_helper_poll_enable</span></a></span><span class="refpurpose"> — 
477     re-enable output polling.
478 </span></dt><dt><span class="refentrytitle"><a href="API-drm-kms-helper-poll-init.html"><span class="phrase">drm_kms_helper_poll_init</span></a></span><span class="refpurpose"> — 
479     initialize and enable output polling
480 </span></dt><dt><span class="refentrytitle"><a href="API-drm-kms-helper-poll-fini.html"><span class="phrase">drm_kms_helper_poll_fini</span></a></span><span class="refpurpose"> — 
481     disable output polling and clean it up
482 </span></dt><dt><span class="refentrytitle"><a href="API-drm-helper-hpd-irq-event.html"><span class="phrase">drm_helper_hpd_irq_event</span></a></span><span class="refpurpose"> — 
483     hotplug processing
484 </span></dt></dl></div><p>
485   </p><p>
486   This library provides some helper code for output probing. It provides an
487   implementation of the core connector-&gt;fill_modes interface with
488   drm_helper_probe_single_connector_modes.
489   </p><p>
490   It also provides support for polling connectors with a work item and for
491   generic hotplug interrupt handling where the driver doesn't or cannot keep
492   track of a per-connector hpd interrupt.
493   </p><p>
494   This helper library can be used independently of the modeset helper library.
495   Drivers can also overwrite different parts e.g. use their own hotplug
496   handling code to avoid probing unrelated outputs.
497</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.13"></a>fbdev Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-drm-fb-helper-single-add-all-connectors.html"><span class="phrase">drm_fb_helper_single_add_all_connectors</span></a></span><span class="refpurpose"> — 
498  add all connectors to fbdev emulation helper
499 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-debug-enter.html"><span class="phrase">drm_fb_helper_debug_enter</span></a></span><span class="refpurpose"> — 
500     implementation for -&gt;fb_debug_enter
501 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-debug-leave.html"><span class="phrase">drm_fb_helper_debug_leave</span></a></span><span class="refpurpose"> — 
502     implementation for -&gt;fb_debug_leave
503 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-restore-fbdev-mode-unlocked.html"><span class="phrase">drm_fb_helper_restore_fbdev_mode_unlocked</span></a></span><span class="refpurpose"> — 
504     restore fbdev configuration
505 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-blank.html"><span class="phrase">drm_fb_helper_blank</span></a></span><span class="refpurpose"> — 
506     implementation for -&gt;fb_blank
507 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-prepare.html"><span class="phrase">drm_fb_helper_prepare</span></a></span><span class="refpurpose"> — 
508     setup a drm_fb_helper structure
509 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-init.html"><span class="phrase">drm_fb_helper_init</span></a></span><span class="refpurpose"> — 
510     initialize a drm_fb_helper structure
511 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-alloc-fbi.html"><span class="phrase">drm_fb_helper_alloc_fbi</span></a></span><span class="refpurpose"> — 
512     allocate fb_info and some of its members
513 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-unregister-fbi.html"><span class="phrase">drm_fb_helper_unregister_fbi</span></a></span><span class="refpurpose"> — 
514     unregister fb_info framebuffer device
515 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-release-fbi.html"><span class="phrase">drm_fb_helper_release_fbi</span></a></span><span class="refpurpose"> — 
516     dealloc fb_info and its members
517 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-unlink-fbi.html"><span class="phrase">drm_fb_helper_unlink_fbi</span></a></span><span class="refpurpose"> — 
518     wrapper around unlink_framebuffer
519 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-sys-read.html"><span class="phrase">drm_fb_helper_sys_read</span></a></span><span class="refpurpose"> — 
520     wrapper around fb_sys_read
521 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-sys-write.html"><span class="phrase">drm_fb_helper_sys_write</span></a></span><span class="refpurpose"> — 
522     wrapper around fb_sys_write
523 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-sys-fillrect.html"><span class="phrase">drm_fb_helper_sys_fillrect</span></a></span><span class="refpurpose"> — 
524     wrapper around sys_fillrect
525 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-sys-copyarea.html"><span class="phrase">drm_fb_helper_sys_copyarea</span></a></span><span class="refpurpose"> — 
526     wrapper around sys_copyarea
527 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-sys-imageblit.html"><span class="phrase">drm_fb_helper_sys_imageblit</span></a></span><span class="refpurpose"> — 
528     wrapper around sys_imageblit
529 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-cfb-fillrect.html"><span class="phrase">drm_fb_helper_cfb_fillrect</span></a></span><span class="refpurpose"> — 
530     wrapper around cfb_fillrect
531 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-cfb-copyarea.html"><span class="phrase">drm_fb_helper_cfb_copyarea</span></a></span><span class="refpurpose"> — 
532     wrapper around cfb_copyarea
533 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-cfb-imageblit.html"><span class="phrase">drm_fb_helper_cfb_imageblit</span></a></span><span class="refpurpose"> — 
534     wrapper around cfb_imageblit
535 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-set-suspend.html"><span class="phrase">drm_fb_helper_set_suspend</span></a></span><span class="refpurpose"> — 
536     wrapper around fb_set_suspend
537 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-setcmap.html"><span class="phrase">drm_fb_helper_setcmap</span></a></span><span class="refpurpose"> — 
538     implementation for -&gt;fb_setcmap
539 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-check-var.html"><span class="phrase">drm_fb_helper_check_var</span></a></span><span class="refpurpose"> — 
540     implementation for -&gt;fb_check_var
541 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-set-par.html"><span class="phrase">drm_fb_helper_set_par</span></a></span><span class="refpurpose"> — 
542     implementation for -&gt;fb_set_par
543 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-pan-display.html"><span class="phrase">drm_fb_helper_pan_display</span></a></span><span class="refpurpose"> — 
544     implementation for -&gt;fb_pan_display
545 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-fill-fix.html"><span class="phrase">drm_fb_helper_fill_fix</span></a></span><span class="refpurpose"> — 
546     initializes fixed fbdev information
547 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-fill-var.html"><span class="phrase">drm_fb_helper_fill_var</span></a></span><span class="refpurpose"> — 
548     initalizes variable fbdev information
549 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-initial-config.html"><span class="phrase">drm_fb_helper_initial_config</span></a></span><span class="refpurpose"> — 
550     setup a sane initial connector configuration
551 </span></dt><dt><span class="refentrytitle"><a href="API-drm-fb-helper-hotplug-event.html"><span class="phrase">drm_fb_helper_hotplug_event</span></a></span><span class="refpurpose"> — 
552     respond to a hotplug notification by probing all the outputs attached to the fb
553 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-fb-helper-surface-size.html"><span class="phrase">struct drm_fb_helper_surface_size</span></a></span><span class="refpurpose"> — 
554  describes fbdev size and scanout surface size
555 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-fb-helper-funcs.html"><span class="phrase">struct drm_fb_helper_funcs</span></a></span><span class="refpurpose"> — 
556     driver callbacks for the fbdev emulation library
557 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-fb-helper.html"><span class="phrase">struct drm_fb_helper</span></a></span><span class="refpurpose"> — 
558     helper to emulate fbdev on top of kms
559 </span></dt></dl></div><p>
560   </p><p>
561   The fb helper functions are useful to provide an fbdev on top of a drm kernel
562   mode setting driver. They can be used mostly independently from the crtc
563   helper functions used by many drivers to implement the kernel mode setting
564   interfaces.
565   </p><p>
566   Initialization is done as a four-step process with <code class="function"><a class="link" href="API-drm-fb-helper-prepare.html" title="drm_fb_helper_prepare">drm_fb_helper_prepare</a></code>,
567   <code class="function"><a class="link" href="API-drm-fb-helper-init.html" title="drm_fb_helper_init">drm_fb_helper_init</a></code>, <code class="function"><a class="link" href="API-drm-fb-helper-single-add-all-connectors.html" title="drm_fb_helper_single_add_all_connectors">drm_fb_helper_single_add_all_connectors</a></code> and
568   <code class="function"><a class="link" href="API-drm-fb-helper-initial-config.html" title="drm_fb_helper_initial_config">drm_fb_helper_initial_config</a></code>. Drivers with fancier requirements than the
569   default behaviour can override the third step with their own code.
570   Teardown is done with <code class="function">drm_fb_helper_fini</code>.
571   </p><p>
572   At runtime drivers should restore the fbdev console by calling
573   <code class="function"><a class="link" href="API-drm-fb-helper-restore-fbdev-mode-unlocked.html" title="drm_fb_helper_restore_fbdev_mode_unlocked">drm_fb_helper_restore_fbdev_mode_unlocked</a></code> from their -&gt;lastclose callback.
574   They should also notify the fb helper code from updates to the output
575   configuration by calling <code class="function"><a class="link" href="API-drm-fb-helper-hotplug-event.html" title="drm_fb_helper_hotplug_event">drm_fb_helper_hotplug_event</a></code>. For easier
576   integration with the output polling code in drm_crtc_helper.c the modeset
577   code provides a -&gt;output_poll_changed callback.
578   </p><p>
579   All other functions exported by the fb helper library can be used to
580   implement the fbdev driver interface by the driver.
581   </p><p>
582   It is possible, though perhaps somewhat tricky, to implement race-free
583   hotplug detection using the fbdev helpers. The <code class="function"><a class="link" href="API-drm-fb-helper-prepare.html" title="drm_fb_helper_prepare">drm_fb_helper_prepare</a></code>
584   helper must be called first to initialize the minimum required to make
585   hotplug detection work. Drivers also need to make sure to properly set up
586   the dev-&gt;mode_config.funcs member. After calling <code class="function"><a class="link" href="API-drm-kms-helper-poll-init.html" title="drm_kms_helper_poll_init">drm_kms_helper_poll_init</a></code>
587   it is safe to enable interrupts and start processing hotplug events. At the
588   same time, drivers should initialize all modeset objects such as CRTCs,
589   encoders and connectors. To finish up the fbdev helper initialization, the
590   <code class="function"><a class="link" href="API-drm-fb-helper-init.html" title="drm_fb_helper_init">drm_fb_helper_init</a></code> function is called. To probe for all attached displays
591   and set up an initial configuration using the detected hardware, drivers
592   should call <code class="function"><a class="link" href="API-drm-fb-helper-single-add-all-connectors.html" title="drm_fb_helper_single_add_all_connectors">drm_fb_helper_single_add_all_connectors</a></code> followed by
593   <code class="function"><a class="link" href="API-drm-fb-helper-initial-config.html" title="drm_fb_helper_initial_config">drm_fb_helper_initial_config</a></code>.
594</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.14"></a>Display Port Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-drm-dp-aux-msg.html"><span class="phrase">struct drm_dp_aux_msg</span></a></span><span class="refpurpose"> — 
595  DisplayPort AUX channel transaction
596 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-dp-aux.html"><span class="phrase">struct drm_dp_aux</span></a></span><span class="refpurpose"> — 
597     DisplayPort AUX channel
598 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-dpcd-readb.html"><span class="phrase">drm_dp_dpcd_readb</span></a></span><span class="refpurpose"> — 
599     read a single byte from the DPCD
600 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-dpcd-writeb.html"><span class="phrase">drm_dp_dpcd_writeb</span></a></span><span class="refpurpose"> — 
601     write a single byte to the DPCD
602 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-dpcd-read.html"><span class="phrase">drm_dp_dpcd_read</span></a></span><span class="refpurpose"> — 
603  read a series of bytes from the DPCD
604 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-dpcd-write.html"><span class="phrase">drm_dp_dpcd_write</span></a></span><span class="refpurpose"> — 
605     write a series of bytes to the DPCD
606 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-dpcd-read-link-status.html"><span class="phrase">drm_dp_dpcd_read_link_status</span></a></span><span class="refpurpose"> — 
607     read DPCD link status (bytes 0x202-0x207)
608 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-link-probe.html"><span class="phrase">drm_dp_link_probe</span></a></span><span class="refpurpose"> — 
609     probe a DisplayPort link for capabilities
610 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-link-power-up.html"><span class="phrase">drm_dp_link_power_up</span></a></span><span class="refpurpose"> — 
611     power up a DisplayPort link
612 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-link-power-down.html"><span class="phrase">drm_dp_link_power_down</span></a></span><span class="refpurpose"> — 
613     power down a DisplayPort link
614 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-link-configure.html"><span class="phrase">drm_dp_link_configure</span></a></span><span class="refpurpose"> — 
615     configure a DisplayPort link
616 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-aux-register.html"><span class="phrase">drm_dp_aux_register</span></a></span><span class="refpurpose"> — 
617     initialise and register aux channel
618 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-aux-unregister.html"><span class="phrase">drm_dp_aux_unregister</span></a></span><span class="refpurpose"> — 
619     unregister an AUX adapter
620 </span></dt></dl></div><p>
621   </p><p>
622   These functions contain some common logic and helpers at various abstraction
623   levels to deal with Display Port sink devices and related things like DP aux
624   channel transfers, EDID reading over DP aux channels, decoding certain DPCD
625   blocks, ...
626</p><p>
627   </p><p>
628   The DisplayPort AUX channel is an abstraction to allow generic, driver-
629   independent access to AUX functionality. Drivers can take advantage of
630   this by filling in the fields of the drm_dp_aux structure.
631   </p><p>
632   Transactions are described using a hardware-independent drm_dp_aux_msg
633   structure, which is passed into a driver's .<code class="function">transfer</code> implementation.
634   Both native and I2C-over-AUX transactions are supported.
635</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.15"></a>Display Port MST Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-drm-dp-vcpi.html"><span class="phrase">struct drm_dp_vcpi</span></a></span><span class="refpurpose"> — 
636  Virtual Channel Payload Identifier
637 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-dp-mst-port.html"><span class="phrase">struct drm_dp_mst_port</span></a></span><span class="refpurpose"> — 
638     MST port
639 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-dp-mst-branch.html"><span class="phrase">struct drm_dp_mst_branch</span></a></span><span class="refpurpose"> — 
640     MST branch device.
641 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-dp-mst-topology-mgr.html"><span class="phrase">struct drm_dp_mst_topology_mgr</span></a></span><span class="refpurpose"> — 
642     DisplayPort MST manager
643 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-update-payload-part1.html"><span class="phrase">drm_dp_update_payload_part1</span></a></span><span class="refpurpose"> — 
644  Execute payload update part 1
645 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-update-payload-part2.html"><span class="phrase">drm_dp_update_payload_part2</span></a></span><span class="refpurpose"> — 
646     Execute payload update part 2
647 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-topology-mgr-set-mst.html"><span class="phrase">drm_dp_mst_topology_mgr_set_mst</span></a></span><span class="refpurpose"> — 
648     Set the MST state for a topology manager
649 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-topology-mgr-suspend.html"><span class="phrase">drm_dp_mst_topology_mgr_suspend</span></a></span><span class="refpurpose"> — 
650     suspend the MST manager
651 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-topology-mgr-resume.html"><span class="phrase">drm_dp_mst_topology_mgr_resume</span></a></span><span class="refpurpose"> — 
652     resume the MST manager
653 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-hpd-irq.html"><span class="phrase">drm_dp_mst_hpd_irq</span></a></span><span class="refpurpose"> — 
654     MST hotplug IRQ notify
655 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-detect-port.html"><span class="phrase">drm_dp_mst_detect_port</span></a></span><span class="refpurpose"> — 
656     get connection status for an MST port
657 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-get-edid.html"><span class="phrase">drm_dp_mst_get_edid</span></a></span><span class="refpurpose"> — 
658     get EDID for an MST port
659 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-find-vcpi-slots.html"><span class="phrase">drm_dp_find_vcpi_slots</span></a></span><span class="refpurpose"> — 
660     find slots for this PBN value
661 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-allocate-vcpi.html"><span class="phrase">drm_dp_mst_allocate_vcpi</span></a></span><span class="refpurpose"> — 
662     Allocate a virtual channel
663 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-reset-vcpi-slots.html"><span class="phrase">drm_dp_mst_reset_vcpi_slots</span></a></span><span class="refpurpose"> — 
664     Reset number of slots to 0 for VCPI
665 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-deallocate-vcpi.html"><span class="phrase">drm_dp_mst_deallocate_vcpi</span></a></span><span class="refpurpose"> — 
666     deallocate a VCPI
667 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-check-act-status.html"><span class="phrase">drm_dp_check_act_status</span></a></span><span class="refpurpose"> — 
668     Check ACT handled status.
669 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-calc-pbn-mode.html"><span class="phrase">drm_dp_calc_pbn_mode</span></a></span><span class="refpurpose"> — 
670     Calculate the PBN for a mode.
671 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-dump-topology.html"><span class="phrase">drm_dp_mst_dump_topology</span></a></span><span class="refpurpose"> — 
672   </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-topology-mgr-init.html"><span class="phrase">drm_dp_mst_topology_mgr_init</span></a></span><span class="refpurpose"> — 
673     initialise a topology manager
674 </span></dt><dt><span class="refentrytitle"><a href="API-drm-dp-mst-topology-mgr-destroy.html"><span class="phrase">drm_dp_mst_topology_mgr_destroy</span></a></span><span class="refpurpose"> — 
675     destroy topology manager.
676 </span></dt></dl></div><p>
677   </p><p>
678   These functions contain parts of the DisplayPort 1.2a MultiStream Transport
679   protocol. The helpers contain a topology manager and bandwidth manager.
680   The helpers encapsulate the sending and received of sideband msgs.
681</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.16"></a>MIPI DSI Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-msg.html"><span class="phrase">struct mipi_dsi_msg</span></a></span><span class="refpurpose"> — 
682  read/write DSI buffer
683 </span></dt><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-packet.html"><span class="phrase">struct mipi_dsi_packet</span></a></span><span class="refpurpose"> — 
684     represents a MIPI DSI packet in protocol format
685 </span></dt><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-host-ops.html"><span class="phrase">struct mipi_dsi_host_ops</span></a></span><span class="refpurpose"> — 
686     DSI bus operations
687 </span></dt><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-host.html"><span class="phrase">struct mipi_dsi_host</span></a></span><span class="refpurpose"> — 
688     DSI host device
689 </span></dt><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-device.html"><span class="phrase">struct mipi_dsi_device</span></a></span><span class="refpurpose"> — 
690     DSI peripheral device
691 </span></dt><dt><span class="refentrytitle"><a href="API-enum-mipi-dsi-dcs-tear-mode.html"><span class="phrase">enum mipi_dsi_dcs_tear_mode</span></a></span><span class="refpurpose"> — 
692     Tearing Effect Output Line mode
693 </span></dt><dt><span class="refentrytitle"><a href="API-struct-mipi-dsi-driver.html"><span class="phrase">struct mipi_dsi_driver</span></a></span><span class="refpurpose"> — 
694     DSI driver
695 </span></dt><dt><span class="refentrytitle"><a href="API-of-find-mipi-dsi-device-by-node.html"><span class="phrase">of_find_mipi_dsi_device_by_node</span></a></span><span class="refpurpose"> — 
696  find the MIPI DSI device matching a device tree node
697 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-attach.html"><span class="phrase">mipi_dsi_attach</span></a></span><span class="refpurpose"> — 
698     attach a DSI device to its DSI host
699 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-detach.html"><span class="phrase">mipi_dsi_detach</span></a></span><span class="refpurpose"> — 
700     detach a DSI device from its DSI host
701 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-packet-format-is-short.html"><span class="phrase">mipi_dsi_packet_format_is_short</span></a></span><span class="refpurpose"> — 
702     check if a packet is of the short format
703 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-packet-format-is-long.html"><span class="phrase">mipi_dsi_packet_format_is_long</span></a></span><span class="refpurpose"> — 
704     check if a packet is of the long format
705 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-create-packet.html"><span class="phrase">mipi_dsi_create_packet</span></a></span><span class="refpurpose"> — 
706     create a packet from a message according to the DSI protocol
707 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-generic-write.html"><span class="phrase">mipi_dsi_generic_write</span></a></span><span class="refpurpose"> — 
708     transmit data using a generic write packet
709 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-generic-read.html"><span class="phrase">mipi_dsi_generic_read</span></a></span><span class="refpurpose"> — 
710     receive data using a generic read packet
711 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-write-buffer.html"><span class="phrase">mipi_dsi_dcs_write_buffer</span></a></span><span class="refpurpose"> — 
712     transmit a DCS command with payload
713 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-write.html"><span class="phrase">mipi_dsi_dcs_write</span></a></span><span class="refpurpose"> — 
714     send DCS write command
715 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-read.html"><span class="phrase">mipi_dsi_dcs_read</span></a></span><span class="refpurpose"> — 
716     send DCS read request command
717 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-nop.html"><span class="phrase">mipi_dsi_dcs_nop</span></a></span><span class="refpurpose"> — 
718     send DCS nop packet
719 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-soft-reset.html"><span class="phrase">mipi_dsi_dcs_soft_reset</span></a></span><span class="refpurpose"> — 
720     perform a software reset of the display module
721 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-get-power-mode.html"><span class="phrase">mipi_dsi_dcs_get_power_mode</span></a></span><span class="refpurpose"> — 
722     query the display module's current power mode
723 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-get-pixel-format.html"><span class="phrase">mipi_dsi_dcs_get_pixel_format</span></a></span><span class="refpurpose"> — 
724     gets the pixel format for the RGB image data used by the interface
725 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-enter-sleep-mode.html"><span class="phrase">mipi_dsi_dcs_enter_sleep_mode</span></a></span><span class="refpurpose"> — 
726     disable all unnecessary blocks inside the display module except interface communication
727 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-exit-sleep-mode.html"><span class="phrase">mipi_dsi_dcs_exit_sleep_mode</span></a></span><span class="refpurpose"> — 
728     enable all blocks inside the display module
729 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-display-off.html"><span class="phrase">mipi_dsi_dcs_set_display_off</span></a></span><span class="refpurpose"> — 
730     stop displaying the image data on the display device
731 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-display-on.html"><span class="phrase">mipi_dsi_dcs_set_display_on</span></a></span><span class="refpurpose"> — 
732     start displaying the image data on the display device
733 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-column-address.html"><span class="phrase">mipi_dsi_dcs_set_column_address</span></a></span><span class="refpurpose"> — 
734     define the column extent of the frame memory accessed by the host processor
735 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-page-address.html"><span class="phrase">mipi_dsi_dcs_set_page_address</span></a></span><span class="refpurpose"> — 
736     define the page extent of the frame memory accessed by the host processor
737 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-tear-off.html"><span class="phrase">mipi_dsi_dcs_set_tear_off</span></a></span><span class="refpurpose"> — 
738     turn off the display module's Tearing Effect output signal on the TE signal line
739 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-tear-on.html"><span class="phrase">mipi_dsi_dcs_set_tear_on</span></a></span><span class="refpurpose"> — 
740     turn on the display module's Tearing Effect output signal on the TE signal line.
741 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-dcs-set-pixel-format.html"><span class="phrase">mipi_dsi_dcs_set_pixel_format</span></a></span><span class="refpurpose"> — 
742     sets the pixel format for the RGB image data used by the interface
743 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-driver-register-full.html"><span class="phrase">mipi_dsi_driver_register_full</span></a></span><span class="refpurpose"> — 
744     register a driver for DSI devices
745 </span></dt><dt><span class="refentrytitle"><a href="API-mipi-dsi-driver-unregister.html"><span class="phrase">mipi_dsi_driver_unregister</span></a></span><span class="refpurpose"> — 
746     unregister a driver for DSI devices
747 </span></dt></dl></div><p>
748   </p><p>
749   These functions contain some common logic and helpers to deal with MIPI DSI
750   peripherals.
751   </p><p>
752   Helpers are provided for a number of standard MIPI DSI command as well as a
753   subset of the MIPI DCS command set.
754</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.17"></a>EDID Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-drm-edid-header-is-valid.html"><span class="phrase">drm_edid_header_is_valid</span></a></span><span class="refpurpose"> — 
755  sanity check the header of the base EDID block
756 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-block-valid.html"><span class="phrase">drm_edid_block_valid</span></a></span><span class="refpurpose"> — 
757     Sanity check the EDID block (base or extension)
758 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-is-valid.html"><span class="phrase">drm_edid_is_valid</span></a></span><span class="refpurpose"> — 
759     sanity check EDID data
760 </span></dt><dt><span class="refentrytitle"><a href="API-drm-do-get-edid.html"><span class="phrase">drm_do_get_edid</span></a></span><span class="refpurpose"> — 
761     get EDID data using a custom EDID block read function
762 </span></dt><dt><span class="refentrytitle"><a href="API-drm-probe-ddc.html"><span class="phrase">drm_probe_ddc</span></a></span><span class="refpurpose"> — 
763     probe DDC presence
764 </span></dt><dt><span class="refentrytitle"><a href="API-drm-get-edid.html"><span class="phrase">drm_get_edid</span></a></span><span class="refpurpose"> — 
765     get EDID data, if available
766 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-duplicate.html"><span class="phrase">drm_edid_duplicate</span></a></span><span class="refpurpose"> — 
767     duplicate an EDID and the extensions
768 </span></dt><dt><span class="refentrytitle"><a href="API-drm-match-cea-mode.html"><span class="phrase">drm_match_cea_mode</span></a></span><span class="refpurpose"> — 
769     look for a CEA mode matching given mode
770 </span></dt><dt><span class="refentrytitle"><a href="API-drm-get-cea-aspect-ratio.html"><span class="phrase">drm_get_cea_aspect_ratio</span></a></span><span class="refpurpose"> — 
771     get the picture aspect ratio corresponding to the input VIC from the CEA mode list
772 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-to-eld.html"><span class="phrase">drm_edid_to_eld</span></a></span><span class="refpurpose"> — 
773     build ELD from EDID
774 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-to-sad.html"><span class="phrase">drm_edid_to_sad</span></a></span><span class="refpurpose"> — 
775     extracts SADs from EDID
776 </span></dt><dt><span class="refentrytitle"><a href="API-drm-edid-to-speaker-allocation.html"><span class="phrase">drm_edid_to_speaker_allocation</span></a></span><span class="refpurpose"> — 
777     extracts Speaker Allocation Data Blocks from EDID
778 </span></dt><dt><span class="refentrytitle"><a href="API-drm-av-sync-delay.html"><span class="phrase">drm_av_sync_delay</span></a></span><span class="refpurpose"> — 
779     compute the HDMI/DP sink audio-video sync delay
780 </span></dt><dt><span class="refentrytitle"><a href="API-drm-select-eld.html"><span class="phrase">drm_select_eld</span></a></span><span class="refpurpose"> — 
781     select one ELD from multiple HDMI/DP sinks
782 </span></dt><dt><span class="refentrytitle"><a href="API-drm-detect-hdmi-monitor.html"><span class="phrase">drm_detect_hdmi_monitor</span></a></span><span class="refpurpose"> — 
783     detect whether monitor is HDMI
784 </span></dt><dt><span class="refentrytitle"><a href="API-drm-detect-monitor-audio.html"><span class="phrase">drm_detect_monitor_audio</span></a></span><span class="refpurpose"> — 
785     check monitor audio capability
786 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rgb-quant-range-selectable.html"><span class="phrase">drm_rgb_quant_range_selectable</span></a></span><span class="refpurpose"> — 
787     is RGB quantization range selectable?
788 </span></dt><dt><span class="refentrytitle"><a href="API-drm-add-edid-modes.html"><span class="phrase">drm_add_edid_modes</span></a></span><span class="refpurpose"> — 
789     add modes from EDID data, if available
790 </span></dt><dt><span class="refentrytitle"><a href="API-drm-add-modes-noedid.html"><span class="phrase">drm_add_modes_noedid</span></a></span><span class="refpurpose"> — 
791     add modes for the connectors without EDID
792 </span></dt><dt><span class="refentrytitle"><a href="API-drm-set-preferred-mode.html"><span class="phrase">drm_set_preferred_mode</span></a></span><span class="refpurpose"> — 
793     Sets the preferred mode of a connector
794 </span></dt><dt><span class="refentrytitle"><a href="API-drm-hdmi-avi-infoframe-from-display-mode.html"><span class="phrase">drm_hdmi_avi_infoframe_from_display_mode</span></a></span><span class="refpurpose"> — 
795     fill an HDMI AVI infoframe with data from a DRM display mode
796 </span></dt><dt><span class="refentrytitle"><a href="API-drm-hdmi-vendor-infoframe-from-display-mode.html"><span class="phrase">drm_hdmi_vendor_infoframe_from_display_mode</span></a></span><span class="refpurpose"> — 
797     fill an HDMI infoframe with data from a DRM display mode
798 </span></dt></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.18"></a>Rectangle Utilities Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-drm-rect.html"><span class="phrase">struct drm_rect</span></a></span><span class="refpurpose"> — 
799  two dimensional rectangle
800 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-adjust-size.html"><span class="phrase">drm_rect_adjust_size</span></a></span><span class="refpurpose"> — 
801     adjust the size of the rectangle
802 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-translate.html"><span class="phrase">drm_rect_translate</span></a></span><span class="refpurpose"> — 
803     translate the rectangle
804 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-downscale.html"><span class="phrase">drm_rect_downscale</span></a></span><span class="refpurpose"> — 
805     downscale a rectangle
806 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-width.html"><span class="phrase">drm_rect_width</span></a></span><span class="refpurpose"> — 
807     determine the rectangle width
808 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-height.html"><span class="phrase">drm_rect_height</span></a></span><span class="refpurpose"> — 
809     determine the rectangle height
810 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-visible.html"><span class="phrase">drm_rect_visible</span></a></span><span class="refpurpose"> — 
811     determine if the the rectangle is visible
812 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-equals.html"><span class="phrase">drm_rect_equals</span></a></span><span class="refpurpose"> — 
813     determine if two rectangles are equal
814 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-intersect.html"><span class="phrase">drm_rect_intersect</span></a></span><span class="refpurpose"> — 
815  intersect two rectangles
816 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-clip-scaled.html"><span class="phrase">drm_rect_clip_scaled</span></a></span><span class="refpurpose"> — 
817     perform a scaled clip operation
818 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-calc-hscale.html"><span class="phrase">drm_rect_calc_hscale</span></a></span><span class="refpurpose"> — 
819     calculate the horizontal scaling factor
820 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-calc-vscale.html"><span class="phrase">drm_rect_calc_vscale</span></a></span><span class="refpurpose"> — 
821     calculate the vertical scaling factor
822 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-calc-hscale-relaxed.html"><span class="phrase">drm_rect_calc_hscale_relaxed</span></a></span><span class="refpurpose"> — 
823     calculate the horizontal scaling factor
824 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-calc-vscale-relaxed.html"><span class="phrase">drm_rect_calc_vscale_relaxed</span></a></span><span class="refpurpose"> — 
825     calculate the vertical scaling factor
826 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-debug-print.html"><span class="phrase">drm_rect_debug_print</span></a></span><span class="refpurpose"> — 
827     print the rectangle information
828 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-rotate.html"><span class="phrase">drm_rect_rotate</span></a></span><span class="refpurpose"> — 
829     Rotate the rectangle
830 </span></dt><dt><span class="refentrytitle"><a href="API-drm-rect-rotate-inv.html"><span class="phrase">drm_rect_rotate_inv</span></a></span><span class="refpurpose"> — 
831     Inverse rotate the rectangle
832 </span></dt></dl></div><p>
833   </p><p>
834   Utility functions to help manage rectangular areas for
835   clipping, scaling, etc. calculations.
836</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.19"></a>Flip-work Helper Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-drm-flip-task.html"><span class="phrase">struct drm_flip_task</span></a></span><span class="refpurpose"> — 
837  flip work task
838 </span></dt><dt><span class="refentrytitle"><a href="API-struct-drm-flip-work.html"><span class="phrase">struct drm_flip_work</span></a></span><span class="refpurpose"> — 
839     flip work queue
840 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-allocate-task.html"><span class="phrase">drm_flip_work_allocate_task</span></a></span><span class="refpurpose"> — 
841  allocate a flip-work task
842 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-queue-task.html"><span class="phrase">drm_flip_work_queue_task</span></a></span><span class="refpurpose"> — 
843     queue a specific task
844 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-queue.html"><span class="phrase">drm_flip_work_queue</span></a></span><span class="refpurpose"> — 
845     queue work
846 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-commit.html"><span class="phrase">drm_flip_work_commit</span></a></span><span class="refpurpose"> — 
847     commit queued work
848 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-init.html"><span class="phrase">drm_flip_work_init</span></a></span><span class="refpurpose"> — 
849     initialize flip-work
850 </span></dt><dt><span class="refentrytitle"><a href="API-drm-flip-work-cleanup.html"><span class="phrase">drm_flip_work_cleanup</span></a></span><span class="refpurpose"> — 
851     cleans up flip-work
852 </span></dt></dl></div><p>
853   </p><p>
854   Util to queue up work to run from work-queue context after flip/vblank.
855   Typically this can be used to defer unref of framebuffer's, cursor
856   bo's, etc until after vblank.  The APIs are all thread-safe.
857   Moreover, drm_flip_work_queue_task and drm_flip_work_queue can be called
858   in atomic context.
859</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.20"></a>HDMI Infoframes Helper Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-hdmi-infoframe.html"><span class="phrase">union hdmi_infoframe</span></a></span><span class="refpurpose"> — 
860  overall union of all abstract infoframe representations
861 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-avi-infoframe-init.html"><span class="phrase">hdmi_avi_infoframe_init</span></a></span><span class="refpurpose"> — 
862  initialize an HDMI AVI infoframe
863 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-avi-infoframe-pack.html"><span class="phrase">hdmi_avi_infoframe_pack</span></a></span><span class="refpurpose"> — 
864     write HDMI AVI infoframe to binary buffer
865 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-spd-infoframe-init.html"><span class="phrase">hdmi_spd_infoframe_init</span></a></span><span class="refpurpose"> — 
866     initialize an HDMI SPD infoframe
867 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-spd-infoframe-pack.html"><span class="phrase">hdmi_spd_infoframe_pack</span></a></span><span class="refpurpose"> — 
868     write HDMI SPD infoframe to binary buffer
869 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-audio-infoframe-init.html"><span class="phrase">hdmi_audio_infoframe_init</span></a></span><span class="refpurpose"> — 
870     initialize an HDMI audio infoframe
871 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-audio-infoframe-pack.html"><span class="phrase">hdmi_audio_infoframe_pack</span></a></span><span class="refpurpose"> — 
872     write HDMI audio infoframe to binary buffer
873 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-vendor-infoframe-init.html"><span class="phrase">hdmi_vendor_infoframe_init</span></a></span><span class="refpurpose"> — 
874     initialize an HDMI vendor infoframe
875 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-vendor-infoframe-pack.html"><span class="phrase">hdmi_vendor_infoframe_pack</span></a></span><span class="refpurpose"> — 
876     write a HDMI vendor infoframe to binary buffer
877 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-infoframe-pack.html"><span class="phrase">hdmi_infoframe_pack</span></a></span><span class="refpurpose"> — 
878     write a HDMI infoframe to binary buffer
879 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-infoframe-log.html"><span class="phrase">hdmi_infoframe_log</span></a></span><span class="refpurpose"> — 
880     log info of HDMI infoframe
881 </span></dt><dt><span class="refentrytitle"><a href="API-hdmi-infoframe-unpack.html"><span class="phrase">hdmi_infoframe_unpack</span></a></span><span class="refpurpose"> — 
882     unpack binary buffer to a HDMI infoframe
883 </span></dt></dl></div><p>
884	Strictly speaking this is not a DRM helper library but generally useable
885	by any driver interfacing with HDMI outputs like v4l or alsa drivers.
886	But it nicely fits into the overall topic of mode setting helper
887	libraries and hence is also included here.
888      </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.21"></a>Plane Helper Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-drm-plane-helper-check-update.html"><span class="phrase">drm_plane_helper_check_update</span></a></span><span class="refpurpose"> — 
889  Check plane update for validity
890 </span></dt><dt><span class="refentrytitle"><a href="API-drm-primary-helper-update.html"><span class="phrase">drm_primary_helper_update</span></a></span><span class="refpurpose"> — 
891     Helper for primary plane update
892 </span></dt><dt><span class="refentrytitle"><a href="API-drm-primary-helper-disable.html"><span class="phrase">drm_primary_helper_disable</span></a></span><span class="refpurpose"> — 
893     Helper for primary plane disable
894 </span></dt><dt><span class="refentrytitle"><a href="API-drm-primary-helper-destroy.html"><span class="phrase">drm_primary_helper_destroy</span></a></span><span class="refpurpose"> — 
895     Helper for primary plane destruction
896 </span></dt><dt><span class="refentrytitle"><a href="API-drm-crtc-init.html"><span class="phrase">drm_crtc_init</span></a></span><span class="refpurpose"> — 
897     Legacy CRTC initialization function
898 </span></dt><dt><span class="refentrytitle"><a href="API-drm-plane-helper-update.html"><span class="phrase">drm_plane_helper_update</span></a></span><span class="refpurpose"> — 
899     Transitional helper for plane update
900 </span></dt><dt><span class="refentrytitle"><a href="API-drm-plane-helper-disable.html"><span class="phrase">drm_plane_helper_disable</span></a></span><span class="refpurpose"> — 
901     Transitional helper for plane disable
902 </span></dt></dl></div><p>
903   </p><p>
904   This helper library has two parts. The first part has support to implement
905   primary plane support on top of the normal CRTC configuration interface.
906   Since the legacy -&gt;set_config interface ties the primary plane together with
907   the CRTC state this does not allow userspace to disable the primary plane
908   itself.  To avoid too much duplicated code use
909   <code class="function"><a class="link" href="API-drm-plane-helper-check-update.html" title="drm_plane_helper_check_update">drm_plane_helper_check_update</a></code> which can be used to enforce the same
910   restrictions as primary planes had thus. The default primary plane only
911   expose XRBG8888 and ARGB8888 as valid pixel formats for the attached
912   framebuffer.
913   </p><p>
914   Drivers are highly recommended to implement proper support for primary
915   planes, and newly merged drivers must not rely upon these transitional
916   helpers.
917   </p><p>
918   The second part also implements transitional helpers which allow drivers to
919   gradually switch to the atomic helper infrastructure for plane updates. Once
920   that switch is complete drivers shouldn't use these any longer, instead using
921   the proper legacy implementations for update and disable plane hooks provided
922   by the atomic helpers.
923   </p><p>
924   Again drivers are strongly urged to switch to the new interfaces.
925</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.22"></a>Tile group</h3></div></div></div><p>
926   </p><p>
927   Tile groups are used to represent tiled monitors with a unique
928   integer identifier. Tiled monitors using DisplayID v1.3 have
929   a unique 8-byte handle, we store this in a tile group, so we
930   have a common identifier for all tiles in a monitor group.
931</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="id-1.3.4.9.23"></a>Bridges</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect3"><a href="ch02s05.html#id-1.3.4.9.23.2">Overview</a></span></dt><dt><span class="sect3"><a href="ch02s05.html#id-1.3.4.9.23.3">Default bridge callback sequence</a></span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-add.html"><span class="phrase">drm_bridge_add</span></a></span><span class="refpurpose"> — 
932  add the given bridge to the global bridge list
933 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-remove.html"><span class="phrase">drm_bridge_remove</span></a></span><span class="refpurpose"> — 
934     remove the given bridge from the global bridge list
935 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-attach.html"><span class="phrase">drm_bridge_attach</span></a></span><span class="refpurpose"> — 
936     associate given bridge to our DRM device
937 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-mode-fixup.html"><span class="phrase">drm_bridge_mode_fixup</span></a></span><span class="refpurpose"> — 
938     fixup proposed mode for all bridges in the encoder chain
939 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-disable.html"><span class="phrase">drm_bridge_disable</span></a></span><span class="refpurpose"> — 
940     calls 'disable' drm_bridge_funcs op for all bridges in the encoder chain.
941 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-post-disable.html"><span class="phrase">drm_bridge_post_disable</span></a></span><span class="refpurpose"> — 
942     calls 'post_disable' drm_bridge_funcs op for all bridges in the encoder chain.
943 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-mode-set.html"><span class="phrase">drm_bridge_mode_set</span></a></span><span class="refpurpose"> — 
944     set proposed mode for all bridges in the encoder chain
945 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-pre-enable.html"><span class="phrase">drm_bridge_pre_enable</span></a></span><span class="refpurpose"> — 
946     calls 'pre_enable' drm_bridge_funcs op for all bridges in the encoder chain.
947 </span></dt><dt><span class="refentrytitle"><a href="API-drm-bridge-enable.html"><span class="phrase">drm_bridge_enable</span></a></span><span class="refpurpose"> — 
948     calls 'enable' drm_bridge_funcs op for all bridges in the encoder chain.
949 </span></dt><dt><span class="refentrytitle"><a href="API-of-drm-find-bridge.html"><span class="phrase">of_drm_find_bridge</span></a></span><span class="refpurpose"> — 
950     find the bridge corresponding to the device node in the global bridge list
951 </span></dt></dl></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="id-1.3.4.9.23.2"></a>Overview</h4></div></div></div><p>
952   </p><p>
953   drm_bridge represents a device that hangs on to an encoder. These are handy
954   when a regular drm_encoder entity isn't enough to represent the entire
955   encoder chain.
956   </p><p>
957   A bridge is always associated to a single drm_encoder at a time, but can be
958   either connected to it directly, or through an intermediate bridge:
959   </p><p>
960   encoder ---&gt; bridge B ---&gt; bridge A
961   </p><p>
962   Here, the output of the encoder feeds to bridge B, and that furthers feeds to
963   bridge A.
964   </p><p>
965   The driver using the bridge is responsible to make the associations between
966   the encoder and bridges. Once these links are made, the bridges will
967   participate along with encoder functions to perform mode_set/enable/disable
968   through the ops provided in drm_bridge_funcs.
969   </p><p>
970   drm_bridge, like drm_panel, aren't drm_mode_object entities like planes,
971   crtcs, encoders or connectors. They just provide additional hooks to get the
972   desired output at the end of the encoder chain.
973</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="id-1.3.4.9.23.3"></a>Default bridge callback sequence</h4></div></div></div><p>
974   </p><p>
975   The drm_bridge_funcs ops are populated by the bridge driver. The drm
976   internals(atomic and crtc helpers) use the helpers defined in drm_bridge.c
977   These helpers call a specific drm_bridge_funcs op for all the bridges
978   during encoder configuration.
979   </p><p>
980   When creating a bridge driver, one can implement drm_bridge_funcs op with
981   the help of these rough rules:
982   </p><p>
983   pre_enable: this contains things needed to be done for the bridge before
984   its clock and timings are enabled by its source. For a bridge, its source
985   is generally the encoder or bridge just before it in the encoder chain.
986   </p><p>
987   enable: this contains things needed to be done for the bridge once its
988   source is enabled. In other words, enable is called once the source is
989   ready with clock and timing needed by the bridge.
990   </p><p>
991   disable: this contains things needed to be done for the bridge assuming
992   that its source is still enabled, i.e. clock and timings are still on.
993   </p><p>
994   post_disable: this contains things needed to be done for the bridge once
995   its source is disabled, i.e. once clocks and timings are off.
996   </p><p>
997   mode_fixup: this should fixup the given mode for the bridge. It is called
998   after the encoder's mode fixup. mode_fixup can also reject a mode completely
999   if it's unsuitable for the hardware.
1000   </p><p>
1001   mode_set: this sets up the mode for the bridge. It assumes that its source
1002   (an encoder or a bridge) has set the mode too.
1003</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-drm-modeset-unlock.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="drmInternals.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-drm-atomic-crtc-for-each-plane.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">drm_modeset_unlock</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">drm_atomic_crtc_for_each_plane</span></td></tr></table></div></body></html>
1004