|
155 | 155 | will become a fatal error. |
156 | 156 | </para></listitem> |
157 | 157 | </varlistentry> |
158 | | - <varlistentry> |
159 | | - <term>DRIVER_USE_MTRR</term> |
160 | | - <listitem><para> |
161 | | - Driver uses MTRR interface for mapping memory, the DRM core will |
162 | | - manage MTRR resources. Deprecated. |
163 | | - </para></listitem> |
164 | | - </varlistentry> |
165 | 158 | <varlistentry> |
166 | 159 | <term>DRIVER_PCI_DMA</term> |
167 | 160 | <listitem><para> |
|
194 | 187 | support shared IRQs (note that this is required of PCI drivers). |
195 | 188 | </para></listitem> |
196 | 189 | </varlistentry> |
197 | | - <varlistentry> |
198 | | - <term>DRIVER_IRQ_VBL</term> |
199 | | - <listitem><para>Unused. Deprecated.</para></listitem> |
200 | | - </varlistentry> |
201 | | - <varlistentry> |
202 | | - <term>DRIVER_DMA_QUEUE</term> |
203 | | - <listitem><para> |
204 | | - Should be set if the driver queues DMA requests and completes them |
205 | | - asynchronously. Deprecated. |
206 | | - </para></listitem> |
207 | | - </varlistentry> |
208 | | - <varlistentry> |
209 | | - <term>DRIVER_FB_DMA</term> |
210 | | - <listitem><para> |
211 | | - Driver supports DMA to/from the framebuffer, mapping of frambuffer |
212 | | - DMA buffers to userspace will be supported. Deprecated. |
213 | | - </para></listitem> |
214 | | - </varlistentry> |
215 | | - <varlistentry> |
216 | | - <term>DRIVER_IRQ_VBL2</term> |
217 | | - <listitem><para>Unused. Deprecated.</para></listitem> |
218 | | - </varlistentry> |
219 | 190 | <varlistentry> |
220 | 191 | <term>DRIVER_GEM</term> |
221 | 192 | <listitem><para> |
|
234 | 205 | Driver implements DRM PRIME buffer sharing. |
235 | 206 | </para></listitem> |
236 | 207 | </varlistentry> |
| 208 | + <varlistentry> |
| 209 | + <term>DRIVER_RENDER</term> |
| 210 | + <listitem><para> |
| 211 | + Driver supports dedicated render nodes. |
| 212 | + </para></listitem> |
| 213 | + </varlistentry> |
237 | 214 | </variablelist> |
238 | 215 | </sect3> |
239 | 216 | <sect3> |
@@ -2212,6 +2189,18 @@ void intel_crt_init(struct drm_device *dev) |
2212 | 2189 | !Iinclude/drm/drm_rect.h |
2213 | 2190 | !Edrivers/gpu/drm/drm_rect.c |
2214 | 2191 | </sect2> |
| 2192 | + <sect2> |
| 2193 | + <title>Flip-work Helper Reference</title> |
| 2194 | +!Pinclude/drm/drm_flip_work.h flip utils |
| 2195 | +!Iinclude/drm/drm_flip_work.h |
| 2196 | +!Edrivers/gpu/drm/drm_flip_work.c |
| 2197 | + </sect2> |
| 2198 | + <sect2> |
| 2199 | + <title>VMA Offset Manager</title> |
| 2200 | +!Pdrivers/gpu/drm/drm_vma_manager.c vma offset manager |
| 2201 | +!Edrivers/gpu/drm/drm_vma_manager.c |
| 2202 | +!Iinclude/drm/drm_vma_manager.h |
| 2203 | + </sect2> |
2215 | 2204 | </sect1> |
2216 | 2205 |
|
2217 | 2206 | <!-- Internals: kms properties --> |
@@ -2422,18 +2411,18 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis> |
2422 | 2411 | </abstract> |
2423 | 2412 | <para> |
2424 | 2413 | The <methodname>firstopen</methodname> method is called by the DRM core |
2425 | | - when an application opens a device that has no other opened file handle. |
2426 | | - Similarly the <methodname>lastclose</methodname> method is called when |
2427 | | - the last application holding a file handle opened on the device closes |
2428 | | - it. Both methods are mostly used for UMS (User Mode Setting) drivers to |
2429 | | - acquire and release device resources which should be done in the |
2430 | | - <methodname>load</methodname> and <methodname>unload</methodname> |
2431 | | - methods for KMS drivers. |
| 2414 | + for legacy UMS (User Mode Setting) drivers only when an application |
| 2415 | + opens a device that has no other opened file handle. UMS drivers can |
| 2416 | + implement it to acquire device resources. KMS drivers can't use the |
| 2417 | + method and must acquire resources in the <methodname>load</methodname> |
| 2418 | + method instead. |
2432 | 2419 | </para> |
2433 | 2420 | <para> |
2434 | | - Note that the <methodname>lastclose</methodname> method is also called |
2435 | | - at module unload time or, for hot-pluggable devices, when the device is |
2436 | | - unplugged. The <methodname>firstopen</methodname> and |
| 2421 | + Similarly the <methodname>lastclose</methodname> method is called when |
| 2422 | + the last application holding a file handle opened on the device closes |
| 2423 | + it, for both UMS and KMS drivers. Additionally, the method is also |
| 2424 | + called at module unload time or, for hot-pluggable devices, when the |
| 2425 | + device is unplugged. The <methodname>firstopen</methodname> and |
2437 | 2426 | <methodname>lastclose</methodname> calls can thus be unbalanced. |
2438 | 2427 | </para> |
2439 | 2428 | <para> |
@@ -2462,7 +2451,12 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis> |
2462 | 2451 | <para> |
2463 | 2452 | The <methodname>lastclose</methodname> method should restore CRTC and |
2464 | 2453 | plane properties to default value, so that a subsequent open of the |
2465 | | - device will not inherit state from the previous user. |
| 2454 | + device will not inherit state from the previous user. It can also be |
| 2455 | + used to execute delayed power switching state changes, e.g. in |
| 2456 | + conjunction with the vga-switcheroo infrastructure. Beyond that KMS |
| 2457 | + drivers should not do any further cleanup. Only legacy UMS drivers might |
| 2458 | + need to clean up device state so that the vga console or an independent |
| 2459 | + fbdev driver could take over. |
2466 | 2460 | </para> |
2467 | 2461 | </sect2> |
2468 | 2462 | <sect2> |
@@ -2498,7 +2492,6 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis> |
2498 | 2492 | <programlisting> |
2499 | 2493 | .poll = drm_poll, |
2500 | 2494 | .read = drm_read, |
2501 | | - .fasync = drm_fasync, |
2502 | 2495 | .llseek = no_llseek, |
2503 | 2496 | </programlisting> |
2504 | 2497 | </para> |
@@ -2657,6 +2650,69 @@ int (*resume) (struct drm_device *);</synopsis> |
2657 | 2650 | info, since man pages should cover the rest. |
2658 | 2651 | </para> |
2659 | 2652 |
|
| 2653 | + <!-- External: render nodes --> |
| 2654 | + |
| 2655 | + <sect1> |
| 2656 | + <title>Render nodes</title> |
| 2657 | + <para> |
| 2658 | + DRM core provides multiple character-devices for user-space to use. |
| 2659 | + Depending on which device is opened, user-space can perform a different |
| 2660 | + set of operations (mainly ioctls). The primary node is always created |
| 2661 | + and called <term>card<num></term>. Additionally, a currently |
| 2662 | + unused control node, called <term>controlD<num></term> is also |
| 2663 | + created. The primary node provides all legacy operations and |
| 2664 | + historically was the only interface used by userspace. With KMS, the |
| 2665 | + control node was introduced. However, the planned KMS control interface |
| 2666 | + has never been written and so the control node stays unused to date. |
| 2667 | + </para> |
| 2668 | + <para> |
| 2669 | + With the increased use of offscreen renderers and GPGPU applications, |
| 2670 | + clients no longer require running compositors or graphics servers to |
| 2671 | + make use of a GPU. But the DRM API required unprivileged clients to |
| 2672 | + authenticate to a DRM-Master prior to getting GPU access. To avoid this |
| 2673 | + step and to grant clients GPU access without authenticating, render |
| 2674 | + nodes were introduced. Render nodes solely serve render clients, that |
| 2675 | + is, no modesetting or privileged ioctls can be issued on render nodes. |
| 2676 | + Only non-global rendering commands are allowed. If a driver supports |
| 2677 | + render nodes, it must advertise it via the <term>DRIVER_RENDER</term> |
| 2678 | + DRM driver capability. If not supported, the primary node must be used |
| 2679 | + for render clients together with the legacy drmAuth authentication |
| 2680 | + procedure. |
| 2681 | + </para> |
| 2682 | + <para> |
| 2683 | + If a driver advertises render node support, DRM core will create a |
| 2684 | + separate render node called <term>renderD<num></term>. There will |
| 2685 | + be one render node per device. No ioctls except PRIME-related ioctls |
| 2686 | + will be allowed on this node. Especially <term>GEM_OPEN</term> will be |
| 2687 | + explicitly prohibited. Render nodes are designed to avoid the |
| 2688 | + buffer-leaks, which occur if clients guess the flink names or mmap |
| 2689 | + offsets on the legacy interface. Additionally to this basic interface, |
| 2690 | + drivers must mark their driver-dependent render-only ioctls as |
| 2691 | + <term>DRM_RENDER_ALLOW</term> so render clients can use them. Driver |
| 2692 | + authors must be careful not to allow any privileged ioctls on render |
| 2693 | + nodes. |
| 2694 | + </para> |
| 2695 | + <para> |
| 2696 | + With render nodes, user-space can now control access to the render node |
| 2697 | + via basic file-system access-modes. A running graphics server which |
| 2698 | + authenticates clients on the privileged primary/legacy node is no longer |
| 2699 | + required. Instead, a client can open the render node and is immediately |
| 2700 | + granted GPU access. Communication between clients (or servers) is done |
| 2701 | + via PRIME. FLINK from render node to legacy node is not supported. New |
| 2702 | + clients must not use the insecure FLINK interface. |
| 2703 | + </para> |
| 2704 | + <para> |
| 2705 | + Besides dropping all modeset/global ioctls, render nodes also drop the |
| 2706 | + DRM-Master concept. There is no reason to associate render clients with |
| 2707 | + a DRM-Master as they are independent of any graphics server. Besides, |
| 2708 | + they must work without any running master, anyway. |
| 2709 | + Drivers must be able to run without a master object if they support |
| 2710 | + render nodes. If, on the other hand, a driver requires shared state |
| 2711 | + between clients which is visible to user-space and accessible beyond |
| 2712 | + open-file boundaries, they cannot support render nodes. |
| 2713 | + </para> |
| 2714 | + </sect1> |
| 2715 | + |
2660 | 2716 | <!-- External: vblank handling --> |
2661 | 2717 |
|
2662 | 2718 | <sect1> |
|
0 commit comments