1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Mode Setting Helper Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux DRM 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="idp1124990540"></a>Mode Setting Helper Functions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="ch02s05.html#idp1124995876">Helper Functions</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125008132">CRTC Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125018460">Encoder Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125024140">Connector Helper Operations</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125061196">Atomic Modeset Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125415036">Modeset Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125575852">Output Probing Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125647748">fbdev Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125808116">Display Port Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1125934820">Display Port MST Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126139892">MIPI DSI Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126417260">EDID Helper Functions Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126612844">Rectangle Utilities Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126805892">Flip-work Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126875156">HDMI Infoframes Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1126989620">Plane Helper Reference</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#idp1127103124">Tile group</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">drm_crtc_helper_set_config</code> function can be used to 14 fill the struct <span class="structname">drm_crtc_funcs</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">drm_crtc_funcs</span>, 24 <span class="structname">drm_encoder_funcs</span> and 25 <span class="structname">drm_connector_funcs</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="idp1124995876"></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">drm_crtc_helper_set_config</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">drm_crtc_helper_set_config</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">drm_helper_connector_dpms</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">drm_helper_probe_single_connector_modes</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">drm_add_modes_noedid</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="idp1125008132"></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->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">drm_crtc_helper_set_config</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->x</code> and 112 <code class="literal">crtc->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="idp1125018460"></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="idp1125024140"></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">drm_add_edid_modes</code>, 161 adding standard VESA DMT modes with <code class="function">drm_add_modes_noedid</code>, 162 or calling <code class="function">drm_mode_probed_add</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">drm_add_edid_modes</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">drm_mode_create</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 <-----------------------><----------------><-------------><--------------> 190 191 //////////////////////| 192 ////////////////////// | 193 ////////////////////// |.................. ................ 194 _______________ 195 196 <----- [hv]display -----> 197 <------------- [hv]sync_start ------------> 198 <--------------------- [hv]sync_end ---------------------> 199 <-------------------------------- [hv]total -----------------------------> 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">drm_helper_probe_single_connector_modes</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">drm_mode_set_name</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">drm_helper_probe_single_connector_modes</code>. 248 </p><p> 249 When parsing EDID data, <code class="function">drm_add_edid_modes</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="idp1125061196"></a>Atomic Modeset Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect3"><a href="ch02s05.html#idp1125061564">Overview</a></span></dt><dt><span class="sect3"><a href="ch02s05.html#idp1125063668">Implementing Asynchronous Atomic Commit</a></span></dt><dt><span class="sect3"><a href="ch02s05.html#idp1125067476">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-commit-modeset-disables.html"><span class="phrase">drm_atomic_helper_commit_modeset_disables</span></a></span><span class="refpurpose"> — 287 modeset commit to disable outputs 288 </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"> — 289 modeset commit to enable outputs 290 </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"> — 291 wait for vblank on crtcs 292 </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"> — 293 commit validated state object 294 </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"> — 295 prepare plane resources before commit 296 </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"> — 297 commit plane state 298 </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"> — 299 cleanup plane resources after commit 300 </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"> — 301 store atomic state into current sw state 302 </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"> — 303 Helper for primary plane update using atomic 304 </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"> — 305 Helper for primary plane disable using * atomic 306 </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"> — 307 set a new config from userspace 308 </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"> — 309 helper for crtc properties 310 </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"> — 311 helper for plane properties 312 </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"> — 313 helper for connector properties 314 </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"> — 315 execute a legacy page flip 316 </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"> — 317 connector dpms helper implementation 318 </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"> — 319 default ->reset hook for CRTCs 320 </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"> — 321 copy atomic CRTC state 322 </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"> — 323 default state duplicate hook 324 </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"> — 325 release CRTC state 326 </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"> — 327 default state destroy hook 328 </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"> — 329 default ->reset hook for planes 330 </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"> — 331 copy atomic plane state 332 </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"> — 333 default state duplicate hook 334 </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"> — 335 release plane state 336 </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"> — 337 default state destroy hook 338 </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"> — 339 default ->reset hook for connectors 340 </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"> — 341 copy atomic connector state 342 </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"> — 343 default state duplicate hook 344 </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"> — 345 release connector state 346 </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"> — 347 default state destroy hook 348 </span></dt></dl></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="idp1125061564"></a>Overview</h4></div></div></div><p> 349 </p><p> 350 This helper library provides implementations of check and commit functions on 351 top of the CRTC modeset helper callbacks and the plane helper callbacks. It 352 also provides convenience implementations for the atomic state handling 353 callbacks for drivers which don't need to subclass the drm core structures to 354 add their own additional internal state. 355 </p><p> 356 This library also provides default implementations for the check callback in 357 drm_atomic_helper_check and for the commit callback with 358 drm_atomic_helper_commit. But the individual stages and callbacks are expose 359 to allow drivers to mix and match and e.g. use the plane helpers only 360 together with a driver private modeset implementation. 361 </p><p> 362 This library also provides implementations for all the legacy driver 363 interfaces on top of the atomic interface. See drm_atomic_helper_set_config, 364 drm_atomic_helper_disable_plane, drm_atomic_helper_disable_plane and the 365 various functions to implement set_property callbacks. New drivers must not 366 implement these functions themselves but must use the provided helpers. 367</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="idp1125063668"></a>Implementing Asynchronous Atomic Commit</h4></div></div></div><p> 368 </p><p> 369 For now the atomic helpers don't support async commit directly. If there is 370 real need it could be added though, using the dma-buf fence infrastructure 371 for generic synchronization with outstanding rendering. 372 </p><p> 373 For now drivers have to implement async commit themselves, with the following 374 sequence being the recommended one: 375 </p><p> 376 1. Run <code class="function">drm_atomic_helper_prepare_planes</code> first. This is the only function 377 which commit needs to call which can fail, so we want to run it first and 378 synchronously. 379 </p><p> 380 2. Synchronize with any outstanding asynchronous commit worker threads which 381 might be affected the new state update. This can be done by either cancelling 382 or flushing the work items, depending upon whether the driver can deal with 383 cancelled updates. Note that it is important to ensure that the framebuffer 384 cleanup is still done when cancelling. 385 </p><p> 386 For sufficient parallelism it is recommended to have a work item per crtc 387 (for updates which don't touch global state) and a global one. Then we only 388 need to synchronize with the crtc work items for changed crtcs and the global 389 work item, which allows nice concurrent updates on disjoint sets of crtcs. 390 </p><p> 391 3. The software state is updated synchronously with 392 drm_atomic_helper_swap_state. Doing this under the protection of all modeset 393 locks means concurrent callers never see inconsistent state. And doing this 394 while it's guaranteed that no relevant async worker runs means that async 395 workers do not need grab any locks. Actually they must not grab locks, for 396 otherwise the work flushing will deadlock. 397 </p><p> 398 4. Schedule a work item to do all subsequent steps, using the split-out 399 commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and 400 then cleaning up the framebuffers after the old framebuffer is no longer 401 being displayed. 402</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a name="idp1125067476"></a>Atomic State Reset and Initialization</h4></div></div></div><p> 403 </p><p> 404 Both the drm core and the atomic helpers assume that there is always the full 405 and correct atomic software state for all connectors, CRTCs and planes 406 available. Which is a bit a problem on driver load and also after system 407 suspend. One way to solve this is to have a hardware state read-out 408 infrastructure which reconstructs the full software state (e.g. the i915 409 driver). 410 </p><p> 411 The simpler solution is to just reset the software state to everything off, 412 which is easiest to do by calling <code class="function">drm_mode_config_reset</code>. To facilitate this 413 the atomic helpers provide default reset implementations for all hooks. 414</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1125415036"></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"> — 415 helper operations for CRTCs 416 </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"> — 417 helper operations for encoders 418 </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"> — 419 helper operations for connectors 420 </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"> — 421 move panels to the front in the connector list 422 </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"> — 423 check if a given encoder is in use 424 </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"> — 425 check if a given CRTC is in a mode_config 426 </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"> — 427 disable unused objects 428 </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"> — 429 internal helper to set a mode 430 </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"> — 431 set a new config from userspace 432 </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"> — 433 connector dpms helper implementation 434 </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"> — 435 fill out framebuffer metadata 436 </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"> — 437 force-restore mode setting configuration 438 </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"> — 439 mode_set implementation for atomic plane helpers 440 </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"> — 441 mode_set_base implementation for atomic plane helpers 442 </span></dt></dl></div><p> 443 </p><p> 444 The CRTC modeset helper library provides a default set_config implementation 445 in <code class="function">drm_crtc_helper_set_config</code>. Plus a few other convenience functions using 446 the same callbacks which drivers can use to e.g. restore the modeset 447 configuration on resume with <code class="function">drm_helper_resume_force_mode</code>. 448 </p><p> 449 The driver callbacks are mostly compatible with the atomic modeset helpers, 450 except for the handling of the primary plane: Atomic helpers require that the 451 primary plane is implemented as a real standalone plane and not directly tied 452 to the CRTC state. For easier transition this library provides functions to 453 implement the old semantics required by the CRTC helpers using the new plane 454 and atomic helper callbacks. 455 </p><p> 456 Drivers are strongly urged to convert to the atomic helpers (by way of first 457 converting to the plane helpers). New drivers must not use these functions 458 but need to implement the atomic interface instead, potentially using the 459 atomic helpers for that. 460</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1125575852"></a>Output Probing Helper Functions Reference</h3></div></div></div><div class="toc"><dl class="toc"><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"> — 461 get complete set of display modes 462 </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"> — 463 get complete set of display modes 464 </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"> — 465 fire off KMS hotplug events 466 </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"> — 467 disable output polling 468 </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"> — 469 re-enable output polling. 470 </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"> — 471 initialize and enable output polling 472 </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"> — 473 disable output polling and clean it up 474 </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"> — 475 hotplug processing 476 </span></dt></dl></div><p> 477 </p><p> 478 This library provides some helper code for output probing. It provides an 479 implementation of the core connector->fill_modes interface with 480 drm_helper_probe_single_connector_modes. 481 </p><p> 482 It also provides support for polling connectors with a work item and for 483 generic hotplug interrupt handling where the driver doesn't or cannot keep 484 track of a per-connector hpd interrupt. 485 </p><p> 486 This helper library can be used independently of the modeset helper library. 487 Drivers can also overwrite different parts e.g. use their own hotplug 488 handling code to avoid probing unrelated outputs. 489</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1125647748"></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"> — 490 add all connectors to fbdev emulation helper 491 </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"> — 492 implementation for ->fb_debug_enter 493 </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"> — 494 implementation for ->fb_debug_leave 495 </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"> — 496 restore fbdev configuration 497 </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"> — 498 implementation for ->fb_blank 499 </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"> — 500 setup a drm_fb_helper structure 501 </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"> — 502 initialize a drm_fb_helper structure 503 </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"> — 504 implementation for ->fb_setcmap 505 </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"> — 506 implementation for ->fb_check_var 507 </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"> — 508 implementation for ->fb_set_par 509 </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"> — 510 implementation for ->fb_pan_display 511 </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"> — 512 initializes fixed fbdev information 513 </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"> — 514 initalizes variable fbdev information 515 </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"> — 516 setup a sane initial connector configuration 517 </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"> — 518 respond to a hotplug notification by probing all the outputs attached to the fb 519 </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"> — 520 describes fbdev size and scanout surface size 521 </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"> — 522 driver callbacks for the fbdev emulation library 523 </span></dt></dl></div><p> 524 </p><p> 525 The fb helper functions are useful to provide an fbdev on top of a drm kernel 526 mode setting driver. They can be used mostly independently from the crtc 527 helper functions used by many drivers to implement the kernel mode setting 528 interfaces. 529 </p><p> 530 Initialization is done as a four-step process with <code class="function">drm_fb_helper_prepare</code>, 531 <code class="function">drm_fb_helper_init</code>, <code class="function">drm_fb_helper_single_add_all_connectors</code> and 532 <code class="function">drm_fb_helper_initial_config</code>. Drivers with fancier requirements than the 533 default behaviour can override the third step with their own code. 534 Teardown is done with <code class="function">drm_fb_helper_fini</code>. 535 </p><p> 536 At runtime drivers should restore the fbdev console by calling 537 <code class="function">drm_fb_helper_restore_fbdev_mode</code> from their ->lastclose callback. They 538 should also notify the fb helper code from updates to the output 539 configuration by calling <code class="function">drm_fb_helper_hotplug_event</code>. For easier 540 integration with the output polling code in drm_crtc_helper.c the modeset 541 code provides a ->output_poll_changed callback. 542 </p><p> 543 All other functions exported by the fb helper library can be used to 544 implement the fbdev driver interface by the driver. 545 </p><p> 546 It is possible, though perhaps somewhat tricky, to implement race-free 547 hotplug detection using the fbdev helpers. The <code class="function">drm_fb_helper_prepare</code> 548 helper must be called first to initialize the minimum required to make 549 hotplug detection work. Drivers also need to make sure to properly set up 550 the dev->mode_config.funcs member. After calling <code class="function">drm_kms_helper_poll_init</code> 551 it is safe to enable interrupts and start processing hotplug events. At the 552 same time, drivers should initialize all modeset objects such as CRTCs, 553 encoders and connectors. To finish up the fbdev helper initialization, the 554 <code class="function">drm_fb_helper_init</code> function is called. To probe for all attached displays 555 and set up an initial configuration using the detected hardware, drivers 556 should call <code class="function">drm_fb_helper_single_add_all_connectors</code> followed by 557 <code class="function">drm_fb_helper_initial_config</code>. 558</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1125808116"></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"> — 559 DisplayPort AUX channel transaction 560 </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"> — 561 DisplayPort AUX channel 562 </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"> — 563 read a single byte from the DPCD 564 </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"> — 565 write a single byte to the DPCD 566 </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"> — 567 read a series of bytes from the DPCD 568 </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"> — 569 write a series of bytes to the DPCD 570 </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"> — 571 read DPCD link status (bytes 0x202-0x207) 572 </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"> — 573 probe a DisplayPort link for capabilities 574 </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"> — 575 power up a DisplayPort link 576 </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"> — 577 power down a DisplayPort link 578 </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"> — 579 configure a DisplayPort link 580 </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"> — 581 initialise and register aux channel 582 </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"> — 583 unregister an AUX adapter 584 </span></dt></dl></div><p> 585 </p><p> 586 These functions contain some common logic and helpers at various abstraction 587 levels to deal with Display Port sink devices and related things like DP aux 588 channel transfers, EDID reading over DP aux channels, decoding certain DPCD 589 blocks, ... 590</p><p> 591 </p><p> 592 The DisplayPort AUX channel is an abstraction to allow generic, driver- 593 independent access to AUX functionality. Drivers can take advantage of 594 this by filling in the fields of the drm_dp_aux structure. 595 </p><p> 596 Transactions are described using a hardware-independent drm_dp_aux_msg 597 structure, which is passed into a driver's .<code class="function">transfer</code> implementation. 598 Both native and I2C-over-AUX transactions are supported. 599</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1125934820"></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"> — 600 Virtual Channel Payload Identifier 601 </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"> — 602 MST port 603 </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"> — 604 MST branch device. 605 </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"> — 606 DisplayPort MST manager 607 </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"> — 608 Execute payload update part 1 609 </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"> — 610 Execute payload update part 2 611 </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"> — 612 Set the MST state for a topology manager 613 </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"> — 614 suspend the MST manager 615 </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"> — 616 resume the MST manager 617 </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"> — 618 MST hotplug IRQ notify 619 </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"> — 620 get connection status for an MST port 621 </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"> — 622 get EDID for an MST port 623 </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"> — 624 find slots for this PBN value 625 </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"> — 626 Allocate a virtual channel 627 </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"> — 628 Reset number of slots to 0 for VCPI 629 </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"> — 630 deallocate a VCPI 631 </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"> — 632 Check ACT handled status. 633 </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"> — 634 Calculate the PBN for a mode. 635 </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"> — 636 </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"> — 637 initialise a topology manager 638 </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"> — 639 destroy topology manager. 640 </span></dt></dl></div><p> 641 </p><p> 642 These functions contain parts of the DisplayPort 1.2a MultiStream Transport 643 protocol. The helpers contain a topology manager and bandwidth manager. 644 The helpers encapsulate the sending and received of sideband msgs. 645</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126139892"></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"> — 646 read/write DSI buffer 647 </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"> — 648 represents a MIPI DSI packet in protocol format 649 </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"> — 650 DSI bus operations 651 </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"> — 652 DSI host device 653 </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"> — 654 DSI peripheral device 655 </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"> — 656 Tearing Effect Output Line mode 657 </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"> — 658 DSI driver 659 </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"> — 660 find the MIPI DSI device matching a device tree node 661 </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"> — 662 attach a DSI device to its DSI host 663 </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"> — 664 detach a DSI device from its DSI host 665 </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"> — 666 check if a packet is of the short format 667 </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"> — 668 check if a packet is of the long format 669 </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"> — 670 create a packet from a message according to the DSI protocol 671 </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"> — 672 transmit data using a generic write packet 673 </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"> — 674 receive data using a generic read packet 675 </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"> — 676 transmit a DCS command with payload 677 </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"> — 678 send DCS write command 679 </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"> — 680 send DCS read request command 681 </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"> — 682 send DCS nop packet 683 </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"> — 684 perform a software reset of the display module 685 </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"> — 686 query the display module's current power mode 687 </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"> — 688 gets the pixel format for the RGB image data used by the interface 689 </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"> — 690 disable all unnecessary blocks inside the display module except interface communication 691 </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"> — 692 enable all blocks inside the display module 693 </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"> — 694 stop displaying the image data on the display device 695 </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"> — 696 start displaying the image data on the display device 697 </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"> — 698 define the column extent of the frame memory accessed by the host processor 699 </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"> — 700 define the page extent of the frame memory accessed by the host processor 701 </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"> — 702 turn off the display module's Tearing Effect output signal on the TE signal line 703 </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"> — 704 turn on the display module's Tearing Effect output signal on the TE signal line. 705 </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"> — 706 sets the pixel format for the RGB image data used by the interface 707 </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"> — 708 register a driver for DSI devices 709 </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"> — 710 unregister a driver for DSI devices 711 </span></dt></dl></div><p> 712 </p><p> 713 These functions contain some common logic and helpers to deal with MIPI DSI 714 peripherals. 715 </p><p> 716 Helpers are provided for a number of standard MIPI DSI command as well as a 717 subset of the MIPI DCS command set. 718</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126417260"></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"> — 719 sanity check the header of the base EDID block 720 </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"> — 721 Sanity check the EDID block (base or extension) 722 </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"> — 723 sanity check EDID data 724 </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"> — 725 get EDID data using a custom EDID block read function 726 </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"> — 727 probe DDC presence 728 </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"> — 729 get EDID data, if available 730 </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"> — 731 duplicate an EDID and the extensions 732 </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"> — 733 look for a CEA mode matching given mode 734 </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"> — 735 get the picture aspect ratio corresponding to the input VIC from the CEA mode list 736 </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"> — 737 build ELD from EDID 738 </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"> — 739 extracts SADs from EDID 740 </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"> — 741 extracts Speaker Allocation Data Blocks from EDID 742 </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"> — 743 compute the HDMI/DP sink audio-video sync delay 744 </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"> — 745 select one ELD from multiple HDMI/DP sinks 746 </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"> — 747 detect whether monitor is HDMI 748 </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"> — 749 check monitor audio capability 750 </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"> — 751 is RGB quantization range selectable? 752 </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"> — 753 add modes from EDID data, if available 754 </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"> — 755 add modes for the connectors without EDID 756 </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"> — 757 Sets the preferred mode of a connector 758 </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"> — 759 fill an HDMI AVI infoframe with data from a DRM display mode 760 </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"> — 761 fill an HDMI infoframe with data from a DRM display mode 762 </span></dt></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126612844"></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"> — 763 two dimensional rectangle 764 </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"> — 765 adjust the size of the rectangle 766 </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"> — 767 translate the rectangle 768 </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"> — 769 downscale a rectangle 770 </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"> — 771 determine the rectangle width 772 </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"> — 773 determine the rectangle height 774 </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"> — 775 determine if the the rectangle is visible 776 </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"> — 777 determine if two rectangles are equal 778 </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"> — 779 intersect two rectangles 780 </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"> — 781 perform a scaled clip operation 782 </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"> — 783 calculate the horizontal scaling factor 784 </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"> — 785 calculate the vertical scaling factor 786 </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"> — 787 calculate the horizontal scaling factor 788 </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"> — 789 calculate the vertical scaling factor 790 </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"> — 791 print the rectangle information 792 </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"> — 793 Rotate the rectangle 794 </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"> — 795 Inverse rotate the rectangle 796 </span></dt></dl></div><p> 797 </p><p> 798 Utility functions to help manage rectangular areas for 799 clipping, scaling, etc. calculations. 800</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126805892"></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"> — 801 flip work task 802 </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"> — 803 flip work queue 804 </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"> — 805 allocate a flip-work task 806 </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"> — 807 queue a specific task 808 </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"> — 809 queue work 810 </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"> — 811 commit queued work 812 </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"> — 813 initialize flip-work 814 </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"> — 815 cleans up flip-work 816 </span></dt></dl></div><p> 817 </p><p> 818 Util to queue up work to run from work-queue context after flip/vblank. 819 Typically this can be used to defer unref of framebuffer's, cursor 820 bo's, etc until after vblank. The APIs are all thread-safe. 821 Moreover, drm_flip_work_queue_task and drm_flip_work_queue can be called 822 in atomic context. 823</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126875156"></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"> — 824 overall union of all abstract infoframe representations 825 </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"> — 826 initialize an HDMI AVI infoframe 827 </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"> — 828 write HDMI AVI infoframe to binary buffer 829 </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"> — 830 initialize an HDMI SPD infoframe 831 </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"> — 832 write HDMI SPD infoframe to binary buffer 833 </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"> — 834 initialize an HDMI audio infoframe 835 </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"> — 836 write HDMI audio infoframe to binary buffer 837 </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"> — 838 initialize an HDMI vendor infoframe 839 </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"> — 840 write a HDMI vendor infoframe to binary buffer 841 </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"> — 842 write a HDMI infoframe to binary buffer 843 </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"> — 844 log info of HDMI infoframe 845 </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"> — 846 unpack binary buffer to a HDMI infoframe 847 </span></dt></dl></div><p> 848 Strictly speaking this is not a DRM helper library but generally useable 849 by any driver interfacing with HDMI outputs like v4l or alsa drivers. 850 But it nicely fits into the overall topic of mode setting helper 851 libraries and hence is also included here. 852 </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1126989620"></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"> — 853 Check plane update for validity 854 </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"> — 855 Helper for primary plane update 856 </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"> — 857 Helper for primary plane disable 858 </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"> — 859 Helper for primary plane destruction 860 </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"> — 861 Legacy CRTC initialization function 862 </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"> — 863 Transitional helper for plane update 864 </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"> — 865 Transitional helper for plane disable 866 </span></dt></dl></div><p> 867 </p><p> 868 This helper library has two parts. The first part has support to implement 869 primary plane support on top of the normal CRTC configuration interface. 870 Since the legacy ->set_config interface ties the primary plane together with 871 the CRTC state this does not allow userspace to disable the primary plane 872 itself. To avoid too much duplicated code use 873 <code class="function">drm_plane_helper_check_update</code> which can be used to enforce the same 874 restrictions as primary planes had thus. The default primary plane only 875 expose XRBG8888 and ARGB8888 as valid pixel formats for the attached 876 framebuffer. 877 </p><p> 878 Drivers are highly recommended to implement proper support for primary 879 planes, and newly merged drivers must not rely upon these transitional 880 helpers. 881 </p><p> 882 The second part also implements transitional helpers which allow drivers to 883 gradually switch to the atomic helper infrastructure for plane updates. Once 884 that switch is complete drivers shouldn't use these any longer, instead using 885 the proper legacy implementations for update and disable plane hooks provided 886 by the atomic helpers. 887 </p><p> 888 Again drivers are strongly urged to switch to the new interfaces. 889</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="idp1127103124"></a>Tile group</h3></div></div></div><p> 890 </p><p> 891 Tile groups are used to represent tiled monitors with a unique 892 integer identifier. Tiled monitors using DisplayID v1.3 have 893 a unique 8-byte handle, we store this in a tile group, so we 894 have a common identifier for all tiles in a monitor group. 895</p></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> 896