xref: /linux/Documentation/gpu/drm-kms-helpers.rst (revision bd628c1bed7902ec1f24ba0fe70758949146abbe)
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:: include/drm/drm_atomic_state_helper.h
81   :internal:
82
83.. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
84   :export:
85
86Simple KMS Helper Reference
87===========================
88
89.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
90   :doc: overview
91
92.. kernel-doc:: include/drm/drm_simple_kms_helper.h
93   :internal:
94
95.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
96   :export:
97
98fbdev Helper Functions Reference
99================================
100
101.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
102   :doc: fbdev helpers
103
104.. kernel-doc:: include/drm/drm_fb_helper.h
105   :internal:
106
107.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
108   :export:
109
110Framebuffer CMA Helper Functions Reference
111==========================================
112
113.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
114   :doc: framebuffer cma helper functions
115
116.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
117   :export:
118
119.. _drm_bridges:
120
121Framebuffer GEM Helper Reference
122================================
123
124.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
125   :doc: overview
126
127.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c
128   :export:
129
130Bridges
131=======
132
133Overview
134--------
135
136.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
137   :doc: overview
138
139Default bridge callback sequence
140--------------------------------
141
142.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
143   :doc: bridge callbacks
144
145
146Bridge Helper Reference
147-------------------------
148
149.. kernel-doc:: include/drm/drm_bridge.h
150   :internal:
151
152.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
153   :export:
154
155Panel-Bridge Helper Reference
156-----------------------------
157
158.. kernel-doc:: drivers/gpu/drm/bridge/panel.c
159   :export:
160
161.. _drm_panel_helper:
162
163Panel Helper Reference
164======================
165
166.. kernel-doc:: drivers/gpu/drm/drm_panel.c
167   :doc: drm panel
168
169.. kernel-doc:: include/drm/drm_panel.h
170   :internal:
171
172.. kernel-doc:: drivers/gpu/drm/drm_panel.c
173   :export:
174
175.. kernel-doc:: drivers/gpu/drm/drm_panel_orientation_quirks.c
176   :export:
177
178Display Port Helper Functions Reference
179=======================================
180
181.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
182   :doc: dp helpers
183
184.. kernel-doc:: include/drm/drm_dp_helper.h
185   :internal:
186
187.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
188   :export:
189
190Display Port CEC Helper Functions Reference
191===========================================
192
193.. kernel-doc:: drivers/gpu/drm/drm_dp_cec.c
194   :doc: dp cec helpers
195
196.. kernel-doc:: drivers/gpu/drm/drm_dp_cec.c
197   :export:
198
199Display Port Dual Mode Adaptor Helper Functions Reference
200=========================================================
201
202.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
203   :doc: dp dual mode helpers
204
205.. kernel-doc:: include/drm/drm_dp_dual_mode_helper.h
206   :internal:
207
208.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
209   :export:
210
211Display Port MST Helper Functions Reference
212===========================================
213
214.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
215   :doc: dp mst helper
216
217.. kernel-doc:: include/drm/drm_dp_mst_helper.h
218   :internal:
219
220.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
221   :export:
222
223MIPI DSI Helper Functions Reference
224===================================
225
226.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
227   :doc: dsi helpers
228
229.. kernel-doc:: include/drm/drm_mipi_dsi.h
230   :internal:
231
232.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
233   :export:
234
235Display Stream Compression Helper Functions Reference
236=====================================================
237
238.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
239   :doc: dsc helpers
240
241.. kernel-doc:: include/drm/drm_dsc.h
242   :internal:
243
244.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
245   :export:
246
247Output Probing Helper Functions Reference
248=========================================
249
250.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
251   :doc: output probing helper overview
252
253.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
254   :export:
255
256EDID Helper Functions Reference
257===============================
258
259.. kernel-doc:: include/drm/drm_edid.h
260   :internal:
261
262.. kernel-doc:: drivers/gpu/drm/drm_edid.c
263   :export:
264
265SCDC Helper Functions Reference
266===============================
267
268.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
269   :doc: scdc helpers
270
271.. kernel-doc:: include/drm/drm_scdc_helper.h
272   :internal:
273
274.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
275   :export:
276
277Rectangle Utilities Reference
278=============================
279
280.. kernel-doc:: include/drm/drm_rect.h
281   :doc: rect utils
282
283.. kernel-doc:: include/drm/drm_rect.h
284   :internal:
285
286.. kernel-doc:: drivers/gpu/drm/drm_rect.c
287   :export:
288
289HDMI Infoframes Helper Reference
290================================
291
292Strictly speaking this is not a DRM helper library but generally useable
293by any driver interfacing with HDMI outputs like v4l or alsa drivers.
294But it nicely fits into the overall topic of mode setting helper
295libraries and hence is also included here.
296
297.. kernel-doc:: include/linux/hdmi.h
298   :internal:
299
300.. kernel-doc:: drivers/video/hdmi.c
301   :export:
302
303Flip-work Helper Reference
304==========================
305
306.. kernel-doc:: include/drm/drm_flip_work.h
307   :doc: flip utils
308
309.. kernel-doc:: include/drm/drm_flip_work.h
310   :internal:
311
312.. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
313   :export:
314
315Auxiliary Modeset Helpers
316=========================
317
318.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
319   :doc: aux kms helpers
320
321.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
322   :export:
323
324OF/DT Helpers
325=============
326
327.. kernel-doc:: drivers/gpu/drm/drm_of.c
328   :doc: overview
329
330.. kernel-doc:: drivers/gpu/drm/drm_of.c
331   :export:
332
333Legacy Plane Helper Reference
334=============================
335
336.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
337   :doc: overview
338
339.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
340   :export:
341
342Legacy CRTC/Modeset Helper Functions Reference
343==============================================
344
345.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
346   :doc: overview
347
348.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
349   :export:
350