| .. | .. |
|---|
| 24 | 24 | At the core of every DRM driver is a :c:type:`struct drm_driver |
|---|
| 25 | 25 | <drm_driver>` structure. Drivers typically statically initialize |
|---|
| 26 | 26 | a drm_driver structure, and then pass it to |
|---|
| 27 | | -:c:func:`drm_dev_alloc()` to allocate a device instance. After the |
|---|
| 27 | +drm_dev_alloc() to allocate a device instance. After the |
|---|
| 28 | 28 | device instance is fully initialized it can be registered (which makes |
|---|
| 29 | | -it accessible from userspace) using :c:func:`drm_dev_register()`. |
|---|
| 29 | +it accessible from userspace) using drm_dev_register(). |
|---|
| 30 | 30 | |
|---|
| 31 | 31 | The :c:type:`struct drm_driver <drm_driver>` structure |
|---|
| 32 | 32 | contains static information that describes the driver and features it |
|---|
| .. | .. |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | Driver Information |
|---|
| 40 | 40 | ------------------ |
|---|
| 41 | | - |
|---|
| 42 | | -Driver Features |
|---|
| 43 | | -~~~~~~~~~~~~~~~ |
|---|
| 44 | | - |
|---|
| 45 | | -Drivers inform the DRM core about their requirements and supported |
|---|
| 46 | | -features by setting appropriate flags in the driver_features field. |
|---|
| 47 | | -Since those flags influence the DRM core behaviour since registration |
|---|
| 48 | | -time, most of them must be set to registering the :c:type:`struct |
|---|
| 49 | | -drm_driver <drm_driver>` instance. |
|---|
| 50 | | - |
|---|
| 51 | | -u32 driver_features; |
|---|
| 52 | | - |
|---|
| 53 | | -DRIVER_USE_AGP |
|---|
| 54 | | - Driver uses AGP interface, the DRM core will manage AGP resources. |
|---|
| 55 | | - |
|---|
| 56 | | -DRIVER_LEGACY |
|---|
| 57 | | - Denote a legacy driver using shadow attach. Don't use. |
|---|
| 58 | | - |
|---|
| 59 | | -DRIVER_KMS_LEGACY_CONTEXT |
|---|
| 60 | | - Used only by nouveau for backwards compatibility with existing userspace. |
|---|
| 61 | | - Don't use. |
|---|
| 62 | | - |
|---|
| 63 | | -DRIVER_PCI_DMA |
|---|
| 64 | | - Driver is capable of PCI DMA, mapping of PCI DMA buffers to |
|---|
| 65 | | - userspace will be enabled. Deprecated. |
|---|
| 66 | | - |
|---|
| 67 | | -DRIVER_SG |
|---|
| 68 | | - Driver can perform scatter/gather DMA, allocation and mapping of |
|---|
| 69 | | - scatter/gather buffers will be enabled. Deprecated. |
|---|
| 70 | | - |
|---|
| 71 | | -DRIVER_HAVE_DMA |
|---|
| 72 | | - Driver supports DMA, the userspace DMA API will be supported. |
|---|
| 73 | | - Deprecated. |
|---|
| 74 | | - |
|---|
| 75 | | -DRIVER_HAVE_IRQ; DRIVER_IRQ_SHARED |
|---|
| 76 | | - DRIVER_HAVE_IRQ indicates whether the driver has an IRQ handler |
|---|
| 77 | | - managed by the DRM Core. The core will support simple IRQ handler |
|---|
| 78 | | - installation when the flag is set. The installation process is |
|---|
| 79 | | - described in ?. |
|---|
| 80 | | - |
|---|
| 81 | | - DRIVER_IRQ_SHARED indicates whether the device & handler support |
|---|
| 82 | | - shared IRQs (note that this is required of PCI drivers). |
|---|
| 83 | | - |
|---|
| 84 | | -DRIVER_GEM |
|---|
| 85 | | - Driver use the GEM memory manager. |
|---|
| 86 | | - |
|---|
| 87 | | -DRIVER_MODESET |
|---|
| 88 | | - Driver supports mode setting interfaces (KMS). |
|---|
| 89 | | - |
|---|
| 90 | | -DRIVER_PRIME |
|---|
| 91 | | - Driver implements DRM PRIME buffer sharing. |
|---|
| 92 | | - |
|---|
| 93 | | -DRIVER_RENDER |
|---|
| 94 | | - Driver supports dedicated render nodes. |
|---|
| 95 | | - |
|---|
| 96 | | -DRIVER_ATOMIC |
|---|
| 97 | | - Driver supports atomic properties. In this case the driver must |
|---|
| 98 | | - implement appropriate obj->atomic_get_property() vfuncs for any |
|---|
| 99 | | - modeset objects with driver specific properties. |
|---|
| 100 | | - |
|---|
| 101 | | -DRIVER_SYNCOBJ |
|---|
| 102 | | - Driver support drm sync objects. |
|---|
| 103 | 41 | |
|---|
| 104 | 42 | Major, Minor and Patchlevel |
|---|
| 105 | 43 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| .. | .. |
|---|
| 143 | 81 | .. kernel-doc:: drivers/gpu/drm/drm_drv.c |
|---|
| 144 | 82 | :doc: driver instance overview |
|---|
| 145 | 83 | |
|---|
| 84 | +.. kernel-doc:: include/drm/drm_device.h |
|---|
| 85 | + :internal: |
|---|
| 86 | + |
|---|
| 146 | 87 | .. kernel-doc:: include/drm/drm_drv.h |
|---|
| 147 | 88 | :internal: |
|---|
| 148 | 89 | |
|---|
| .. | .. |
|---|
| 152 | 93 | Driver Load |
|---|
| 153 | 94 | ----------- |
|---|
| 154 | 95 | |
|---|
| 96 | +Component Helper Usage |
|---|
| 97 | +~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 98 | + |
|---|
| 99 | +.. kernel-doc:: drivers/gpu/drm/drm_drv.c |
|---|
| 100 | + :doc: component helper usage recommendations |
|---|
| 155 | 101 | |
|---|
| 156 | 102 | IRQ Helper Library |
|---|
| 157 | 103 | ~~~~~~~~~~~~~~~~~~ |
|---|
| .. | .. |
|---|
| 185 | 131 | be unmapped; on many devices, the ROM address decoder is shared with |
|---|
| 186 | 132 | other BARs, so leaving it mapped could cause undesired behaviour like |
|---|
| 187 | 133 | hangs or memory corruption. |
|---|
| 134 | + |
|---|
| 135 | +Managed Resources |
|---|
| 136 | +----------------- |
|---|
| 137 | + |
|---|
| 138 | +.. kernel-doc:: drivers/gpu/drm/drm_managed.c |
|---|
| 139 | + :doc: managed resources |
|---|
| 140 | + |
|---|
| 141 | +.. kernel-doc:: drivers/gpu/drm/drm_managed.c |
|---|
| 142 | + :export: |
|---|
| 143 | + |
|---|
| 144 | +.. kernel-doc:: include/drm/drm_managed.h |
|---|
| 145 | + :internal: |
|---|
| 188 | 146 | |
|---|
| 189 | 147 | Bus-specific Device Registration and PCI Support |
|---|
| 190 | 148 | ------------------------------------------------ |
|---|
| .. | .. |
|---|
| 230 | 188 | .. kernel-doc:: drivers/gpu/drm/drm_print.c |
|---|
| 231 | 189 | :export: |
|---|
| 232 | 190 | |
|---|
| 191 | +Utilities |
|---|
| 192 | +--------- |
|---|
| 193 | + |
|---|
| 194 | +.. kernel-doc:: include/drm/drm_util.h |
|---|
| 195 | + :doc: drm utils |
|---|
| 196 | + |
|---|
| 197 | +.. kernel-doc:: include/drm/drm_util.h |
|---|
| 198 | + :internal: |
|---|
| 199 | + |
|---|
| 233 | 200 | |
|---|
| 234 | 201 | Legacy Support Code |
|---|
| 235 | 202 | =================== |
|---|