blob: 5bb55ec1b9b586794a71cd731892f8e2333a1959 [file] [log] [blame]
Jani Nikula2fa91d12016-06-21 14:49:02 +03001=============================
2Mode Setting Helper Functions
3=============================
4
Daniel Vetterbcb32b62016-08-12 22:48:38 +02005The 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.
Jani Nikula2fa91d12016-06-21 14:49:02 +030011
Daniel Vetterbcb32b62016-08-12 22:48:38 +020012This 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.
Jani Nikula2fa91d12016-06-21 14:49:02 +030016
Daniel Vetterbcb32b62016-08-12 22:48:38 +020017There are a few areas these helpers can grouped into:
Jani Nikula2fa91d12016-06-21 14:49:02 +030018
Daniel Vetterbcb32b62016-08-12 22:48:38 +020019* 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
Daniel Vetter1ea35762017-03-02 16:16:36 +010040 :doc: overview
Daniel Vetterbcb32b62016-08-12 22:48:38 +020041
42.. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
Daniel Vetter1ea35762017-03-02 16:16:36 +010043 :internal:
Jani Nikula2fa91d12016-06-21 14:49:02 +030044
Daniel Vetter4a8e2292017-03-02 16:16:38 +010045.. _drm_atomic_helper:
46
Jani Nikula2fa91d12016-06-21 14:49:02 +030047Atomic 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
Daniel Vetter1ea0c022016-11-21 18:18:02 +010062Helper Functions Reference
63--------------------------
64
Jani Nikula2fa91d12016-06-21 14:49:02 +030065.. kernel-doc:: include/drm/drm_atomic_helper.h
66 :internal:
67
68.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
69 :export:
70
Daniel Vetter9ef8a9d2018-10-04 22:24:28 +020071Atomic 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
Daniel Vetter9ef8a9d2018-10-04 22:24:28 +020080.. kernel-doc:: drivers/gpu/drm/drm_atomic_state_helper.c
81 :export:
82
Thomas Zimmermann6dd7b6c2021-02-08 12:55:34 +010083GEM 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
Daniel Vetterbcb32b62016-08-12 22:48:38 +020095Simple KMS Helper Reference
96===========================
97
Daniel Vetter1ea35762017-03-02 16:16:36 +010098.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
99 :doc: overview
100
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200101.. 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
Jani Nikula2fa91d12016-06-21 14:49:02 +0300107fbdev Helper Functions Reference
108================================
109
110.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
111 :doc: fbdev helpers
112
Jani Nikula2fa91d12016-06-21 14:49:02 +0300113.. kernel-doc:: include/drm/drm_fb_helper.h
114 :internal:
115
Daniel Vetter1ea35762017-03-02 16:16:36 +0100116.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
117 :export:
118
Gerd Hoffmannb7147e92019-04-16 11:05:33 +0200119format Helper Functions Reference
120=================================
121
122.. kernel-doc:: drivers/gpu/drm/drm_format_helper.c
123 :export:
124
Jani Nikula2fa91d12016-06-21 14:49:02 +0300125Framebuffer CMA Helper Functions Reference
126==========================================
127
128.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
129 :doc: framebuffer cma helper functions
130
131.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
132 :export:
133
Daniel Vetter9bea6dd2018-07-09 10:40:13 +0200134Framebuffer 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
Daniel Vetterb981a682019-01-11 17:40:47 +0100143.. _drm_bridges:
144
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200145Bridges
146=======
147
148Overview
149--------
150
151.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
152 :doc: overview
153
Maxime Ripard88868152021-09-10 12:11:55 +0200154Display Driver Integration
155--------------------------
156
157.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
158 :doc: display driver integration
159
Maxime Ripard209264a2021-09-10 12:11:56 +0200160Special Care with MIPI-DSI bridges
161----------------------------------
162
163.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
164 :doc: special care dsi
165
Laurent Pinchart04513692020-02-26 13:24:26 +0200166Bridge Operations
167-----------------
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200168
169.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
Laurent Pinchart04513692020-02-26 13:24:26 +0200170 :doc: bridge operations
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200171
Laurent Pinchart5e20bdf2020-02-26 13:24:40 +0200172Bridge Connector Helper
173-----------------------
174
175.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
176 :doc: overview
177
Daniel Vetter199e4e92016-08-31 18:09:05 +0200178
179Bridge Helper Reference
180-------------------------
181
182.. kernel-doc:: include/drm/drm_bridge.h
183 :internal:
184
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200185.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
186 :export:
187
Laurent Pinchart5e20bdf2020-02-26 13:24:40 +0200188Bridge Connector Helper Reference
189---------------------------------
190
191.. kernel-doc:: drivers/gpu/drm/drm_bridge_connector.c
192 :export:
193
Eric Anholt13dfc052017-06-02 13:25:14 -0700194Panel-Bridge Helper Reference
195-----------------------------
196
197.. kernel-doc:: drivers/gpu/drm/bridge/panel.c
198 :export:
199
Daniel Vetter2564d0b2017-03-02 16:16:35 +0100200.. _drm_panel_helper:
201
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200202Panel Helper Reference
203======================
204
Daniel Vetter1ea35762017-03-02 16:16:36 +0100205.. kernel-doc:: drivers/gpu/drm/drm_panel.c
206 :doc: drm panel
207
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200208.. kernel-doc:: include/drm/drm_panel.h
209 :internal:
210
211.. kernel-doc:: drivers/gpu/drm/drm_panel.c
212 :export:
213
Hans de Goede404d1a32017-11-25 20:35:48 +0100214.. kernel-doc:: drivers/gpu/drm/drm_panel_orientation_quirks.c
215 :export:
216
Sean Paul1452c252019-06-12 10:50:19 -0400217Panel Self Refresh Helper Reference
218===================================
219
220.. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
221 :doc: overview
222
223.. kernel-doc:: drivers/gpu/drm/drm_self_refresh_helper.c
224 :export:
225
Ramalingam C6498bf52019-05-07 21:57:38 +0530226HDCP Helper Functions Reference
227===============================
228
229.. kernel-doc:: drivers/gpu/drm/drm_hdcp.c
230 :export:
231
Jani Nikula2fa91d12016-06-21 14:49:02 +0300232Display Port Helper Functions Reference
233=======================================
234
235.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
236 :doc: dp helpers
237
238.. kernel-doc:: include/drm/drm_dp_helper.h
239 :internal:
240
241.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
242 :export:
243
Hans Verkuild2e2d262018-07-11 15:29:08 +0200244Display Port CEC Helper Functions Reference
245===========================================
246
247.. kernel-doc:: drivers/gpu/drm/drm_dp_cec.c
248 :doc: dp cec helpers
249
250.. kernel-doc:: drivers/gpu/drm/drm_dp_cec.c
251 :export:
252
Jani Nikula2fa91d12016-06-21 14:49:02 +0300253Display Port Dual Mode Adaptor Helper Functions Reference
254=========================================================
255
256.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
257 :doc: dp dual mode helpers
258
259.. kernel-doc:: include/drm/drm_dp_dual_mode_helper.h
260 :internal:
261
262.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
263 :export:
264
Lyude Paulebcc0e62019-01-10 19:53:29 -0500265Display Port MST Helpers
266========================
267
268Overview
269--------
Jani Nikula2fa91d12016-06-21 14:49:02 +0300270
271.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
272 :doc: dp mst helper
273
Lyude Paulebcc0e62019-01-10 19:53:29 -0500274.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
275 :doc: Branch device and port refcounting
276
277Functions Reference
278-------------------
279
Jani Nikula2fa91d12016-06-21 14:49:02 +0300280.. kernel-doc:: include/drm/drm_dp_mst_helper.h
281 :internal:
282
283.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
284 :export:
285
Lyude Paulebcc0e62019-01-10 19:53:29 -0500286Topology Lifetime Internals
287---------------------------
288
289These functions aren't exported to drivers, but are documented here to help make
290the MST topology helpers easier to understand
291
292.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
293 :functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
294 drm_dp_mst_topology_put_mstb
295 drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
296 drm_dp_mst_topology_put_port
297 drm_dp_mst_get_mstb_malloc drm_dp_mst_put_mstb_malloc
298
Noralf Trønnes174102f2019-07-22 12:43:11 +0200299MIPI DBI Helper Functions Reference
300===================================
301
302.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
303 :doc: overview
304
305.. kernel-doc:: include/drm/drm_mipi_dbi.h
306 :internal:
307
308.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c
309 :export:
310
Jani Nikula2fa91d12016-06-21 14:49:02 +0300311MIPI DSI Helper Functions Reference
312===================================
313
314.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
315 :doc: dsi helpers
316
317.. kernel-doc:: include/drm/drm_mipi_dsi.h
318 :internal:
319
320.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
321 :export:
322
Manasi Navarea408c852018-11-27 13:41:07 -0800323Display Stream Compression Helper Functions Reference
324=====================================================
325
326.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
327 :doc: dsc helpers
328
329.. kernel-doc:: include/drm/drm_dsc.h
330 :internal:
331
332.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
333 :export:
334
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200335Output Probing Helper Functions Reference
336=========================================
337
338.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
339 :doc: output probing helper overview
340
341.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
342 :export:
343
Jani Nikula2fa91d12016-06-21 14:49:02 +0300344EDID Helper Functions Reference
345===============================
346
Daniel Vettercdc3d092016-08-31 18:09:06 +0200347.. kernel-doc:: include/drm/drm_edid.h
348 :internal:
349
Jani Nikula2fa91d12016-06-21 14:49:02 +0300350.. kernel-doc:: drivers/gpu/drm/drm_edid.c
351 :export:
352
Thierry Reding3ad33ae2017-03-13 16:53:59 +0530353SCDC Helper Functions Reference
354===============================
355
356.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
357 :doc: scdc helpers
358
359.. kernel-doc:: include/drm/drm_scdc_helper.h
360 :internal:
361
362.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
363 :export:
364
Jani Nikula2fa91d12016-06-21 14:49:02 +0300365HDMI Infoframes Helper Reference
366================================
367
368Strictly speaking this is not a DRM helper library but generally useable
369by any driver interfacing with HDMI outputs like v4l or alsa drivers.
370But it nicely fits into the overall topic of mode setting helper
371libraries and hence is also included here.
372
373.. kernel-doc:: include/linux/hdmi.h
374 :internal:
375
376.. kernel-doc:: drivers/video/hdmi.c
377 :export:
378
Daniel Vetter5d0aa372019-01-30 17:30:04 +0100379Rectangle Utilities Reference
380=============================
381
382.. kernel-doc:: include/drm/drm_rect.h
383 :doc: rect utils
384
385.. kernel-doc:: include/drm/drm_rect.h
386 :internal:
387
388.. kernel-doc:: drivers/gpu/drm/drm_rect.c
389 :export:
390
Daniel Vetterbcb32b62016-08-12 22:48:38 +0200391Flip-work Helper Reference
392==========================
393
394.. kernel-doc:: include/drm/drm_flip_work.h
395 :doc: flip utils
396
397.. kernel-doc:: include/drm/drm_flip_work.h
398 :internal:
399
400.. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
401 :export:
402
Daniel Vetter1de72fa2016-08-12 22:48:39 +0200403Auxiliary Modeset Helpers
404=========================
405
406.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
407 :doc: aux kms helpers
408
409.. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c
410 :export:
Noralf Trønnes4c3dbb22017-08-13 15:31:44 +0200411
Daniel Vetter7f9e7ec2018-07-09 10:40:14 +0200412OF/DT Helpers
413=============
414
415.. kernel-doc:: drivers/gpu/drm/drm_of.c
416 :doc: overview
417
418.. kernel-doc:: drivers/gpu/drm/drm_of.c
419 :export:
420
Daniel Vetter5fca5ec2017-12-14 21:30:54 +0100421Legacy Plane Helper Reference
422=============================
423
424.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
425 :doc: overview
426
427.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
428 :export:
429
430Legacy CRTC/Modeset Helper Functions Reference
431==============================================
432
433.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
434 :doc: overview
435
436.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
437 :export:
Hans de Goedea1a98682021-10-05 22:23:14 +0200438
439Privacy-screen class
440====================
441
442.. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c
443 :doc: overview
444
445.. kernel-doc:: include/drm/drm_privacy_screen_driver.h
446 :internal:
447
448.. kernel-doc:: include/drm/drm_privacy_screen_machine.h
449 :internal:
450
451.. kernel-doc:: drivers/gpu/drm/drm_privacy_screen.c
452 :export: