1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 3. Userland interfaces</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux DRM Developer's Guide"><link rel="up" href="drmCore.html" title="Part I. DRM Core"><link rel="prev" href="ch02s09.html" title="Legacy Support Code"><link rel="next" href="ch03s02.html" title="VBlank event handling"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Userland interfaces</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s09.html">Prev</a> </td><th width="60%" align="center">Part I. DRM Core</th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="drmExternals"></a>Chapter 3. Userland interfaces</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="drmExternals.html#idp1127670396">Render nodes</a></span></dt><dt><span class="sect1"><a href="ch03s02.html">VBlank event handling</a></span></dt></dl></div><p> 2 The DRM core exports several interfaces to applications, 3 generally intended to be used through corresponding libdrm 4 wrapper functions. In addition, drivers export device-specific 5 interfaces for use by userspace drivers & device-aware 6 applications through ioctls and sysfs files. 7 </p><p> 8 External interfaces include: memory mapping, context management, 9 DMA operations, AGP management, vblank control, fence 10 management, memory management, and output management. 11 </p><p> 12 Cover generic ioctls and sysfs layout here. We only need high-level 13 info, since man pages should cover the rest. 14 </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1127670396"></a>Render nodes</h2></div></div></div><p> 15 DRM core provides multiple character-devices for user-space to use. 16 Depending on which device is opened, user-space can perform a different 17 set of operations (mainly ioctls). The primary node is always created 18 and called card<num>. Additionally, a currently 19 unused control node, called controlD<num> is also 20 created. The primary node provides all legacy operations and 21 historically was the only interface used by userspace. With KMS, the 22 control node was introduced. However, the planned KMS control interface 23 has never been written and so the control node stays unused to date. 24 </p><p> 25 With the increased use of offscreen renderers and GPGPU applications, 26 clients no longer require running compositors or graphics servers to 27 make use of a GPU. But the DRM API required unprivileged clients to 28 authenticate to a DRM-Master prior to getting GPU access. To avoid this 29 step and to grant clients GPU access without authenticating, render 30 nodes were introduced. Render nodes solely serve render clients, that 31 is, no modesetting or privileged ioctls can be issued on render nodes. 32 Only non-global rendering commands are allowed. If a driver supports 33 render nodes, it must advertise it via the DRIVER_RENDER 34 DRM driver capability. If not supported, the primary node must be used 35 for render clients together with the legacy drmAuth authentication 36 procedure. 37 </p><p> 38 If a driver advertises render node support, DRM core will create a 39 separate render node called renderD<num>. There will 40 be one render node per device. No ioctls except PRIME-related ioctls 41 will be allowed on this node. Especially GEM_OPEN will be 42 explicitly prohibited. Render nodes are designed to avoid the 43 buffer-leaks, which occur if clients guess the flink names or mmap 44 offsets on the legacy interface. Additionally to this basic interface, 45 drivers must mark their driver-dependent render-only ioctls as 46 DRM_RENDER_ALLOW so render clients can use them. Driver 47 authors must be careful not to allow any privileged ioctls on render 48 nodes. 49 </p><p> 50 With render nodes, user-space can now control access to the render node 51 via basic file-system access-modes. A running graphics server which 52 authenticates clients on the privileged primary/legacy node is no longer 53 required. Instead, a client can open the render node and is immediately 54 granted GPU access. Communication between clients (or servers) is done 55 via PRIME. FLINK from render node to legacy node is not supported. New 56 clients must not use the insecure FLINK interface. 57 </p><p> 58 Besides dropping all modeset/global ioctls, render nodes also drop the 59 DRM-Master concept. There is no reason to associate render clients with 60 a DRM-Master as they are independent of any graphics server. Besides, 61 they must work without any running master, anyway. 62 Drivers must be able to run without a master object if they support 63 render nodes. If, on the other hand, a driver requires shared state 64 between clients which is visible to user-space and accessible beyond 65 open-file boundaries, they cannot support render nodes. 66 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="drmCore.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Legacy Support Code </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> VBlank event handling</td></tr></table></div></body></html> 67