Direct Rendering Manager
Original author(s) | kernel.org & freedesktop.org |
---|---|
Developer(s) | kernel.org & freedesktop.org |
Written in | C |
Type | |
License | |
Website | dri |
The Direct Rendering Manager (DRM) is a subsystem of the
.User-space programs can use the DRM API to command the GPU to do
Overview
The
The Direct Rendering Manager was created to allow multiple programs to use video hardware resources cooperatively.[4] The DRM gets exclusive access to the GPU and is responsible for initializing and maintaining the command queue, memory, and any other hardware resource. Programs wishing to use the GPU send requests to DRM, which acts as an arbitrator and takes care to avoid possible conflicts.
The scope of DRM has been expanded over the years to cover more functionality previously handled by user-space programs, such as framebuffer managing and
The trend to include two GPUs in a computer—a discrete GPU and an integrated one—led to new problems such as GPU switching that also needed to be solved at the DRM layer. In order to match the Nvidia Optimus technology, DRM was provided with GPU offloading abilities, called PRIME.[7]
Software architecture

The Direct Rendering Manager resides in
A

DRM consists of two parts: a generic "DRM core" and a specific one ("DRM driver") for each type of supported hardware.[11] DRM core provides the basic framework where different DRM drivers can register and also provides to user space a minimal set of ioctls with common, hardware-independent functionality.[8] A DRM driver, on the other hand, implements the hardware-dependent part of the API, specific to the type of GPU it supports; it should provide the implementation of the remaining ioctls not covered by DRM core, but it may also extend the API, offering additional ioctls with extra functionality only available on such hardware.[8] When a specific DRM driver provides an enhanced API, user-space libdrm is also extended by an extra library libdrm-driver that can be used by user space to interface with the additional ioctls.
API
The DRM core exports several interfaces to user-space applications, generally intended to be used through corresponding libdrm
wrapper functions. In addition, drivers export device-specific interfaces for use by user-space drivers and device-aware applications through ioctls and sysfs files. External interfaces include: memory mapping, context management, DMA operations, AGP management, vblank control, fence management, memory management, and output management.
DRM-Master and DRM-Auth
There are several operations (ioctls) in the DRM API that either for security purposes or for concurrency issues must be restricted to be used by a single user-space process per device.
The
For the remaining user-space processes there is another way to gain the privilege to invoke some restricted operations on the DRM device called DRM-Auth. It is basically a method of authentication against the DRM device, in order to prove to it that the process has the DRM-Master's approval to get such privileges. The procedure consists of:[12]: 13
- The client gets a unique token—a 32-bit integer—from the DRM device using the GET_MAGIC ioctl and passes it to the DRM-Master process by whatever means (normally some sort of DRI2 there is a DRI2Authenticate request that any X client can send to the X Server.[13])
- The DRM-Master process, in turn, sends back the token to the DRM device by invoking the AUTH_MAGIC ioctl.
- The device grants special rights to the process file handle whose auth token matches the received token from the DRM-Master.
Graphics Execution Manager
Due to the increasing size of
GEM provides an API with explicit memory management primitives.[6] Through GEM, a user-space program can create, handle and destroy memory objects living in the GPU video memory. These objects, called "GEM objects",[14] are persistent from the user-space program's perspective and don't need to be reloaded every time the program regains control of the GPU. When a user-space program needs a chunk of video memory (to store a framebuffer, texture or any other data required by the GPU[15]), it requests the allocation to the DRM driver using the GEM API. The DRM driver keeps track of the used video memory and is able to comply with the request if there is free memory available, returning a "handle" to user space to further refer the allocated memory in coming operations.[6][14] GEM API also provides operations to populate the buffer and to release it when it is not needed anymore. Memory from unreleased GEM handles gets recovered when the user-space process closes the DRM device file descriptor—intentionally or because it terminates.[16]
GEM also allows two or more user-space processes using the same DRM device (hence the same DRM driver) to share a GEM object.[16] GEM handles are local 32-bit integers unique to a process but repeatable in other processes, therefore not suitable for sharing. What is needed is a global namespace, and GEM provides one through the use of global handles called GEM names. A GEM name refers to one, and only one, GEM object created within the same DRM device by the same DRM driver, by using a unique 32-bit integer. GEM provides an operation flink to obtain a GEM name from a GEM handle.[16][12]: 16 The process can then pass this GEM name (32-bit integer) to another process using any IPC mechanism available.[12]: 15 The GEM name can be used by the recipient process to obtain a local GEM handle pointing to the original GEM object.
Unfortunately, the use of GEM names to share buffers is not secure.
Another important task for any video-memory management system besides managing the video-memory space is handling the memory synchronization between the GPU and the CPU. Current memory architectures are very complex and usually involve various levels of caches for the system memory and sometimes for the video memory too. Therefore, video-memory managers should also handle the cache coherence to ensure the data shared between CPU and GPU is consistent.[20] This means that often video-memory management internals are highly dependent on hardware details of the GPU and memory architecture, and thus driver-specific.[21]
GEM was initially developed by
The GEM API also provides ioctls for control of the execution flow (command buffers), but they are Intel-specific, to be used with Intel i915 and later GPUs.[6] No other DRM driver has attempted to implement any part of the GEM API beyond the memory-management specific ioctls.
Translation Table Maps
Translation Table Maps (TTM) is the name of the generic memory manager for GPUs that was developed before GEM.
The main concept of TTM are the "buffer objects", regions of video memory that at some point must be addressable by the GPU.[5] When a user-space graphics application wants access to a certain buffer object (usually to fill it with content), TTM may require relocating it to a type of memory addressable by the CPU. Further relocations—or GART mapping operations—could happen when the GPU needs access to a buffer object but it isn't in the GPU's address space yet. Each of these relocation operations must handle any related data and cache-coherency issues.[5]
Another important TTM concept is fences. Fences are essentially a mechanism to manage concurrency between the CPU and the GPU.[24] A fence tracks when a buffer object is no longer used by the GPU, generally to notify any user-space process with access to it.[5]
The fact that TTM tried to manage all kind of memory architectures, including those with and without a dedicated VRAM, in a suitable way, and to provide every conceivable feature in a memory manager for use with any type of hardware, led to an overly complex solution with an API far larger than needed.[24][14] Some DRM developers thought that it wouldn't fit well with any specific driver, especially the API. When GEM emerged as a simpler memory manager, its API was preferred over the TTM one. But some driver developers considered that the approach taken by TTM was more suitable for discrete video cards with dedicated video memory and IOMMUs, so they decided to use TTM internally, while exposing their buffer objects as GEM objects and thus supporting the GEM API.[23] Examples of current drivers using TTM as an internal memory manager but providing a GEM API are the radeon driver for AMD video cards and the nouveau driver for NVIDIA video cards.
DMA Buffer Sharing and PRIME
The DMA Buffer Sharing API (often abbreviated as DMA-BUF) is a
This feature was exploited for the first time in DRM to implement PRIME, a solution for GPU offloading that uses DMA-BUF to share the resulting framebuffers between the DRM drivers of the discrete and the integrated GPU.[27]: 13 An important feature of DMA-BUF is that a shared buffer is presented to user space as a file descriptor.[14][12]: 17 For the development of PRIME two new ioctls were added to the DRM API, one to convert a local GEM handle to a DMA-BUF file descriptor and another for the exact opposite operation.
These two new ioctls were later reused as a way to fix the inherent unsafety of GEM buffer sharing.
Kernel Mode Setting

