1 =============================
2 Mode Setting Helper Functions
3 =============================
5 The DRM subsystem aims for a strong separation between core code and helper
6 libraries. Core code takes care of general setup and teardown and decoding
7 userspace requests to kernel internal objects. Everything else is handled by a
8 large set of helper libraries, which can be combined freely to pick and choose
9 for each driver what fits, and avoid shared code where special behaviour is
12 This distinction between core code and helpers is especially strong in the
13 modesetting code, where there's a shared userspace ABI for all drivers. This is
14 in contrast to the render side, where pretty much everything (with very few
15 exceptions) can be considered optional helper code.
17 There are a few areas these helpers can grouped into:
19 * Helpers to implement modesetting. The important ones here are the atomic
20 helpers. Old drivers still often use the legacy CRTC helpers. They both share
21 the same set of common helper vtables. For really simple drivers (anything
22 that would have been a great fit in the deprecated fbdev subsystem) there's
23 also the simple display pipe helpers.
25 * There's a big pile of helpers for handling outputs. First the generic bridge
26 helpers for handling encoder and transcoder IP blocks. Second the panel helpers
27 for handling panel-related information and logic. Plus then a big set of
28 helpers for the various sink standards (DisplayPort, HDMI, MIPI DSI). Finally
29 there's also generic helpers for handling output probing, and for dealing with
32 * The last group of helpers concerns itself with the frontend side of a display
33 pipeline: Planes, handling rectangles for visibility checking and scissoring,
34 flip queues and assorted bits.
36 Modeset Helper Reference for Common Vtables
37 ===========================================
39 .. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
42 .. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
45 .. _drm_atomic_helper:
47 Atomic Modeset Helper Functions Reference
48 =========================================
53 .. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
56 Implementing Asynchronous Atomic Commit
57 ---------------------------------------
59 .. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
60 :doc: implementing nonblocking commit
62 Helper Functions Reference
63 --------------------------
65 .. kernel-doc:: include/drm/drm_atomic_helper.h
68 .. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
71 Atomic State Reset and Initialization
72 -------------------------------------
74 .. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
75 :doc: atomic state reset and initialization
77 Atomic State Helper Reference
78 -----------------------------
80 .. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
83 GEM Atomic Helper Reference
84 ---------------------------
86 .. kernel-doc:: drivers/gpu/drm/drm_gem_atomic_helper.c
89 .. kernel-doc:: include/drm/drm_gem_atomic_helper.h
92 .. kernel-doc:: drivers/gpu/drm/drm_gem_atomic_helper.c
95 Simple KMS Helper Reference
96 ===========================
98 .. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
101 .. kernel-doc:: include/drm/drm_simple_kms_helper.h
104 .. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
107 fbdev Helper Functions Reference
108 ================================
110 .. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
113 .. kernel-doc:: include/drm/drm_fb_helper.h
116 .. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
119 format Helper Functions Reference
120 =================================
122 .. kernel-doc:: drivers/gpu/drm/drm_format_helper.c
125 Framebuffer DMA Helper Functions Reference
126 ==========================================
128 .. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
129 :doc: framebuffer dma helper functions
131 .. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
134 Framebuffer GEM Helper Reference
135 ================================
137 .. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
140 .. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
151 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
154 Display Driver Integration
155 --------------------------
157 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
158 :doc: display driver integration
160 Special Care with MIPI-DSI bridges
161 ----------------------------------
163 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
164 :doc: special care dsi
169 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
170 :doc: bridge operations
172 Bridge Connector Helper
173 -----------------------
175 .. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
179 Bridge Helper Reference
180 -------------------------
182 .. kernel-doc:: include/drm/drm_bridge.h
185 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
188 MIPI-DSI bridge operation
189 -------------------------
191 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
192 :doc: dsi bridge operations
195 Bridge Connector Helper Reference
196 ---------------------------------
198 .. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
201 Panel-Bridge Helper Reference
202 -----------------------------
204 .. kernel-doc:: drivers/gpu/drm/bridge/panel.c
207 .. _drm_panel_helper:
209 Panel Helper Reference
210 ======================
212 .. kernel-doc:: drivers/gpu/drm/drm_panel.c
215 .. kernel-doc:: include/drm/drm_panel.h
218 .. kernel-doc:: drivers/gpu/drm/drm_panel.c
221 .. kernel-doc:: drivers/gpu/drm/drm_panel_orientation_quirks.c
224 .. kernel-doc:: drivers/gpu/drm/drm_panel_backlight_quirks.c
227 Panel Self Refresh Helper Reference
228 ===================================
230 .. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
233 .. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
236 HDCP Helper Functions Reference
237 ===============================
239 .. kernel-doc:: drivers/gpu/drm/display/drm_hdcp_helper.c
242 Display Port Helper Functions Reference
243 =======================================
245 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
248 .. kernel-doc:: include/drm/display/drm_dp.h
251 .. kernel-doc:: include/drm/display/drm_dp_helper.h
254 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
257 Display Port CEC Helper Functions Reference
258 ===========================================
260 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
263 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
266 Display Port Dual Mode Adaptor Helper Functions Reference
267 =========================================================
269 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
270 :doc: dp dual mode helpers
272 .. kernel-doc:: include/drm/display/drm_dp_dual_mode_helper.h
275 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
278 Display Port MST Helpers
279 ========================
284 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
287 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
288 :doc: Branch device and port refcounting
293 .. kernel-doc:: include/drm/display/drm_dp_mst_helper.h
296 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
299 Topology Lifetime Internals
300 ---------------------------
302 These functions aren't exported to drivers, but are documented here to help make
303 the MST topology helpers easier to understand
305 .. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
306 :functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
307 drm_dp_mst_topology_put_mstb
308 drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
309 drm_dp_mst_topology_put_port
310 drm_dp_mst_get_mstb_malloc drm_dp_mst_put_mstb_malloc
312 MIPI DBI Helper Functions Reference
313 ===================================
315 .. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
318 .. kernel-doc:: include/drm/drm_mipi_dbi.h
321 .. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
324 MIPI DSI Helper Functions Reference
325 ===================================
327 .. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
330 .. kernel-doc:: include/drm/drm_mipi_dsi.h
333 .. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
336 Display Stream Compression Helper Functions Reference
337 =====================================================
339 .. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
342 .. kernel-doc:: include/drm/display/drm_dsc.h
345 .. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
348 Output Probing Helper Functions Reference
349 =========================================
351 .. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
352 :doc: output probing helper overview
354 .. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
357 EDID Helper Functions Reference
358 ===============================
360 .. kernel-doc:: include/drm/drm_edid.h
363 .. kernel-doc:: drivers/gpu/drm/drm_edid.c
366 .. kernel-doc:: include/drm/drm_eld.h
369 .. kernel-doc:: drivers/gpu/drm/drm_eld.c
372 SCDC Helper Functions Reference
373 ===============================
375 .. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
378 .. kernel-doc:: include/drm/display/drm_scdc_helper.h
381 .. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
384 HDMI Infoframes Helper Reference
385 ================================
387 Strictly speaking this is not a DRM helper library but generally usable
388 by any driver interfacing with HDMI outputs like v4l or alsa drivers.
389 But it nicely fits into the overall topic of mode setting helper
390 libraries and hence is also included here.
392 .. kernel-doc:: include/linux/hdmi.h
395 .. kernel-doc:: drivers/video/hdmi.c
398 Rectangle Utilities Reference
399 =============================
401 .. kernel-doc:: include/drm/drm_rect.h
404 .. kernel-doc:: include/drm/drm_rect.h
407 .. kernel-doc:: drivers/gpu/drm/drm_rect.c
410 Flip-work Helper Reference
411 ==========================
413 .. kernel-doc:: include/drm/drm_flip_work.h
416 .. kernel-doc:: include/drm/drm_flip_work.h
419 .. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
422 Auxiliary Modeset Helpers
423 =========================
425 .. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
426 :doc: aux kms helpers
428 .. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
434 .. kernel-doc:: drivers/gpu/drm/drm_of.c
437 .. kernel-doc:: drivers/gpu/drm/drm_of.c
440 Legacy Plane Helper Reference
441 =============================
443 .. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
446 .. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
449 Legacy CRTC/Modeset Helper Functions Reference
450 ==============================================
452 .. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
455 .. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
461 .. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c
464 .. kernel-doc:: include/drm/drm_privacy_screen_driver.h
467 .. kernel-doc:: include/drm/drm_privacy_screen_machine.h
470 .. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c