xref: /linux/Documentation/gpu/drm-kms-helpers.rst (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1=============================
2Mode Setting Helper Functions
3=============================
4
5The DRM subsystem aims for a strong separation between core code and helper
6libraries. Core code takes care of general setup and teardown and decoding
7userspace requests to kernel internal objects. Everything else is handled by a
8large set of helper libraries, which can be combined freely to pick and choose
9for each driver what fits, and avoid shared code where special behaviour is
10needed.
11
12This distinction between core code and helpers is especially strong in the
13modesetting code, where there's a shared userspace ABI for all drivers. This is
14in contrast to the render side, where pretty much everything (with very few
15exceptions) can be considered optional helper code.
16
17There are a few areas these helpers can grouped into:
18
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.
24
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
30  EDIDs.
31
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.
35
36Modeset Helper Reference for Common Vtables
37===========================================
38
39.. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
40   :doc: overview
41
42.. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
43   :internal:
44
45.. _drm_atomic_helper:
46
47Atomic Modeset Helper Functions Reference
48=========================================
49
50Overview
51--------
52
53.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
54   :doc: overview
55
56Implementing Asynchronous Atomic Commit
57---------------------------------------
58
59.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
60   :doc: implementing nonblocking commit
61
62Helper Functions Reference
63--------------------------
64
65.. kernel-doc:: include/drm/drm_atomic_helper.h
66   :internal:
67
68.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
69   :export:
70
71Atomic State Reset and Initialization
72-------------------------------------
73
74.. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
75   :doc: atomic state reset and initialization
76
77Atomic State Helper Reference
78-----------------------------
79
80.. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
81   :export:
82
83GEM Atomic Helper Reference
84---------------------------
85
86.. kernel-doc:: drivers/gpu/drm/drm_gem_atomic_helper.c
87   :doc: overview
88
89.. kernel-doc:: include/drm/drm_gem_atomic_helper.h
90   :internal:
91
92.. kernel-doc:: drivers/gpu/drm/drm_gem_atomic_helper.c
93   :export:
94
95Simple KMS Helper Reference
96===========================
97
98.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
99   :doc: overview
100
101.. kernel-doc:: include/drm/drm_simple_kms_helper.h
102   :internal:
103
104.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
105   :export:
106
107fbdev Helper Functions Reference
108================================
109
110.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
111   :doc: fbdev helpers
112
113.. kernel-doc:: include/drm/drm_fb_helper.h
114   :internal:
115
116.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
117   :export:
118
119format Helper Functions Reference
120=================================
121
122.. kernel-doc:: drivers/gpu/drm/drm_format_helper.c
123   :export:
124
125Framebuffer DMA Helper Functions Reference
126==========================================
127
128.. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
129   :doc: framebuffer dma helper functions
130
131.. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
132   :export:
133
134Framebuffer GEM Helper Reference
135================================
136
137.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
138   :doc: overview
139
140.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
141   :export:
142
143.. _drm_bridges:
144
145Bridges
146=======
147
148Overview
149--------
150
151.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
152   :doc: overview
153
154Display Driver Integration
155--------------------------
156
157.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
158   :doc: display driver integration
159
160Special Care with MIPI-DSI bridges
161----------------------------------
162
163.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
164   :doc: special care dsi
165
166Bridge Operations
167-----------------
168
169.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
170   :doc: bridge operations
171
172Bridge Connector Helper
173-----------------------
174
175.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
176   :doc: overview
177
178
179Bridge Helper Reference
180-------------------------
181
182.. kernel-doc:: include/drm/drm_bridge.h
183   :internal:
184
185.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
186   :export:
187
188MIPI-DSI bridge operation
189-------------------------
190
191.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
192   :doc: dsi bridge operations
193
194
195Bridge Connector Helper Reference
196---------------------------------
197
198.. kernel-doc:: drivers/gpu/drm/display/drm_bridge_connector.c
199   :export:
200
201Panel-Bridge Helper Reference
202-----------------------------
203
204.. kernel-doc:: drivers/gpu/drm/bridge/panel.c
205   :export:
206
207.. _drm_panel_helper:
208
209Panel Helper Reference
210======================
211
212.. kernel-doc:: drivers/gpu/drm/drm_panel.c
213   :doc: drm panel
214
215.. kernel-doc:: include/drm/drm_panel.h
216   :internal:
217
218.. kernel-doc:: drivers/gpu/drm/drm_panel.c
219   :export:
220
221.. kernel-doc:: drivers/gpu/drm/drm_panel_orientation_quirks.c
222   :export:
223
224Panel Self Refresh Helper Reference
225===================================
226
227.. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
228   :doc: overview
229
230.. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
231   :export:
232
233HDCP Helper Functions Reference
234===============================
235
236.. kernel-doc:: drivers/gpu/drm/display/drm_hdcp_helper.c
237   :export:
238
239Display Port Helper Functions Reference
240=======================================
241
242.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
243   :doc: dp helpers
244
245.. kernel-doc:: include/drm/display/drm_dp.h
246   :internal:
247
248.. kernel-doc:: include/drm/display/drm_dp_helper.h
249   :internal:
250
251.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
252   :export:
253
254Display Port CEC Helper Functions Reference
255===========================================
256
257.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
258   :doc: dp cec helpers
259
260.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
261   :export:
262
263Display Port Dual Mode Adaptor Helper Functions Reference
264=========================================================
265
266.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
267   :doc: dp dual mode helpers
268
269.. kernel-doc:: include/drm/display/drm_dp_dual_mode_helper.h
270   :internal:
271
272.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
273   :export:
274
275Display Port MST Helpers
276========================
277
278Overview
279--------
280
281.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
282   :doc: dp mst helper
283
284.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
285   :doc: Branch device and port refcounting
286
287Functions Reference
288-------------------
289
290.. kernel-doc:: include/drm/display/drm_dp_mst_helper.h
291   :internal:
292
293.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
294   :export:
295
296Topology Lifetime Internals
297---------------------------
298
299These functions aren't exported to drivers, but are documented here to help make
300the MST topology helpers easier to understand
301
302.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
303   :functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
304               drm_dp_mst_topology_put_mstb
305               drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
306               drm_dp_mst_topology_put_port
307               drm_dp_mst_get_mstb_malloc drm_dp_mst_put_mstb_malloc
308
309MIPI DBI Helper Functions Reference
310===================================
311
312.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
313   :doc: overview
314
315.. kernel-doc:: include/drm/drm_mipi_dbi.h
316   :internal:
317
318.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
319   :export:
320
321MIPI DSI Helper Functions Reference
322===================================
323
324.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
325   :doc: dsi helpers
326
327.. kernel-doc:: include/drm/drm_mipi_dsi.h
328   :internal:
329
330.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
331   :export:
332
333Display Stream Compression Helper Functions Reference
334=====================================================
335
336.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
337   :doc: dsc helpers
338
339.. kernel-doc:: include/drm/display/drm_dsc.h
340   :internal:
341
342.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
343   :export:
344
345Output Probing Helper Functions Reference
346=========================================
347
348.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
349   :doc: output probing helper overview
350
351.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
352   :export:
353
354EDID Helper Functions Reference
355===============================
356
357.. kernel-doc:: include/drm/drm_edid.h
358   :internal:
359
360.. kernel-doc:: drivers/gpu/drm/drm_edid.c
361   :export:
362
363.. kernel-doc:: include/drm/drm_eld.h
364   :internal:
365
366.. kernel-doc:: drivers/gpu/drm/drm_eld.c
367   :export:
368
369SCDC Helper Functions Reference
370===============================
371
372.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
373   :doc: scdc helpers
374
375.. kernel-doc:: include/drm/display/drm_scdc_helper.h
376   :internal:
377
378.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
379   :export:
380
381HDMI Infoframes Helper Reference
382================================
383
384Strictly speaking this is not a DRM helper library but generally usable
385by any driver interfacing with HDMI outputs like v4l or alsa drivers.
386But it nicely fits into the overall topic of mode setting helper
387libraries and hence is also included here.
388
389.. kernel-doc:: include/linux/hdmi.h
390   :internal:
391
392.. kernel-doc:: drivers/video/hdmi.c
393   :export:
394
395Rectangle Utilities Reference
396=============================
397
398.. kernel-doc:: include/drm/drm_rect.h
399   :doc: rect utils
400
401.. kernel-doc:: include/drm/drm_rect.h
402   :internal:
403
404.. kernel-doc:: drivers/gpu/drm/drm_rect.c
405   :export:
406
407Flip-work Helper Reference
408==========================
409
410.. kernel-doc:: include/drm/drm_flip_work.h
411   :doc: flip utils
412
413.. kernel-doc:: include/drm/drm_flip_work.h
414   :internal:
415
416.. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
417   :export:
418
419Auxiliary Modeset Helpers
420=========================
421
422.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
423   :doc: aux kms helpers
424
425.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
426   :export:
427
428OF/DT Helpers
429=============
430
431.. kernel-doc:: drivers/gpu/drm/drm_of.c
432   :doc: overview
433
434.. kernel-doc:: drivers/gpu/drm/drm_of.c
435   :export:
436
437Legacy Plane Helper Reference
438=============================
439
440.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
441   :doc: overview
442
443.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
444   :export:
445
446Legacy CRTC/Modeset Helper Functions Reference
447==============================================
448
449.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
450   :doc: overview
451
452.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
453   :export:
454
455Privacy-screen class
456====================
457
458.. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c
459   :doc: overview
460
461.. kernel-doc:: include/drm/drm_privacy_screen_driver.h
462   :internal:
463
464.. kernel-doc:: include/drm/drm_privacy_screen_machine.h
465   :internal:
466
467.. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c
468   :export:
469