Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 1 | ========================= |
| 2 | Kernel Mode Setting (KMS) |
| 3 | ========================= |
| 4 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 5 | Drivers must initialize the mode setting core by calling |
Daniel Vetter | c3b790e | 2020-03-23 15:49:25 +0100 | [diff] [blame] | 6 | drmm_mode_config_init() on the DRM device. The function |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 7 | initializes the :c:type:`struct drm_device <drm_device>` |
| 8 | mode_config field and never fails. Once done, mode configuration must |
| 9 | be setup by initializing the following fields. |
| 10 | |
| 11 | - int min_width, min_height; int max_width, max_height; |
| 12 | Minimum and maximum width and height of the frame buffers in pixel |
| 13 | units. |
| 14 | |
| 15 | - struct drm_mode_config_funcs \*funcs; |
| 16 | Mode setting functions. |
| 17 | |
Daniel Vetter | 2564d0b | 2017-03-02 16:16:35 +0100 | [diff] [blame] | 18 | Overview |
| 19 | ======== |
| 20 | |
| 21 | .. kernel-render:: DOT |
| 22 | :alt: KMS Display Pipeline |
| 23 | :caption: KMS Display Pipeline Overview |
| 24 | |
| 25 | digraph "KMS" { |
| 26 | node [shape=box] |
| 27 | |
| 28 | subgraph cluster_static { |
| 29 | style=dashed |
| 30 | label="Static Objects" |
| 31 | |
| 32 | node [bgcolor=grey style=filled] |
| 33 | "drm_plane A" -> "drm_crtc" |
| 34 | "drm_plane B" -> "drm_crtc" |
| 35 | "drm_crtc" -> "drm_encoder A" |
| 36 | "drm_crtc" -> "drm_encoder B" |
| 37 | } |
| 38 | |
| 39 | subgraph cluster_user_created { |
| 40 | style=dashed |
| 41 | label="Userspace-Created" |
| 42 | |
| 43 | node [shape=oval] |
| 44 | "drm_framebuffer 1" -> "drm_plane A" |
| 45 | "drm_framebuffer 2" -> "drm_plane B" |
| 46 | } |
| 47 | |
| 48 | subgraph cluster_connector { |
| 49 | style=dashed |
| 50 | label="Hotpluggable" |
| 51 | |
| 52 | "drm_encoder A" -> "drm_connector A" |
| 53 | "drm_encoder B" -> "drm_connector B" |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | The basic object structure KMS presents to userspace is fairly simple. |
| 58 | Framebuffers (represented by :c:type:`struct drm_framebuffer <drm_framebuffer>`, |
Daniel Vetter | 268bc24 | 2018-07-09 10:40:10 +0200 | [diff] [blame] | 59 | see `Frame Buffer Abstraction`_) feed into planes. Planes are represented by |
| 60 | :c:type:`struct drm_plane <drm_plane>`, see `Plane Abstraction`_ for more |
| 61 | details. One or more (or even no) planes feed their pixel data into a CRTC |
| 62 | (represented by :c:type:`struct drm_crtc <drm_crtc>`, see `CRTC Abstraction`_) |
| 63 | for blending. The precise blending step is explained in more detail in `Plane |
| 64 | Composition Properties`_ and related chapters. |
Daniel Vetter | 2564d0b | 2017-03-02 16:16:35 +0100 | [diff] [blame] | 65 | |
| 66 | For the output routing the first step is encoders (represented by |
| 67 | :c:type:`struct drm_encoder <drm_encoder>`, see `Encoder Abstraction`_). Those |
| 68 | are really just internal artifacts of the helper libraries used to implement KMS |
| 69 | drivers. Besides that they make it unecessarily more complicated for userspace |
| 70 | to figure out which connections between a CRTC and a connector are possible, and |
| 71 | what kind of cloning is supported, they serve no purpose in the userspace API. |
| 72 | Unfortunately encoders have been exposed to userspace, hence can't remove them |
| 73 | at this point. Futhermore the exposed restrictions are often wrongly set by |
| 74 | drivers, and in many cases not powerful enough to express the real restrictions. |
| 75 | A CRTC can be connected to multiple encoders, and for an active CRTC there must |
| 76 | be at least one encoder. |
| 77 | |
| 78 | The final, and real, endpoint in the display chain is the connector (represented |
| 79 | by :c:type:`struct drm_connector <drm_connector>`, see `Connector |
| 80 | Abstraction`_). Connectors can have different possible encoders, but the kernel |
| 81 | driver selects which encoder to use for each connector. The use case is DVI, |
| 82 | which could switch between an analog and a digital encoder. Encoders can also |
| 83 | drive multiple different connectors. There is exactly one active connector for |
| 84 | every active encoder. |
| 85 | |
| 86 | Internally the output pipeline is a bit more complex and matches today's |
| 87 | hardware more closely: |
| 88 | |
| 89 | .. kernel-render:: DOT |
| 90 | :alt: KMS Output Pipeline |
| 91 | :caption: KMS Output Pipeline |
| 92 | |
| 93 | digraph "Output Pipeline" { |
| 94 | node [shape=box] |
| 95 | |
| 96 | subgraph { |
| 97 | "drm_crtc" [bgcolor=grey style=filled] |
| 98 | } |
| 99 | |
| 100 | subgraph cluster_internal { |
| 101 | style=dashed |
| 102 | label="Internal Pipeline" |
| 103 | { |
| 104 | node [bgcolor=grey style=filled] |
| 105 | "drm_encoder A"; |
| 106 | "drm_encoder B"; |
| 107 | "drm_encoder C"; |
| 108 | } |
| 109 | |
| 110 | { |
| 111 | node [bgcolor=grey style=filled] |
| 112 | "drm_encoder B" -> "drm_bridge B" |
| 113 | "drm_encoder C" -> "drm_bridge C1" |
| 114 | "drm_bridge C1" -> "drm_bridge C2"; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | "drm_crtc" -> "drm_encoder A" |
| 119 | "drm_crtc" -> "drm_encoder B" |
| 120 | "drm_crtc" -> "drm_encoder C" |
| 121 | |
| 122 | |
| 123 | subgraph cluster_output { |
| 124 | style=dashed |
| 125 | label="Outputs" |
| 126 | |
| 127 | "drm_encoder A" -> "drm_connector A"; |
| 128 | "drm_bridge B" -> "drm_connector B"; |
| 129 | "drm_bridge C2" -> "drm_connector C"; |
| 130 | |
| 131 | "drm_panel" |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | Internally two additional helper objects come into play. First, to be able to |
| 136 | share code for encoders (sometimes on the same SoC, sometimes off-chip) one or |
| 137 | more :ref:`drm_bridges` (represented by :c:type:`struct drm_bridge |
| 138 | <drm_bridge>`) can be linked to an encoder. This link is static and cannot be |
| 139 | changed, which means the cross-bar (if there is any) needs to be mapped between |
| 140 | the CRTC and any encoders. Often for drivers with bridges there's no code left |
| 141 | at the encoder level. Atomic drivers can leave out all the encoder callbacks to |
| 142 | essentially only leave a dummy routing object behind, which is needed for |
| 143 | backwards compatibility since encoders are exposed to userspace. |
| 144 | |
| 145 | The second object is for panels, represented by :c:type:`struct drm_panel |
| 146 | <drm_panel>`, see :ref:`drm_panel_helper`. Panels do not have a fixed binding |
| 147 | point, but are generally linked to the driver private structure that embeds |
| 148 | :c:type:`struct drm_connector <drm_connector>`. |
| 149 | |
| 150 | Note that currently the bridge chaining and interactions with connectors and |
| 151 | panels are still in-flux and not really fully sorted out yet. |
Daniel Vetter | 28575f1 | 2016-11-14 12:58:23 +0100 | [diff] [blame] | 152 | |
| 153 | KMS Core Structures and Functions |
| 154 | ================================= |
| 155 | |
Daniel Vetter | 28575f1 | 2016-11-14 12:58:23 +0100 | [diff] [blame] | 156 | .. kernel-doc:: include/drm/drm_mode_config.h |
| 157 | :internal: |
| 158 | |
Daniel Vetter | 1ea3576 | 2017-03-02 16:16:36 +0100 | [diff] [blame] | 159 | .. kernel-doc:: drivers/gpu/drm/drm_mode_config.c |
| 160 | :export: |
| 161 | |
Simon Ser | 6e5b47a | 2021-08-02 07:28:35 +0000 | [diff] [blame] | 162 | .. _kms_base_object_abstraction: |
| 163 | |
Daniel Vetter | 949619f | 2016-08-29 10:27:51 +0200 | [diff] [blame] | 164 | Modeset Base Object Abstraction |
| 165 | =============================== |
| 166 | |
Daniel Vetter | b2b82c2 | 2017-03-02 16:16:37 +0100 | [diff] [blame] | 167 | .. kernel-render:: DOT |
| 168 | :alt: Mode Objects and Properties |
| 169 | :caption: Mode Objects and Properties |
| 170 | |
| 171 | digraph { |
| 172 | node [shape=box] |
| 173 | |
| 174 | "drm_property A" -> "drm_mode_object A" |
| 175 | "drm_property A" -> "drm_mode_object B" |
| 176 | "drm_property B" -> "drm_mode_object A" |
| 177 | } |
| 178 | |
| 179 | The base structure for all KMS objects is :c:type:`struct drm_mode_object |
| 180 | <drm_mode_object>`. One of the base services it provides is tracking properties, |
| 181 | which are especially important for the atomic IOCTL (see `Atomic Mode |
| 182 | Setting`_). The somewhat surprising part here is that properties are not |
| 183 | directly instantiated on each object, but free-standing mode objects themselves, |
| 184 | represented by :c:type:`struct drm_property <drm_property>`, which only specify |
| 185 | the type and value range of a property. Any given property can be attached |
Daniel Vetter | 6acc942 | 2019-12-04 11:19:33 +0100 | [diff] [blame] | 186 | multiple times to different objects using drm_object_attach_property(). |
Daniel Vetter | b2b82c2 | 2017-03-02 16:16:37 +0100 | [diff] [blame] | 187 | |
Daniel Vetter | 949619f | 2016-08-29 10:27:51 +0200 | [diff] [blame] | 188 | .. kernel-doc:: include/drm/drm_mode_object.h |
| 189 | :internal: |
| 190 | |
| 191 | .. kernel-doc:: drivers/gpu/drm/drm_mode_object.c |
| 192 | :export: |
| 193 | |
Daniel Vetter | 4a8e229 | 2017-03-02 16:16:38 +0100 | [diff] [blame] | 194 | Atomic Mode Setting |
| 195 | =================== |
| 196 | |
| 197 | |
| 198 | .. kernel-render:: DOT |
| 199 | :alt: Mode Objects and Properties |
| 200 | :caption: Mode Objects and Properties |
| 201 | |
| 202 | digraph { |
| 203 | node [shape=box] |
| 204 | |
| 205 | subgraph cluster_state { |
| 206 | style=dashed |
| 207 | label="Free-standing state" |
| 208 | |
| 209 | "drm_atomic_state" -> "duplicated drm_plane_state A" |
| 210 | "drm_atomic_state" -> "duplicated drm_plane_state B" |
| 211 | "drm_atomic_state" -> "duplicated drm_crtc_state" |
| 212 | "drm_atomic_state" -> "duplicated drm_connector_state" |
| 213 | "drm_atomic_state" -> "duplicated driver private state" |
| 214 | } |
| 215 | |
| 216 | subgraph cluster_current { |
| 217 | style=dashed |
| 218 | label="Current state" |
| 219 | |
| 220 | "drm_device" -> "drm_plane A" |
| 221 | "drm_device" -> "drm_plane B" |
| 222 | "drm_device" -> "drm_crtc" |
| 223 | "drm_device" -> "drm_connector" |
| 224 | "drm_device" -> "driver private object" |
| 225 | |
| 226 | "drm_plane A" -> "drm_plane_state A" |
| 227 | "drm_plane B" -> "drm_plane_state B" |
| 228 | "drm_crtc" -> "drm_crtc_state" |
| 229 | "drm_connector" -> "drm_connector_state" |
| 230 | "driver private object" -> "driver private state" |
| 231 | } |
| 232 | |
| 233 | "drm_atomic_state" -> "drm_device" [label="atomic_commit"] |
| 234 | "duplicated drm_plane_state A" -> "drm_device"[style=invis] |
| 235 | } |
| 236 | |
| 237 | Atomic provides transactional modeset (including planes) updates, but a |
| 238 | bit differently from the usual transactional approach of try-commit and |
| 239 | rollback: |
| 240 | |
| 241 | - Firstly, no hardware changes are allowed when the commit would fail. This |
| 242 | allows us to implement the DRM_MODE_ATOMIC_TEST_ONLY mode, which allows |
| 243 | userspace to explore whether certain configurations would work or not. |
| 244 | |
| 245 | - This would still allow setting and rollback of just the software state, |
| 246 | simplifying conversion of existing drivers. But auditing drivers for |
| 247 | correctness of the atomic_check code becomes really hard with that: Rolling |
| 248 | back changes in data structures all over the place is hard to get right. |
| 249 | |
| 250 | - Lastly, for backwards compatibility and to support all use-cases, atomic |
| 251 | updates need to be incremental and be able to execute in parallel. Hardware |
| 252 | doesn't always allow it, but where possible plane updates on different CRTCs |
| 253 | should not interfere, and not get stalled due to output routing changing on |
| 254 | different CRTCs. |
| 255 | |
| 256 | Taken all together there's two consequences for the atomic design: |
| 257 | |
| 258 | - The overall state is split up into per-object state structures: |
| 259 | :c:type:`struct drm_plane_state <drm_plane_state>` for planes, :c:type:`struct |
| 260 | drm_crtc_state <drm_crtc_state>` for CRTCs and :c:type:`struct |
| 261 | drm_connector_state <drm_connector_state>` for connectors. These are the only |
| 262 | objects with userspace-visible and settable state. For internal state drivers |
| 263 | can subclass these structures through embeddeding, or add entirely new state |
Daniel Vetter | 0380c68 | 2019-12-04 11:00:11 +0100 | [diff] [blame] | 264 | structures for their globally shared hardware functions, see :c:type:`struct |
| 265 | drm_private_state<drm_private_state>`. |
Daniel Vetter | 4a8e229 | 2017-03-02 16:16:38 +0100 | [diff] [blame] | 266 | |
| 267 | - An atomic update is assembled and validated as an entirely free-standing pile |
| 268 | of structures within the :c:type:`drm_atomic_state <drm_atomic_state>` |
Daniel Vetter | 5fca5ec | 2017-12-14 21:30:54 +0100 | [diff] [blame] | 269 | container. Driver private state structures are also tracked in the same |
| 270 | structure; see the next chapter. Only when a state is committed is it applied |
| 271 | to the driver and modeset objects. This way rolling back an update boils down |
| 272 | to releasing memory and unreferencing objects like framebuffers. |
Daniel Vetter | 4a8e229 | 2017-03-02 16:16:38 +0100 | [diff] [blame] | 273 | |
Daniel Vetter | 0380c68 | 2019-12-04 11:00:11 +0100 | [diff] [blame] | 274 | Locking of atomic state structures is internally using :c:type:`struct |
| 275 | drm_modeset_lock <drm_modeset_lock>`. As a general rule the locking shouldn't be |
| 276 | exposed to drivers, instead the right locks should be automatically acquired by |
| 277 | any function that duplicates or peeks into a state, like e.g. |
Daniel Vetter | 6acc942 | 2019-12-04 11:19:33 +0100 | [diff] [blame] | 278 | drm_atomic_get_crtc_state(). Locking only protects the software data |
Daniel Vetter | 0380c68 | 2019-12-04 11:00:11 +0100 | [diff] [blame] | 279 | structure, ordering of committing state changes to hardware is sequenced using |
| 280 | :c:type:`struct drm_crtc_commit <drm_crtc_commit>`. |
| 281 | |
Daniel Vetter | 4a8e229 | 2017-03-02 16:16:38 +0100 | [diff] [blame] | 282 | Read on in this chapter, and also in :ref:`drm_atomic_helper` for more detailed |
| 283 | coverage of specific topics. |
| 284 | |
Daniel Vetter | da6c059 | 2017-12-14 21:30:53 +0100 | [diff] [blame] | 285 | Handling Driver Private State |
| 286 | ----------------------------- |
| 287 | |
| 288 | .. kernel-doc:: drivers/gpu/drm/drm_atomic.c |
| 289 | :doc: handling driver private state |
| 290 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 291 | Atomic Mode Setting Function Reference |
Daniel Vetter | 4a8e229 | 2017-03-02 16:16:38 +0100 | [diff] [blame] | 292 | -------------------------------------- |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 293 | |
Daniel Vetter | 5d070be | 2016-08-12 22:48:46 +0200 | [diff] [blame] | 294 | .. kernel-doc:: include/drm/drm_atomic.h |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 295 | :internal: |
| 296 | |
Daniel Vetter | 1ea3576 | 2017-03-02 16:16:36 +0100 | [diff] [blame] | 297 | .. kernel-doc:: drivers/gpu/drm/drm_atomic.c |
| 298 | :export: |
| 299 | |
Daniel Vetter | 72fdb40c | 2018-09-05 15:57:11 +0200 | [diff] [blame] | 300 | Atomic Mode Setting IOCTL and UAPI Functions |
| 301 | -------------------------------------------- |
| 302 | |
| 303 | .. kernel-doc:: drivers/gpu/drm/drm_atomic_uapi.c |
| 304 | :doc: overview |
| 305 | |
| 306 | .. kernel-doc:: drivers/gpu/drm/drm_atomic_uapi.c |
| 307 | :export: |
| 308 | |
Daniel Vetter | 28575f1 | 2016-11-14 12:58:23 +0100 | [diff] [blame] | 309 | CRTC Abstraction |
| 310 | ================ |
| 311 | |
| 312 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c |
Daniel Vetter | d5d487e | 2017-01-25 07:26:57 +0100 | [diff] [blame] | 313 | :doc: overview |
| 314 | |
| 315 | CRTC Functions Reference |
| 316 | -------------------------------- |
Daniel Vetter | 28575f1 | 2016-11-14 12:58:23 +0100 | [diff] [blame] | 317 | |
| 318 | .. kernel-doc:: include/drm/drm_crtc.h |
| 319 | :internal: |
| 320 | |
Daniel Vetter | d5d487e | 2017-01-25 07:26:57 +0100 | [diff] [blame] | 321 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c |
| 322 | :export: |
| 323 | |
Simon Ser | 2189100 | 2020-12-16 21:22:18 +0100 | [diff] [blame] | 324 | Color Management Functions Reference |
| 325 | ------------------------------------ |
| 326 | |
| 327 | .. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c |
| 328 | :export: |
| 329 | |
| 330 | .. kernel-doc:: include/drm/drm_color_mgmt.h |
| 331 | :internal: |
| 332 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 333 | Frame Buffer Abstraction |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 334 | ======================== |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 335 | |
Daniel Vetter | 750fb8c | 2016-08-12 22:48:48 +0200 | [diff] [blame] | 336 | .. kernel-doc:: drivers/gpu/drm/drm_framebuffer.c |
| 337 | :doc: overview |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 338 | |
Daniel Vetter | 7520a27 | 2016-08-15 16:07:02 +0200 | [diff] [blame] | 339 | Frame Buffer Functions Reference |
| 340 | -------------------------------- |
| 341 | |
Daniel Vetter | 7520a27 | 2016-08-15 16:07:02 +0200 | [diff] [blame] | 342 | .. kernel-doc:: include/drm/drm_framebuffer.h |
| 343 | :internal: |
| 344 | |
Daniel Vetter | 1ea3576 | 2017-03-02 16:16:36 +0100 | [diff] [blame] | 345 | .. kernel-doc:: drivers/gpu/drm/drm_framebuffer.c |
| 346 | :export: |
| 347 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 348 | DRM Format Handling |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 349 | =================== |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 350 | |
Brian Starkey | 7e7b68e | 2018-08-21 17:16:11 +0100 | [diff] [blame] | 351 | .. kernel-doc:: include/uapi/drm/drm_fourcc.h |
| 352 | :doc: overview |
| 353 | |
| 354 | Format Functions Reference |
| 355 | -------------------------- |
| 356 | |
Laurent Pinchart | 84770cc | 2016-10-18 01:41:09 +0300 | [diff] [blame] | 357 | .. kernel-doc:: include/drm/drm_fourcc.h |
| 358 | :internal: |
| 359 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 360 | .. kernel-doc:: drivers/gpu/drm/drm_fourcc.c |
| 361 | :export: |
| 362 | |
| 363 | Dumb Buffer Objects |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 364 | =================== |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 365 | |
Daniel Vetter | 4f93624 | 2016-11-14 12:58:21 +0100 | [diff] [blame] | 366 | .. kernel-doc:: drivers/gpu/drm/drm_dumb_buffers.c |
| 367 | :doc: overview |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 368 | |
Daniel Vetter | 43968d7 | 2016-09-21 10:59:24 +0200 | [diff] [blame] | 369 | Plane Abstraction |
| 370 | ================= |
| 371 | |
Daniel Vetter | 532b367 | 2016-09-21 10:59:25 +0200 | [diff] [blame] | 372 | .. kernel-doc:: drivers/gpu/drm/drm_plane.c |
| 373 | :doc: overview |
| 374 | |
Daniel Vetter | 43968d7 | 2016-09-21 10:59:24 +0200 | [diff] [blame] | 375 | Plane Functions Reference |
| 376 | ------------------------- |
| 377 | |
| 378 | .. kernel-doc:: include/drm/drm_plane.h |
| 379 | :internal: |
| 380 | |
| 381 | .. kernel-doc:: drivers/gpu/drm/drm_plane.c |
| 382 | :export: |
| 383 | |
Simon Ser | 9d8f78f | 2020-12-16 21:22:16 +0100 | [diff] [blame] | 384 | Plane Composition Functions Reference |
| 385 | ------------------------------------- |
| 386 | |
| 387 | .. kernel-doc:: drivers/gpu/drm/drm_blend.c |
| 388 | :export: |
| 389 | |
Simon Ser | 31c558f | 2020-12-16 21:22:17 +0100 | [diff] [blame] | 390 | Plane Damage Tracking Functions Reference |
| 391 | ----------------------------------------- |
| 392 | |
| 393 | .. kernel-doc:: drivers/gpu/drm/drm_damage_helper.c |
| 394 | :export: |
| 395 | |
| 396 | .. kernel-doc:: include/drm/drm_damage_helper.h |
| 397 | :internal: |
| 398 | |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 399 | Display Modes Function Reference |
| 400 | ================================ |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 401 | |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 402 | .. kernel-doc:: include/drm/drm_modes.h |
| 403 | :internal: |
| 404 | |
| 405 | .. kernel-doc:: drivers/gpu/drm/drm_modes.c |
| 406 | :export: |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 407 | |
Daniel Vetter | ae2a6da | 2016-08-12 22:48:53 +0200 | [diff] [blame] | 408 | Connector Abstraction |
| 409 | ===================== |
| 410 | |
| 411 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 412 | :doc: overview |
| 413 | |
| 414 | Connector Functions Reference |
| 415 | ----------------------------- |
Daniel Vetter | 5221719 | 2016-08-12 22:48:50 +0200 | [diff] [blame] | 416 | |
| 417 | .. kernel-doc:: include/drm/drm_connector.h |
| 418 | :internal: |
| 419 | |
| 420 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 421 | :export: |
| 422 | |
Brian Starkey | 935774c | 2017-03-29 17:42:32 +0100 | [diff] [blame] | 423 | Writeback Connectors |
| 424 | -------------------- |
| 425 | |
Sam Ravnborg | e2d7fc2 | 2020-04-06 21:47:46 +0200 | [diff] [blame] | 426 | .. kernel-doc:: include/drm/drm_writeback.h |
| 427 | :internal: |
| 428 | |
Brian Starkey | 935774c | 2017-03-29 17:42:32 +0100 | [diff] [blame] | 429 | .. kernel-doc:: drivers/gpu/drm/drm_writeback.c |
| 430 | :doc: overview |
| 431 | |
| 432 | .. kernel-doc:: drivers/gpu/drm/drm_writeback.c |
| 433 | :export: |
| 434 | |
Daniel Vetter | 321a95a | 2016-08-29 10:27:49 +0200 | [diff] [blame] | 435 | Encoder Abstraction |
| 436 | =================== |
| 437 | |
Daniel Vetter | e03e6de | 2016-08-29 10:27:50 +0200 | [diff] [blame] | 438 | .. kernel-doc:: drivers/gpu/drm/drm_encoder.c |
| 439 | :doc: overview |
| 440 | |
| 441 | Encoder Functions Reference |
| 442 | --------------------------- |
| 443 | |
Daniel Vetter | 321a95a | 2016-08-29 10:27:49 +0200 | [diff] [blame] | 444 | .. kernel-doc:: include/drm/drm_encoder.h |
| 445 | :internal: |
| 446 | |
| 447 | .. kernel-doc:: drivers/gpu/drm/drm_encoder.c |
| 448 | :export: |
| 449 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 450 | KMS Locking |
Daniel Vetter | 311b62d | 2016-08-12 22:48:41 +0200 | [diff] [blame] | 451 | =========== |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 452 | |
| 453 | .. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c |
| 454 | :doc: kms locking |
| 455 | |
| 456 | .. kernel-doc:: include/drm/drm_modeset_lock.h |
| 457 | :internal: |
| 458 | |
| 459 | .. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c |
| 460 | :export: |
| 461 | |
| 462 | KMS Properties |
| 463 | ============== |
| 464 | |
Simon Ser | 46f9be4 | 2020-12-17 12:32:12 +0100 | [diff] [blame] | 465 | This section of the documentation is primarily aimed at user-space developers. |
| 466 | For the driver APIs, see the other sections. |
| 467 | |
Maxime Ripard | c18c36d | 2021-07-20 16:35:44 +0200 | [diff] [blame] | 468 | Requirements |
| 469 | ------------ |
| 470 | |
| 471 | KMS drivers might need to add extra properties to support new features. Each |
| 472 | new property introduced in a driver needs to meet a few requirements, in |
| 473 | addition to the one mentioned above: |
| 474 | |
| 475 | * It must be standardized, documenting: |
| 476 | |
| 477 | * The full, exact, name string; |
| 478 | * If the property is an enum, all the valid value name strings; |
| 479 | * What values are accepted, and what these values mean; |
| 480 | * What the property does and how it can be used; |
| 481 | * How the property might interact with other, existing properties. |
| 482 | |
| 483 | * It must provide a generic helper in the core code to register that |
| 484 | property on the object it attaches to. |
| 485 | |
| 486 | * Its content must be decoded by the core and provided in the object's |
| 487 | associated state structure. That includes anything drivers might want |
| 488 | to precompute, like struct drm_clip_rect for planes. |
| 489 | |
| 490 | * Its initial state must match the behavior prior to the property |
| 491 | introduction. This might be a fixed value matching what the hardware |
| 492 | does, or it may be inherited from the state the firmware left the |
| 493 | system in during boot. |
| 494 | |
| 495 | * An IGT test must be submitted where reasonable. |
| 496 | |
Daniel Vetter | 59e71ee | 2016-08-29 10:27:55 +0200 | [diff] [blame] | 497 | Property Types and Blob Property Support |
| 498 | ---------------------------------------- |
| 499 | |
Daniel Vetter | c8458c7 | 2016-08-29 10:27:57 +0200 | [diff] [blame] | 500 | .. kernel-doc:: drivers/gpu/drm/drm_property.c |
| 501 | :doc: overview |
| 502 | |
Daniel Vetter | 59e71ee | 2016-08-29 10:27:55 +0200 | [diff] [blame] | 503 | .. kernel-doc:: include/drm/drm_property.h |
| 504 | :internal: |
| 505 | |
| 506 | .. kernel-doc:: drivers/gpu/drm/drm_property.c |
| 507 | :export: |
| 508 | |
Rajat Jain | 107fe90 | 2021-10-05 22:23:13 +0200 | [diff] [blame] | 509 | .. _standard_connector_properties: |
| 510 | |
Daniel Vetter | 4ada6f2 | 2016-11-17 09:56:48 +0100 | [diff] [blame] | 511 | Standard Connector Properties |
| 512 | ----------------------------- |
| 513 | |
| 514 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 515 | :doc: standard connector properties |
| 516 | |
Stanislav Lisovskiy | 50525c3 | 2018-05-15 16:59:27 +0300 | [diff] [blame] | 517 | HDMI Specific Connector Properties |
Daniel Vetter | ba60963 | 2018-07-02 11:10:23 +0200 | [diff] [blame] | 518 | ---------------------------------- |
Stanislav Lisovskiy | 50525c3 | 2018-05-15 16:59:27 +0300 | [diff] [blame] | 519 | |
| 520 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 521 | :doc: HDMI connector properties |
| 522 | |
Simon Ser | e954f77 | 2020-05-21 11:09:31 +0000 | [diff] [blame] | 523 | Standard CRTC Properties |
| 524 | ------------------------ |
| 525 | |
| 526 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c |
| 527 | :doc: standard CRTC properties |
| 528 | |
Simon Ser | 77a71ab | 2020-12-17 12:32:13 +0100 | [diff] [blame] | 529 | Standard Plane Properties |
| 530 | ------------------------- |
| 531 | |
| 532 | .. kernel-doc:: drivers/gpu/drm/drm_plane.c |
| 533 | :doc: standard plane properties |
| 534 | |
Daniel Vetter | 1e4d84c | 2016-09-21 10:59:27 +0200 | [diff] [blame] | 535 | Plane Composition Properties |
| 536 | ---------------------------- |
| 537 | |
| 538 | .. kernel-doc:: drivers/gpu/drm/drm_blend.c |
| 539 | :doc: overview |
Daniel Vetter | 52a9fcd | 2016-08-12 22:48:51 +0200 | [diff] [blame] | 540 | |
Simon Ser | e07f001 | 2020-12-16 21:22:15 +0100 | [diff] [blame] | 541 | Damage Tracking Properties |
| 542 | -------------------------- |
Lukasz Spintzyk | d3b2176 | 2018-05-23 19:04:08 -0700 | [diff] [blame] | 543 | |
Daniel Vetter | ba6cd76 | 2021-07-23 10:34:57 +0200 | [diff] [blame] | 544 | .. kernel-doc:: drivers/gpu/drm/drm_plane.c |
| 545 | :doc: damage tracking |
Lukasz Spintzyk | d3b2176 | 2018-05-23 19:04:08 -0700 | [diff] [blame] | 546 | |
Daniel Vetter | a6acccf | 2016-09-21 10:59:29 +0200 | [diff] [blame] | 547 | Color Management Properties |
| 548 | --------------------------- |
| 549 | |
| 550 | .. kernel-doc:: drivers/gpu/drm/drm_color_mgmt.c |
| 551 | :doc: overview |
| 552 | |
Daniel Vetter | 9498c19 | 2016-11-14 12:58:24 +0100 | [diff] [blame] | 553 | Tile Group Property |
| 554 | ------------------- |
| 555 | |
| 556 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 557 | :doc: Tile group |
| 558 | |
Gustavo Padovan | 9a83a71 | 2016-11-22 09:11:28 +0900 | [diff] [blame] | 559 | Explicit Fencing Properties |
| 560 | --------------------------- |
| 561 | |
Daniel Vetter | 72fdb40c | 2018-09-05 15:57:11 +0200 | [diff] [blame] | 562 | .. kernel-doc:: drivers/gpu/drm/drm_atomic_uapi.c |
Gustavo Padovan | 9a83a71 | 2016-11-22 09:11:28 +0900 | [diff] [blame] | 563 | :doc: explicit fencing properties |
| 564 | |
Nicholas Kazlauskas | ab7a664 | 2018-10-04 14:38:42 -0400 | [diff] [blame] | 565 | |
| 566 | Variable Refresh Properties |
| 567 | --------------------------- |
| 568 | |
| 569 | .. kernel-doc:: drivers/gpu/drm/drm_connector.c |
| 570 | :doc: Variable refresh properties |
| 571 | |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 572 | Existing KMS Properties |
| 573 | ----------------------- |
| 574 | |
Daniel Vetter | 3f0df75 | 2018-02-19 23:53:52 +0100 | [diff] [blame] | 575 | The following table gives description of drm properties exposed by various |
| 576 | modules/drivers. Because this table is very unwieldy, do not add any new |
| 577 | properties here. Instead document them in a section above. |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 578 | |
| 579 | .. csv-table:: |
| 580 | :header-rows: 1 |
| 581 | :file: kms-properties.csv |
| 582 | |
| 583 | Vertical Blanking |
| 584 | ================= |
| 585 | |
Daniel Vetter | 57d3023 | 2017-05-24 16:51:45 +0200 | [diff] [blame] | 586 | .. kernel-doc:: drivers/gpu/drm/drm_vblank.c |
| 587 | :doc: vblank handling |
Jani Nikula | 2fa91d1 | 2016-06-21 14:49:02 +0300 | [diff] [blame] | 588 | |
| 589 | Vertical Blanking and Interrupt Handling Functions Reference |
| 590 | ------------------------------------------------------------ |
| 591 | |
Daniel Vetter | 3ed4351 | 2017-05-31 11:21:46 +0200 | [diff] [blame] | 592 | .. kernel-doc:: include/drm/drm_vblank.h |
Daniel Vetter | 34a67dd | 2016-07-15 21:48:01 +0200 | [diff] [blame] | 593 | :internal: |
Daniel Vetter | 1ea3576 | 2017-03-02 16:16:36 +0100 | [diff] [blame] | 594 | |
Daniel Vetter | 3ed4351 | 2017-05-31 11:21:46 +0200 | [diff] [blame] | 595 | .. kernel-doc:: drivers/gpu/drm/drm_vblank.c |
Daniel Vetter | 1ea3576 | 2017-03-02 16:16:36 +0100 | [diff] [blame] | 596 | :export: |
Lyude Paul | 5e6c2b4 | 2020-04-17 15:33:13 -0400 | [diff] [blame] | 597 | |
| 598 | Vertical Blank Work |
| 599 | =================== |
| 600 | |
| 601 | .. kernel-doc:: drivers/gpu/drm/drm_vblank_work.c |
| 602 | :doc: vblank works |
| 603 | |
| 604 | Vertical Blank Work Functions Reference |
| 605 | --------------------------------------- |
| 606 | |
| 607 | .. kernel-doc:: include/drm/drm_vblank_work.h |
| 608 | :internal: |
| 609 | |
| 610 | .. kernel-doc:: drivers/gpu/drm/drm_vblank_work.c |
| 611 | :export: |