In order to work properly, a video card or graphics adapter must set a
In early days, the user space programs that wanted to use the graphical framebuffer were also responsible for providing the mode-setting operations,
However, this was not the only code doing mode-setting in a
The user space mode setting approach also caused other issues:[43][42]
- The suspend/resume process has to rely on user space tools to restore the previous mode. One single failure or crash of one of these programs could leave the system without a working display due to a modeset misconfiguration, and therefore unusable.
- It was also impossible for the kernel to show error or debug messages when the screen was in a graphics mode—for example when X was running—since the only modes the kernel knew about were the VESA BIOS standard text modes.
- A more pressing issue was the proliferation of graphical applications bypassing the X Server and the emergence of other graphics stack alternatives to X, extending the duplication of mode-setting code across the system even further.
To address these problems, the mode-setting code was moved to a single place inside the kernel, specifically to the existing DRM module.[36][37][44][42][43] Then, every process—including the X Server—should be able to command the kernel to perform mode-setting operations, and the kernel would ensure that concurrent operations don't result in an inconsistent state. The new kernel API and code added to the DRM module to perform these mode-setting operations was called Kernel Mode-Setting (KMS).[30]
Kernel Mode-Setting provides several benefits. The most immediate is of course the removal of duplicate mode-setting code, from both the kernel (Linux console, fbdev) and user space (X Server DDX drivers). KMS also makes it easier to write alternative graphics systems, which now don't need to implement their own mode-setting code.[42][43] By providing centralized mode management, KMS solves the flickering issues while changing between console and X, and also between different instances of X (fast user switching).[41][44] Since it is available in the kernel, it can also be used at the beginning of the boot process, saving flickering due to mode changes in these early stages.
The fact that KMS is part of the kernel allows it to use resources only available at kernel space such as
To avoid breaking backwards compatibility of the DRM API, Kernel Mode-Setting is provided as an additional driver feature of certain DRM drivers.[46] Any DRM driver can choose to provide the DRIVER_MODESET flag when it registers with the DRM core to indicate that supports the KMS API.[8] Those drivers that implement Kernel Mode-Setting are often called KMS drivers as a way to differentiate them from the legacy—without KMS—DRM drivers.
KMS has been adopted to such an extent that certain drivers which lack 3D acceleration (or for which the hardware vendor doesn't want to expose or implement it) nevertheless implement the KMS API without the rest of the DRM API, allowing display servers (like Wayland) to run with ease.[47][48]
KMS device model
KMS models and manages the output devices as a series of abstract hardware blocks commonly found on the display output pipeline of a
- CRTCs: each CRTC (from video mode timing signal with the help of a PLL circuit.[51] The number of CRTCs available determines how many independent output devices the hardware can handle at the same time, so in order to use multi-head configurations at least one CRTC per display device is required.[49] Two—or more—CRTCs can also work in clone mode if they scan out from the same framebuffer to send the same image to several output devices.[51][50]
- Connectors: a connector represents where the display controller sends the video signal from a scanout operation to be displayed. Usually, the KMS concept of a connector corresponds to a physical connector (VGA, DVI, FPD-Link, HDMI, DisplayPort, S-Video, ...) in the hardware where an output device (monitor, laptop panel, ...) is permanently or can temporarily be attached. Information related to the current physically attached output device—such as connection status, EDID data, DPMS status or supported video modes—is also stored within the connector.[49]
- Encoders: the display controller must encode the video mode timing signal from the CRTC using a format suitable for the intended connector.[49] An encoder represents the hardware block able to do one of these encodings. Examples of encodings—for digital outputs—are TMDS and LVDS; for analog outputs such as VGA and TV out, specific DAC blocks are generally used. A connector can only receive the signal from one encoder at a time,[49] and each type of connector only supports some encodings. There also might be additional physical restrictions by which not every CRTC is connected to every available encoder, limiting the possible combinations of CRTC-encoder-connector.
- Planes: a plane is not a hardware block but a memory object containing a buffer from which a scanout engine (a CRTC) is fed. The plane that holds the framebuffer is called the primary plane, and each CRTC must have one associated,[49] since it is the source for the CRTC to determine the video mode—display resolution (width and height), pixel size, pixel format, refresh rate, etc. A CRTC might have also cursor planes associated to it if the display controller supports hardware cursor overlays, or secondary planes if it's able to scan out from additional hardware overlays and compose or blend "on the fly" the final image sent to the output device.[33]
Atomic Display
In recent years there has been an ongoing effort to bring
This enhanced KMS API is what is called Atomic Display (formerly known as atomic mode-setting and atomic or nuclear pageflip).The purpose of the atomic mode-setting is to ensure a correct change of mode in complex configurations with multiple restrictions, by avoiding intermediate steps which could lead to an inconsistent or invalid video state;[52] it also avoids risky video states when a failed mode-setting process has to be undone ("rollback").[53]: 9 Atomic mode-setting allows one to know beforehand if certain specific mode configuration is appropriate, by providing mode testing capabilities.[52] When an atomic mode is tested and its validity confirmed, it can be applied with a single indivisible (atomic) commit operation. Both test and commit operations are provided by the same new ioctl with different flags.
Atomic page flip on the other hand allows to update multiple planes on the same output (for instance the primary plane, the cursor plane and maybe some overlays or secondary planes) all synchronized within the same VBLANK interval, ensuring a proper display without tearing.[53]: 9,14 [52] This requirement is especially relevant to mobile and embedded display controllers, that tend to use multiple planes/overlays to save power.
The new atomic API is built upon the old KMS API. It uses the same model and objects (CRTCs, encoders, connectors, planes, ...), but with an increasing number of object properties that can be modified.[52] The atomic procedure is based on changing the relevant properties to build the state that we want to test or commit. The properties we want to modify depend on whether we want to do a mode-setting (mostly CRTCs, encoders and connectors properties) or page flipping (usually planes properties). The ioctl is the same for both cases, the difference being the list of properties passed with each one.[54]
Render nodes
In the original DRM API, the DRM device /dev/dri/cardX
is used for both privileged (modesetting, other display control) and non-privileged (rendering,
The "render nodes" concept tries to solve these scenarios by splitting the DRM user space API into two interfaces – one privileged and one non-privileged – and using separate device files (or "nodes") for each one.
Hardware support
The Linux DRM subsystem includes free and open-source drivers to support hardware from the 3 main manufacturers of GPUs for desktop computers (AMD, NVIDIA and Intel), as well as from a growing number of mobile GPU and System on a chip (SoC) integrators. The quality of each driver varies highly, depending on the degree of cooperation by the manufacturer and other matters.
Driver | Since kernel | Supported hardware | Vendor support | Status/Notes |
---|---|---|---|---|
radeon | 2.4.1 | Kaveri APUs.
|
Yes | Active |
i915 | 2.6.9 | Intel HD and Iris Graphics HD Graphics 2000/3000/2500/4000/4200/4400/4600/P4600/P4700/5000, Iris Graphics 5100, Iris Pro Graphics 5200 integrated GPUs.
|
Yes | Active |
nouveau | 2.6.33[58][59] | X1 SoC
|
Partial | Active |
exynos | 3.2[60] | Samsung ARM-based Exynos SoCs | ||
vmwgfx | 3.2 (from staging)[61] | Virtual GPU for the VMware SVGA2 | virtual driver | |
gma500 | 3.3 (from staging)[62][63] | Intel GMA 500 and other Imagination Technologies (PowerVR ) based graphics GPUs
|
experimental 2D KMS-only driver | |
ast | 3.5[64] | ASpeed Technologies 2000 series | experimental | |
mgag200 | 3.5[65] | Matrox MGA-G200 server display engines | KMS-only | |
shmobile | 3.7[66] | Renesas SH Mobile | ||
tegra | 3.8[67] | Nvidia Tegra20, Tegra30 SoCs | Yes | Active |
omapdrm | 3.9[68] | Texas Instruments OMAP5 SoCs | ||
rcar-du | 3.11[69] | Renesas R-Car SoC Display Units | ||
msm | 3.12[70][71] | Qualcomm's Adreno A2xx/A3xx/A4xx GPU families (Snapdragon SOCs)[72] | ||
armada | 3.13[73][74] | Marvell Armada 510 SoCs
|
||
bochs | 3.14[75] | Virtual stdvga) | virtual driver | |
sti | 3.17[76][77] | STMicroelectronics SoC stiH41x series | ||
imx | 3.19 (from staging)[78][79] | Freescale i.MX SoCs
|
||
rockchip | 3.19[78][80] | Rockchip SoC-based GPUs | KMS-only | |
amdgpu[57] | 4.2[81][82] | Bristol & Stoney Ridge APUs.
|
Yes | Active |
virtio | 4.2[84] | Virtual GPU driver for QEMU based virtual machine managers (like KVM or Xen) | virtual driver | |
vc4 | 4.4[85][86][87] | Raspberry Pi's Broadcom BCM2835 and BCM2836 SoCs (VideoCore IV GPU) | ||
etnaviv | 4.5[88][89][90] | Marvell ARMADA and Freescale i.MX6 Series
|
||
sun4i | 4.7[91][92] | Mali-400 GPU)
|
||
kirin | 4.7[93][92] | Mali 450-MP4 GPU)
|
||
mediatek | 4.7[94][92] | MediaTek MT8173 SoC (Imagination PowerVR GX6250 GPU) | ||
hibmc | 4.10[95] | HiSilicon hi1710 iBMC SoC (Silicon Image SM750 GPU core[96] )
|
KMS-only | |
vkms | 4.19[97][98] | Software-only model of a KMS driver that is useful for testing and for running headless machines .
|
virtual driver, experimental | |
lima | 5.2[99][100] | ARM Mali 4xx GPUs
|
||
panfrost | 5.2[101][100] | ARM Mali Txxx (Midgard) and Gxx (Bifrost) GPUs | ||
vboxvideo | 5.2 (from staging)[102][100] | Virtual GPU driver for VirtualBox (VBoxVGA GPU) | virtual driver | |
hyperv_drm | 5.14[103][104] | Virtual GPU driver for Hyper-V synthetic video device | virtual driver | |
simpledrm | 5.14[105][106] | GPU Driver for firmware-provided framebuffers ( UEFI GOP, VESA BIOS Extensions, embedded systems )
|
||
ofdrm | 6.2[107][108] | GPU Driver for Open Firmware framebuffers | ||
loongson | 6.6[109][110] | GPU Driver for Loongson GPUs and SoCs | ||
powervr | 6.8[111][112] | Imagination Technologies PowerVR (Series 6 and later) & IMG Graphics GPUs | ||
xe | 6.8[113][114] | Intel Xe series GPUs (Gen12 integrated GPUs, Intel Arc discrete GPUs) | Yes | experimental |
There is also a number of drivers for old, obsolete hardware detailed in the next table for historical purposes.
Driver | Since kernel | Supported hardware | Status/Notes |
---|---|---|---|
gamma | 2.3.18 | 3Dlabs GLINT GMX 2000 | Removed since 2.6.14[115] |
ffb | 2.4 | Creator/Creator3D (used by Ultra workstations)
|
Removed since 2.6.21[116] |
tdfx | 2.4 | 3dfx Banshee/Voodoo3 +
|
Removed since 6.3[117] |
mga | 2.4 | Matrox G200/G400/G450 | Removed since 6.3[118] |
r128 | 2.4 | ATI Rage 128
|
Removed since 6.3[119] |
i810 | 2.4 | Intel i810
|
Removed since 6.3[120] |
sis | 2.4.17 | SiS 300/630/540 | Removed since 6.3[121] |
i830 | 2.4.20 | Intel 830M/845G/852GM/855GM/865G | Removed since 2.6.39[122] (replaced by i915 driver) |
via | 2.6.13[123] | Unichrome / Unichrome Pro
|
Removed since 6.3[124] |
savage | 2.6.14[125] | S3 Graphics Savage 3D/MX/IX/4/SuperSavage/Pro/Twister | Removed since 6.3[126] |
Development
The Direct Rendering Manager is developed within the
For historical reasons, the source code of the libdrm library is maintained under the umbrella of the Mesa project.[128]
History
In 1999, while developing
The split of DRM into two components, DRM core and DRM driver, called DRM core/personality split was done during the second half of 2004,[11][132] and merged into kernel version 2.6.11.[133] This split allowed multiple DRM drivers for multiple devices to work simultaneously, opening the way to multi-GPU support.
The idea of putting all the video mode setting code in one place inside the kernel had been acknowledged for years,[134][135] but the graphics card manufacturers had argued that the only way to do the mode-setting was to use the routines provided by themselves and contained in the Video BIOS of each graphics card. Such code had to be executed using x86 real mode, which prevented it from being invoked by a kernel running in protected mode.[44] The situation changed when Luc Verhaegen and other developers found a way to do the mode-setting natively instead of BIOS-based,[136][44] showing that it was possible to do it using normal kernel code and laying the groundwork for what would become Kernel Mode Setting. In May 2007 Jesse Barnes (Intel) published the first proposal for a drm-modesetting API and a working native implementation of mode-setting for Intel GPUs within the i915 DRM driver.[42] In December 2007 Jerome Glisse started to add the native mode-setting code for ATI cards to the radeon DRM driver.[137][138] Work on both the API and drivers continued during 2008, but got delayed by the necessity of a memory manager also in kernel space to handle the framebuffers.[139]
In October 2008 the Linux kernel 2.6.27 brought a major source code reorganization, prior to some significant upcoming changes. The DRM source code tree was moved to its own source directory /drivers/gpu/drm/
and the different drivers were moved into their own subdirectories. Headers were also moved into a new /include/drm
directory.[140]
The increasing complexity of video memory management led to several approaches to solving this issue. The first attempt was the Translation Table Maps (TTM) memory manager, developed by Thomas Hellstrom (
With memory management in place to handle buffer objects, DRM developers could finally add to the kernel the already finished API and code to do mode setting. This expanded API is what is called Kernel Mode-setting (KMS) and the drivers which implement it are often referred to as KMS drivers. In March 2009, KMS was merged into the Linux kernel version 2.6.29,[30][143] along with KMS support for the i915 driver.[144] The KMS API has been exposed to user space programs since libdrm 2.4.3.[145] The userspace X.Org DDX driver for Intel graphics cards was also the first to use the new GEM and KMS APIs.[146] KMS support for the radeon DRM driver was added to Linux 2.6.31 release of September 2009.[147][148][149] The new radeon KMS driver used the TTM memory manager but exposed GEM-compatible interfaces and ioctls instead of TTM ones.[23]
Since 2006 the
The new KMS API—including the GEM API—was a big milestone in the development of DRM, but it didn't stop the API from being enhanced in the following years. KMS gained support for
An early proof of concept to provide GPU offloading between DRM drivers was developed by Dave Airlie in 2010.
In recent years, the DRM API has incrementally expanded with new and improved features. In 2013, as part of GSoC, David Herrmann developed the multiple render nodes feature.[55] His code was added to the Linux kernel version 3.12 as an experimental feature[173][174] supported by i915,[175] radeon[176] and nouveau[177] drivers, and enabled by default since Linux 3.17.[77] In 2014 Matt Roper (Intel) developed the universal planes (or unified planes) concept by which framebuffers (primary planes), overlays (secondary planes) and cursors (cursor planes) are all treated as a single type of object with an unified API.[178] Universal planes support provides a more consistent DRM API with fewer, more generic ioctls.[33] In order to maintain the API backwards compatible, the feature is exposed by DRM core as an additional capability that a DRM driver can provide. Universal plane support debuted in Linux 3.15[179] and libdrm 2.4.55.[180] Several drivers, such as the Intel i915,[181] have already implemented it.
The most recent DRM API enhancement is the atomic mode-setting API, which brings
Adoption
The Direct Rendering Manager kernel subsystem was initially developed to be used with the new
In 2015, version 358.09 (beta) of the proprietary
nvidia-modeset.ko
. This new driver component works in conjunction with the nvidia.ko
kernel module to program the display engine (i.e. display controller) of the GPU.[197]See also
References
- ^ "Linux kernel/drivers/gpu/drm/README.drm". kernel.org. Archived from the original on 2014-02-26. Retrieved 2014-02-26.
- ^ a b Uytterhoeven, Geert. "The Frame Buffer Device". Kernel.org. Retrieved 28 January 2015.
- ^ a b c White, Thomas. "How DRI and DRM Work". Retrieved 22 July 2014.
- ^ Faith, Rickard E. (11 May 1999). "The Direct Rendering Manager: Kernel Support for the Direct Rendering Infrastructure". Archived from the original on 24 May 2016. Retrieved 12 May 2016.
- ^ a b c d e f g h Corbet, Jonathan (6 November 2007). "Memory management for graphics processors". LWN.net. Retrieved 23 July 2014.
- ^ a b c d e f g Packard, Keith; Anholt, Eric (13 May 2008). "GEM - the Graphics Execution Manager". dri-devel mailing list. Retrieved 23 July 2014.
- ^ a b c Airlie, Dave (12 March 2010). "GPU offloading - PRIME - proof of concept". Archived from the original on 10 February 2015. Retrieved 10 February 2015.
- ^ a b c d e Kitching, Simon. "DRM and KMS kernel modules". Retrieved 13 May 2016.
- ^ a b c d e Herrmann, David (1 September 2013). "Splitting DRM and KMS device nodes". Retrieved 23 July 2014.
- ^ "README.rst - mesa/drm - Direct Rendering Manager headers and kernel modules". 2020-03-21. Archived from the original on 2020-03-21.
- ^ a b Airlie, Dave (4 September 2004). "New proposed DRM interface design". dri-devel (Mailing list).
- ^ a b c d e f g Peres, Martin; Ravier, Timothée (2 February 2013). "DRI-next/DRM2: A walkthrough the Linux Graphics stack and its security" (PDF). Retrieved 13 May 2016.
- ^ Høgsberg, Kristian (4 September 2008). "The DRI2 Extension - Version 2.0". X.Org. Retrieved 23 May 2016.
- ^ a b c d e f Barnes, Jesse; Pinchart, Laurent; Vetter, Daniel; Wunner, Lukas. "Linux GPU Driver Developer's Guide - Memory management". Retrieved 31 August 2016.
- ^ Vetter, Daniel. "i915/GEM Crashcourse by Daniel Vetter". Intel Open Source Technology Center. Retrieved 31 January 2015.
GEM essentially deals with graphics buffer objects (which can contain textures, renderbuffers, shaders, or all kinds of other state objects and data used by the gpu)
- ^ a b c Vetter, Daniel (4 May 2011). "GEM Overview". Retrieved 13 February 2015.
- ^ Packard, Keith (28 September 2012). "Thoughts about DRI.Next". Retrieved 26 May 2016.
GEM flink has lots of issues. The flink names are global, allowing anyone with access to the device to access the flink data contents.
- ^ a b Herrmann, David (2 July 2013). "DRM Security". The 2013 X.Org Developer's Conference (XDC2013) Proceedings. Retrieved 13 February 2015.
gem-flink doesn't provide any private namespaces to applications and servers. Instead, only one global namespace is provided per DRM node. Malicious authenticated applications can attack other clients via brute-force "name-guessing" of gem buffers
- ^ Kerrisk, Michael (25 September 2012). "XDC2012: Graphics stack security". LWN.net. Retrieved 25 November 2015.
- ^ a b Packard, Keith (4 July 2008). "gem update". Retrieved 25 April 2016.
- ^ "drm-memory man page". Ubuntu manuals. Retrieved 29 January 2015.
Many modern high-end GPUs come with their own memory managers. They even include several different caches that need to be synchronized during access. [...] . Therefore, memory management on GPUs is highly driver- and hardware-dependent.
- ^ "Intel Graphics Media Accelerator Developer's Guide". Intel Corporation. Retrieved 24 November 2015.
- ^ a b c Larabel, Michael (26 August 2008). "A GEM-ified TTM Manager For Radeon". Phoronix. Retrieved 24 April 2016.
- ^ a b c Corbet, Jonathan (28 May 2008). "GEM v. TTM". LWN.net. Retrieved 10 February 2015.
- ^ Corbet, Jonathan (11 January 2012). "DMA buffer sharing in 3.3". LWN.net. Retrieved 14 May 2016.
- ^ Clark, Rob; Semwal, Sumit. "DMA Buffer Sharing Framework: An Introduction" (PDF). Retrieved 14 May 2016.
- ^ Peres, Martin (26 September 2014). "The Linux graphics stack, Optimus and the Nouveau driver" (PDF). Retrieved 14 May 2016.
- ^ Pinchart, Laurent (20 February 2013). "Anatomy of an Embedded KMS Driver" (PDF). Retrieved 27 June 2016.
- ^ Edge, Jake (9 October 2013). "DRI3 and Present". LWN.net. Retrieved 28 May 2016.
- ^ a b c d "Linux 2.6.29 - Kernel Modesetting". Linux Kernel Newbies. Retrieved 19 November 2015.
- ^ "VGA Hardware". OSDev.org. Retrieved 23 November 2015.
- ^ Rathmann, B. (15 February 2008). "The state of Nouveau, part I". LWN.net. Retrieved 23 November 2015.
Graphics cards are programmed in numerous ways, but most initialization and mode setting is done via memory-mapped IO. This is just a set of registers accessible to the CPU via its standard memory address space. The registers in this address space are split up into ranges dealing with various features of the graphics card such as mode setup, output control, or clock configuration.
- ^ a b c d e Paalanen, Pekka (5 June 2014). "From pre-history to beyond the global thermonuclear war". Retrieved 29 July 2014.
- ^ "drm-kms man page". Ubuntu manuals. Retrieved 19 November 2015.
- ^ Corbet, Jonathan (13 January 2010). "The end of user-space mode setting?". LWN.net. Retrieved 20 November 2015.
- ^ a b "Mode Setting Design Discussion". X.Org Wiki. Retrieved 19 November 2015.
- ^ a b Corbet, Jonathan (22 January 2007). "LCA: Updates on the X Window System". LWN.net. Retrieved 23 November 2015.
- ^ "XF86VIDMODE manual page". X.Org. Retrieved 23 April 2016.
- ^ "X11R6.1 Release Notes". X.Org. 14 March 1996. Retrieved 23 April 2016.
- ^ Corbet, Jonathan (20 July 2004). "Kernel Summit: Video Drivers". LWN.net. Retrieved 23 November 2015.
- ^ a b "Fedora - Features/KernelModeSetting". Fedora Project. Retrieved 20 November 2015.
Historically, the X server was responsible for saving output state when it started up, and then restoring it when it switched back to text mode. Fast user switching was accomplished with a VT switch, so switching away from the first user's X server would blink once to go to text mode, then immediately blink again to go to the second user's session.
- ^ a b c d e Barnes, Jesse (17 May 2007). "[RFC] enhancing the kernel's graphics subsystem". linux-kernel (Mailing list).
- ^ a b c "DrmModesetting - Enhancing kernel graphics". DRI Wiki. Retrieved 23 November 2015.
- ^ a b c d e Packard, Keith (16 September 2007). "kernel-mode-drivers". Retrieved 30 April 2016.
- ^ a b Packard, Keith (24 April 2000). "Sharpening the Intel Driver Focus". Retrieved 23 May 2016.
A more subtle limitation is that the driver couldn't handle interrupts, so there wasn't any hot-plug monitor support.
- ^ Barnes, Jesse; Pinchart, Laurent; Vetter, Daniel; Wunner, Lukas. "Linux GPU Driver Developer's Guide - Driver Initialization". Retrieved 31 August 2016.
- ^ "q3k (@[email protected])". Warsaw Hackerspace Social Club. 2023-01-31. Retrieved 2023-02-13.
DRM/KMS driver fully working now, although still without DMA. Oh, and it's written in Rust, although it's mostly just full of raw unsafe blocks.
- ^ "q3k (@[email protected])". Warsaw Hackerspace Social Club. 2023-01-31. Retrieved 2023-02-13.
Cool thing is, since we have a 'normal' DRM/KMS driver (and help from @[email protected]) we can just do things like... run Wayland! Weston on an iPod Nano 5G.
- ^ a b c d e f g Barnes, Jesse; Pinchart, Laurent; Vetter, Daniel; Wunner, Lukas. "Linux GPU Driver Developer's Guide - KMS Initialization and Cleanup". Retrieved 31 August 2016.
- ^ a b "Video Cards". X.Org Wiki. Retrieved 11 April 2016.
- ^ a b Deucher, Alex (15 April 2010). "Notes about radeon display hardware". Archived from the original on 5 April 2016. Retrieved 8 April 2016.
- ^ a b c d e Vetter, Daniel (5 August 2015). "Atomic mode setting design overview, part 1". LWN.net. Retrieved 7 May 2016.
- ^ a b Reding, Thierry (1 February 2015). "Atomic Mode-Setting" (PDF). FOSDEM Archives. Retrieved 7 May 2016.
- ^ Vetter, Daniel (12 August 2015). "Atomic mode setting design overview, part 2". LWN.net. Retrieved 7 May 2016.
- ^ a b c Herrmann, David (29 May 2013). "DRM Render- and Modeset-Nodes". Retrieved 21 July 2014.
- ^ a b c d Barnes, Jesse; Pinchart, Laurent; Vetter, Daniel; Wunner, Lukas. "Linux GPU Driver Developer's Guide - Render nodes". Retrieved 31 August 2016.
- ^ a b Deucher, Alex (20 April 2015). "Initial amdgpu driver release". dri-devel (Mailing list).
- ^ a b "Linux 2.6.33 - Nouveau, a driver for Nvidia graphic cards". Linux Kernel Newbies. Retrieved 26 April 2016.
- ^ a b "drm/nouveau: Add DRM driver for NVIDIA GPUs". Kernel.org. Retrieved 27 January 2015.
- ^ "DRM: add DRM Driver for Samsung SoC EXYNOS4210". Kernel.org. Retrieved 3 March 2016.
- ^ "vmwgfx: Take the driver out of staging". Kernel.org. Retrieved 3 March 2016.
- ^ "Linux 3.3 - DriverArch - Graphics". Linux Kernel Newbies. Retrieved 3 March 2016.
- ^ Larabel, Michael (10 January 2012). "The Linux 3.3 DRM Pull Is Heavy On Enhancements". Phoronix. Retrieved 3 March 2016.
- ^ "drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)". Kernel.org. Retrieved 3 March 2016.
- ^ Airlie, Dave (17 May 2012). "mgag200: initial g200se driver (v2)". Retrieved 24 January 2018.
- ^ "drm: Renesas SH Mobile DRM driver". Kernel.org. Retrieved 3 March 2016.
- ^ "drm: Add NVIDIA Tegra20 support". Kernel.org. Retrieved 3 March 2016.
- ^ "drm/omap: move out of staging". Kernel.org. Retrieved 3 March 2016.
- ^ "drm: Renesas R-Car Display Unit DRM driver". Kernel.org. Retrieved 3 March 2016.
- ^ "drm/msm: basic KMS driver for snapdragon". Kernel.org. Retrieved 3 March 2016.
- ^ Larabel, Michael (28 August 2013). "Snapdragon DRM/KMS Driver Merged For Linux 3.12". Phoronix. Retrieved 26 January 2015.
- ^ Edge, Jake (8 April 2015). "An update on the freedreno graphics driver". LWN.net. Retrieved 23 April 2015.
- ^ King, Russell (18 October 2013). "[GIT PULL] Armada DRM support". dri-devel (Mailing list).
- ^ "DRM: Armada: Add Armada DRM driver". Kernel.org. Retrieved 3 March 2016.
- ^ "drm/bochs: new driver". Kernel.org. Retrieved 3 March 2016.
- ^ Larabel, Michael (8 August 2014). "Linux 3.17 DRM Pull Brings New Graphics Driver". Phoronix. Retrieved 3 March 2016.
- ^ a b Corbet, Jonathan (13 August 2014). "3.17 merge window, part 2". LWN.net. Retrieved 7 October 2014.
- ^ a b Corbet, Jonathan (17 December 2014). "3.19 Merge window part 2". LWN.net. Retrieved 9 February 2015.
- ^ "drm: imx: Move imx-drm driver out of staging". Kernel.org. Retrieved 9 February 2015.
- ^ "drm: rockchip: Add basic drm driver". Kernel.org. Retrieved 3 March 2016.
- ^ Larabel, Michael (25 June 2015). "Linux 4.2 DRM Updates: Lots Of AMD Attention, No Nouveau Driver Changes". Phoronix. Retrieved 31 August 2015.
- ^ Corbet, Jonathan (1 July 2015). "4.2 Merge window part 2". LWN.net. Retrieved 31 August 2015.
- ^ Deucher, Alex (3 August 2015). "[PATCH 00/11] Add Fiji Support". dri-devel (Mailing list).
- ^ "Add virtio gpu driver". Kernel.org. Retrieved 3 March 2016.
- ^ Corbet, Jonathan (11 November 2015). "4.4 Merge window, part 1". LWN.net. Retrieved 11 January 2016.
- ^ Larabel, Michael (15 November 2015). "A Look At The New Features Of The Linux 4.4 Kernel". Phoronix. Retrieved 11 January 2016.
- ^ "drm/vc4: Add KMS support for Raspberry Pi". Kernel.org.
- ^ Larabel, Michael (24 January 2016). "The Many New Features & Improvements Of The Linux 4.5 Kernel". Phoronix. Retrieved 14 March 2016.
- ^ Corbet, Jonathan (20 January 2016). "4.5 merge window part 2". LWN.Net. Retrieved 14 March 2016.
- ^ "Merge tag 'sun4i-drm-for-4.7'". Kernel.org.
- ^ a b c Airlie, Dave (23 May 2016). "[git pull] drm for v4.7". dri-devel (Mailing list).
- ^ "Merge tag 'drm-hisilicon-next-2016-04-29'". Kernel.org.
- ^ "Merge tag 'mediatek-drm-2016-05-09'". Kernel.org.
- Phoronix. Retrieved 24 January 2018.
- ^ "Huawei FusionServer RH5885 V3 Technical White Paper". 18 November 2016. Archived from the original on 2018-01-25.
uses an onboard display chip that is integrated into the management chip Hi1710 and uses the IP core of the SM750
- ^ "drm/vkms: Introduce basic VKMS driver". git.kernel.org. Retrieved 2022-07-20.
- Phoronix. Retrieved 20 July 2022.
- ^ "kernel/git/torvalds/linux.git - Linux kernel source tree". git.kernel.org. Retrieved 2019-11-28.
- ^ Phoronix. Retrieved 20 July 2022.
- ^ "kernel/git/torvalds/linux.git - Linux kernel source tree". git.kernel.org. Retrieved 2019-11-28.
- ^ "drm/vboxvideo: Move the vboxvideo driver out of staging". git.kernel.org. Retrieved 2022-07-20.
- ^ "drm/hyperv: Add DRM driver for hyperv synthetic video device". git.kernel.org. Retrieved 2021-08-30.
- Phoronix. Retrieved 30 August 2021.
- ^ "drm: Add simpledrm driver". git.kernel.org. Retrieved 2021-08-30.
- Phoronix. Retrieved 30 August 2021.
- ^ "drm/ofdrm: Add ofdrm for Open Firmware framebuffers". git.kernel.org. Retrieved 21 February 2023.
- Phoronix. Retrieved 21 February 2023.
- ^ "drm: Add kms driver for loongson display controller". git.kernel.org. Retrieved 23 February 2024.
- Phoronix. Retrieved 23 February 2024.
- ^ "drm/imagination: Add skeleton PowerVR driver". git.kernel.org. Retrieved 27 May 2024.
- Phoronix. Retrieved 27 May 2024.
- ^ "drm/xe: Introduce a new DRM driver for Intel GPUs". git.kernel.org. Retrieved 27 May 2024.
- Phoronix. Retrieved 27 May 2024.
- ^ "drm: remove the gamma driver". Kernel.org. Retrieved 27 January 2015.
- ^ "[DRM]: Delete sparc64 FFB driver code that never gets built". Kernel.org. Retrieved 27 January 2015.
- ^ "drm: Remove the obsolete driver-tdfx". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: Remove the obsolete driver-mga". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: Remove the obsolete driver-r128". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: Remove the obsolete driver-i810". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: Remove the obsolete driver-sis". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: remove i830 driver". Kernel.org. Retrieved 27 January 2015.
- ^ "drm: Add via unichrome support". Kernel.org. Retrieved 27 January 2015.
- ^ "drm: Remove the obsolete driver-via". Kernel.org. Retrieved 23 February 2024.
- ^ "drm: add savage driver". Kernel.org. Retrieved 27 January 2015.
- ^ "drm: Remove the obsolete driver-savage". Kernel.org. Retrieved 23 February 2024.
- ^ "List of maintainers of the linux kernel". Kernel.org. Retrieved 14 July 2014.
- ^ "libdrm git repository". Retrieved 23 July 2014.
- ^ "First DRI release of 3dfx driver". Mesa 3D. Retrieved 15 July 2014.
- ^ "Import 2.3.18pre1". The History of Linux in GIT Repository Format 1992-2010 (2010). Retrieved 15 July 2014.
- ^ Torvalds, Linus. "Linux 2.4.0 source code". Kernel.org. Retrieved 29 July 2014.
- ^ Airlie, Dave (30 December 2004). "[bk pull] drm core/personality split". linux-kernel (Mailing list).
- ^ Torvalds, Linus (11 January 2005). "Linux 2.6.11-rc1". linux-kernel (Mailing list).
- ^ Gettys, James; Packard, Keith (15 June 2004). "The (Re)Architecture of the X Window System". Retrieved 30 April 2016.
- ^ Smirl, Jon (30 August 2005). "The State of Linux Graphics". Retrieved 30 April 2016.
I believe the best solution to this problem is for the kernel to provide a single, comprehensive device driver for each piece of video hardware. This means that conflicting drivers like fbdev and DRM must be merged into a cooperating system. It also means that poking hardware from user space while a kernel based device driver is loaded should be prevented.
- ^ Verhaegen, Luc (2 March 2006). "X and Modesetting: Atrophy illustrated" (PDF). Retrieved 30 April 2016.
- ^ Glisse, Jerome (4 December 2007). "Radeon kernel modesetting". Retrieved 30 April 2016.
- ^ Larabel, Michael (1 October 2008). "The State of Kernel Mode-Setting". Phoronix. Retrieved 30 April 2016.
- ^ Packard, Keith (21 July 2008). "X output status july 2008". Retrieved 1 May 2016.
- ^ "drm: reorganise drm tree to be more future proof". Kernel.org.
- ^ "Linux 2.6.28 - The GEM Memory Manager for GPU memory". Linux Kernel Newbies. Retrieved 23 July 2014.
- ^ "drm: Add the TTM GPU memory manager subsystem". Kernel.org.
- ^ "DRM: add mode setting support". Kernel.org.
- ^ "DRM: i915: add mode setting support". Kernel.org.
- ^ Anholt, Eric (22 December 2008). "[ANNOUNCE] libdrm-2.4.3". dri-devel (Mailing list).
- ^ Barnes, Jesse (20 October 2008). "[ANNOUNCE] xf86-video-intel 2.5.0". xorg-announce (Mailing list).
- ^ "Linux 2.6.31 - ATI Radeon Kernel Mode Setting support". Linux Kernel Newbies. Archived from the original on 5 November 2015. Retrieved 28 April 2016.
- ^ Torvalds, Linus (9 September 2009). "Linux 2.6.31". linux-kernel (Mailing list).
- ^ "drm/radeon: introduce kernel modesetting for radeon hardware". Kernel.org.
- ^ "The irregular Nouveau Development Companion #40". Nouveau project. Retrieved 3 May 2016.
- ^ "Linux 2.6.33 - Graphic improvements". Linux Kernel Newbies. Retrieved 28 April 2016.
- ^ "drm/kms: add page flipping ioctl". Kernel.org.
- ^ "Linux 2.6.38 - Graphics". Linux Kernel Newbies. Retrieved 28 April 2016.
- ^ Airlie, Dave (21 December 2009). "[ANNOUNCE] libdrm 2.4.17". dri-devel (Mailing list).
- ^ "drm: dumb scanout create/mmap for intel/radeon (v3)". Kernel.org.
- ^ "Linux 2 6 39-DriversArch". Linux Kernel Newbies. Retrieved 19 April 2016.
- ^ Barnes, Jesse; Pinchart, Laurent; Vetter, Daniel; Wunner, Lukas. "Linux GPU Driver Developer's Guide - Dumb Buffer Objects". Retrieved 31 August 2016.
- ^ Wilson, Chris (11 April 2011). "[ANNOUNCE] libdrm 2.4.25". dri-devel (Mailing list).
- ^ Barnes, Jesse (25 April 2011). "[RFC] drm: add overlays as first class KMS objects". dri-devel (Mailing list).
- ^ Barnes, Jesse (13 May 2011). "[RFC] drm: add overlays as first class KMS objects". dri-devel (Mailing list).
- ^ "drm: add plane support v3". Kernel.org.
- ^ "drm: add generic ioctls to get/set properties on any object". Kernel.org.
- ^ Widawsky, Ben (27 June 2012). "[ANNOUNCE] libdrm 2.4.36". xorg-announce (Mailing list).
- ^ Larabel, Michael. "Proof Of Concept: Open-Source Multi-GPU Rendering!". Phoronix. Retrieved 14 April 2016.
- ^ Larabel, Michael (23 February 2012). "DRM Base PRIME Support Part Of VGEM Work". Phoronix. Retrieved 14 April 2016.
- ^ Airlie, Dave (27 March 2012). "[PATCH] drm: base prime/dma-buf support (v5)". dri-devel (Mailing list).
- ^ Larabel, Michael (30 March 2012). "Last Minute For Linux 3.4: DMA-BUF PRIME Support". Phoronix. Retrieved 15 April 2016.
- ^ "drm: base prime/dma-buf support (v5)". Kernel.org.
- ^ "Linux 3.4 DriverArch". Linux Kernel Newbies. Retrieved 15 April 2016.
- ^ Anholt, Eric (10 May 2012). "[ANNOUNCE] libdrm 2.4.34". dri-devel (Mailing list).
- ^ Larabel, Michael (12 May 2012). "DMA-BUF PRIME Coming Together For Linux 3.5". Phoronix. Retrieved 15 April 2016.
- ^ "Linux 3.5 DriverArch". Linux Kernel Newbies. Retrieved 15 April 2016.
- ^ Corbet, Jonathan (11 September 2013). "3.12 merge window, part 2". LWN.net. Retrieved 21 July 2014.
- ^ "drm: implement experimental render nodes". Kernel.org.
- ^ "drm/i915: Support render nodes". Kernel.org.
- ^ "drm/radeon: Support render nodes". Kernel.org.
- ^ "drm/nouveau: Support render nodes". Kernel.org.
- ^ Roper, Matt (7 March 2014). "[RFCv2 00/10] Universal plane support". dri-devel (Mailing list).
- ^ Larabel, Michael (2 April 2014). "Universal Plane Support Set For Linux 3.15". Phoronix. Retrieved 14 April 2016.
- ^ Lankhorst, Maarten (25 July 2014). "[ANNOUNCE] libdrm 2.4.55". dri-devel (Mailing list).
- ^ a b Vetter, Daniel (7 August 2014). "Neat stuff for 3.17". Retrieved 14 April 2016.
- ^ Barnes, Jesse (15 February 2012). "[RFC] drm: atomic mode set API". dri-devel (Mailing list).
- ^ Syrjälä, Ville (24 May 2012). "[RFC][PATCH 0/6] WIP: drm: Atomic mode setting idea". dri-devel (Mailing list).
- ^ Clark, Rob (9 September 2012). "[RFC 0/9] nuclear pageflip". dri-devel (Mailing list).
- ^ Clark, Rob (6 October 2013). "[RFCv1 00/12] Atomic/nuclear modeset/pageflip". dri-devel (Mailing list).
- ^ Vetter, Daniel (3 February 2016). "Embrace the Atomic Display Age" (PDF). Retrieved 4 May 2016.
- ^ Vetter, Daniel (2 November 2014). "Atomic Modeset Support for KMS Drivers". Retrieved 4 May 2016.
- ^ Airlie, Dave (14 December 2014). "[git pull] drm for 3.19-rc1". dri-devel (Mailing list).
- ^ Vetter, Daniel (28 January 2015). "Update for Atomic Display Updates". Retrieved 4 May 2016.
- ^ Airlie, Dave (15 February 2015). "[git pull] drm pull for 3.20-rc1". dri-devel (Mailing list).
- ^ "Linux 4.0 - DriverArch - Graphics". Linux Kernel Newbies. Retrieved 3 May 2016.
- ^ "Linux 4.2 - Atomic modesetting API enabled by default". Linux Kernel Newbies. Retrieved 3 May 2016.
- ^ Velikov, Emil (29 June 2015). "[ANNOUNCE] libdrm 2.4.62". dri-devel (Mailing list).
- ^ Vetter, Daniel (6 June 2016). "Awesome Atomic Advances". Retrieved 7 June 2016.
right now there's 17 drivers supporting atomic modesetting merged into the DRM subsystem
- ^ Stone, Daniel (20 March 2018). "A new era for Linux's low-level graphics - Part 1". Retrieved 5 May 2018.
- ^ Herrmann, David (10 December 2012). "KMSCON Introduction". Retrieved 22 November 2015.
- ^ "Linux, Solaris, and FreeBSD driver 358.09 (beta)". 2015-12-10.
External links
- DRM home page
- Linux GPU Driver Developer's Guide (formerly Linux DRM Developer's Guide)
- Embedded Linux Conference 2013 - Anatomy of an Embedded KMS driver on YouTube