Direct rendering manager
The Direct Rendering Manager ( DRM for short ) is a hardware-specific kernel module ( driver ) that grants access to the memory ( DMA , AGP ) of the graphics card even without an X server such as X.org server . In addition, the DRM ensures that the defined security rules are adhered to and access to the hardware is managed. DRM is part of the Direct Rendering Infrastructure (DRI).
What does the DRM
The DRM supports the DRI in three ways:
- Since there are always several instances of the DRI "fighting" over direct access to the (graphics) hardware, it is important to manage and synchronize this access. Otherwise situations could arise in which two direct rendering instances attempt to access the hardware resources at the same time. This could lead to unwanted results.
The DRM provides "lock-per-hardware" for this. - The DRM provides a mechanism for accessing the memory that is similar to
/dev/mem
and thus contributes to security. Because the X server normally runs underroot
, while this does not apply to the client instances. In addition, direct access is not wanted at all (see also first point). However, this access is restricted in three points:- An instance is only granted access to the mechanisms if the instance is connected to the X server (
xauth
). - A direct rendering instance can only access the memory if it has access to
/dev/drm?
. The access rights can only beroot
changed by (this is generally done via the X server configuration file). - In addition, such a DRI instance can only access the memory if the server allows it. The server can also only allow read access.
- An instance is only granted access to the mechanisms if the instance is connected to the X server (
- The DRM manages the graphics memory via Graphics Execution Manager (GEM) or TTM
- In addition, the DRM provides a generic access option for DMA .
libdrm
libdrm | |
---|---|
Basic data
|
|
Current version | 2.4.89 (December 18, 2017) |
operating system | Linux |
programming language | C. |
License | GNU General Public License , MIT License |
dri.freedesktop.org/wiki/DRM/ |
development
Just like the Direct Rendering Infrastructure itself, its components are also subject to constant further development.
- Linux kernel version 3.11 from September 2, 2013 included major changes to the DRM.
- In the Linux kernel 3.12
- was recorded freedreno
- the graphic functions of the DRM and the KMS (kernel mode setting), see mode setting , have been separated
- An experimental implementation of "Render Nodes" has been integrated into the Direct Rendering Manager.
The new render nodes allow applications to access graphics units, even several, via more than one node in the Linux kernel. Previously, only one application, such as the display server , was allowed to run KMS, and only with root rights. Render nodes provide an API that userspace can use to execute non-privileged GPU commands, for example for GPGPU .
See also
- Mesa 3D - programming library, which not only implements APIs (OpenGL, OpenVG, etc.), but also the userspace part of the available free graphics drivers
Web links
Individual evidence
- ↑ A deeper look into GPUs and the Linux Graphics Stack , p. 25.
- ↑ [ANNOUNCE] libdrm 2.4.89. Retrieved January 31, 2018 .
- ↑ DRM Changes In Linux 3.11 Might Be The Biggest Ever. June 30, 2013, accessed November 4, 2013 .
- ↑ Pull-Request for the mainline Linux kernel 3.12. Retrieved October 2, 2013 .
- ↑ Linux Kernel 3.12: Render more efficiently with separate DRM and KMS. Golem.de , October 25, 2013, accessed on October 26, 2013 .
- ↑ drm: implement experimental render nodes. Retrieved November 4, 2013 .
- ↑ drm / i915: Support render nodes. Retrieved November 4, 2013 .
- ↑ drm / radeon: Support render nodes. Retrieved November 4, 2013 .
- ↑ drm / nouveau: Support render nodes. Retrieved November 4, 2013 .