Sun . 19 Sep 2019
TR | RU | UK | KK | BE |

Direct Rendering Infrastructure

direct infrastructure effects
The Direct Rendering Infrastructure DRI is a framework for allowing direct access to graphics hardware under the X Window System in a safe, efficient way6 The main use of DRI is to provide hardware acceleration for the Mesa implementation of OpenGL DRI has also been adapted to provide OpenGL acceleration on a framebuffer console without a display server runningcitation needed

DRI implementation is scattered through the X Server and its associated client libraries, Mesa 3D and the Direct Rendering Manager kernel subsystem6 All of its source code is free software


  • 1 Overview
  • 2 Software architecture
  • 3 DRI1
  • 4 DRI2
  • 5 DRI3
  • 6 Adoption
  • 7 History
  • 8 See also
  • 9 References
  • 10 External links


In the classic X Window System architecture the X Server is the only process with exclusive access to the graphics hardware, and therefore the one which does the actual rendering on the framebuffer All that X clients do is communicate with the X Server to dispatch rendering commands Those commands are hardware independent, meaning that the X11 protocol provides an API that abstracts the graphics device so the X clients don't need to know or worry about the specifics of the underlying hardware Any hardware specific code lives inside the Device Dependent X, the part of the X Server that manages each type of video card or graphics adapter and which is also often called the video or graphics driver

The rise of 3D rendering has shown the limits of this architecture 3D graphics applications tend to produce large amounts of commands and data, all of which must be dispatched to the X Server for rendering As the amount inter-process communication IPC between the X client and X Server increased, the 3D rendering performance suffered to the point that X driver developers concluded that in order to take advantage of 3D hardware capabilities of the latest graphics cards a new IPC-less architecture was required X clients should have direct access to graphics hardware rather than relying on a third party process to do so, saving all the IPC overload This approach is called "direct rendering" as opposed to the "indirect rendering" provided by the classical X architecture The Direct Rendering Infrastructure was initially developed to allow any X client to perform 3D rendering using this "direct rendering" approach

It should be noted that nothing prevents DRI from being used to implement accelerated 2D direct rendering within an X client3 Simply no one has had the need to do so because the 2D indirect rendering performance was good enough

Software architectureedit

The basic architecture of the Direct Rendering Infrastructure involves three main components:7

  • the DRI client —an X client performing "direct rendering"— needs a hardware specific "driver" able to manage the current video card or graphics adapter in order to render on it These DRI drivers are typically provided as shared libraries to which the client is dynamically linked Since DRI was conceived to take advantage of 3D graphics hardware, the libraries are normally presented to clients as hardware accelerated implementations of a 3D API such as OpenGL, provided by either the 3D hardware vendor itself or a third party such as the Mesa 3D free software project
  • the X Server provides an X11 protocol extension —the DRI extension— that the DRI clients use to coordinate with both the windowing system and the DDX driver8 As part of the DDX driver, it's quite common that the X Server process also dynamically links to the same DRI driver that the DRI clients, but to provide hardware accelerated 3D rendering to the X clients using the GLX extension for indirect rendering for example remote X clients that can't use direct rendering For 2D rendering, the DDX driver must also take into account the DRI clients using the same graphics device
  • the access to the video card or graphics adapter is regulated by a kernel component called the Direct Rendering Manager DRM9 Both the X Server's DDX driver and each X client's DRI driver must use DRM to access to the graphics hardware DRM provides synchronization to the shared resources of the graphics hardware —resources such as the command queue, the card registers, the video memory, the DMA engines, — ensuring that the concurrent access of all those multiple competing user space processes don't interfere with each other DRM also serves as a basic security enforcer that doesn't allow any X client to access the hardware beyond what it needs to perform the 3D rendering


In the original DRI architecture, due to the memory size of video cards at that time, there was a single instance of the screen front buffer and back buffer also of the ancillary depth buffer and stencil buffer, shared by all the DRI clients and the X Server1011 All of them rendered directly onto the back buffer, that was swapped with the front buffer at vertical blanking interval time10 In order to render to the back buffer, a DRI process should ensure that the rendering was clipped to the area reserved for its window1011

The synchronization with the X Server was done through signals and a shared memory buffer called the SAREA11 The access to the DRM device was exclusive, so any DRI client had to lock it at the beginning of a rendering operation Other users of the device —including the X Server— were blocked in the meantime, and they had to wait until the lock was released at the end of the current rendering operation, even if it wouldn't be any conflict between both operations11 Another drawback was that operations didn't retain memory allocations after the current DRI process released its lock on the device, so any data uploaded to the graphics memory such as textures were lost for upcoming operations, causing a significant impact on graphics performance

Nowadays DRI1 is considered completely obsolete and must not be used


Due to the increasing popularity of compositing window managers like Compiz, the Direct Rendering Infrastructure had to be redesigned so that X clients could also support redirection to "offscreen pixmaps" while doing direct rendering Regular X clients already respected the redirection to a separate pixmap provided by the X Server as a render target —the so-called offscreen pixmap—, but DRI clients continued to do the rendering directly into the shared backbuffer, effectively bypassing the compositing window manager1012 The ultimate solution was to change the way DRI handled the render buffers, which led to a completely different DRI extension with a new set of operations, and also major changes in the Direct Rendering Manager3 The new extension was named "DRI2", although it should be noted that it's not a later version but a different extension not even compatible with the original DRI —in fact both have coexisted within the X Server for a long time

In DRI2, instead of a single shared back buffer, every DRI client gets its own private back buffer1011 —along with their associated depth and stencil buffers— to render its window content using the hardware acceleration The DRI client then swaps it with a false "front buffer",11 which is used by the compositing window manager as one of the sources to compose build the final screen back buffer to be swapped at the VBLANK interval with the real front buffer

To handle all these new buffers, the Direct Rendering Manager had to incorporate new functionality, specifically a graphics memory manager DRI2 was initially developed using the experimental TTM memory manager,1012 but it was later rewritten to use GEM after it was chosen as the definitive DRM memory manager13 The new DRI2 internal buffer management model also solved two major performance bottlenecks present in the original DRI implementation:

  • DRI2 clients no longer lock the entire DRM device while using it for rendering, since now each client gets a separate render buffer independent from the other processes11
  • DRI2 clients can allocate its own buffers with textures, vertex lists, in the video memory and keep them as long as they want, which significantly reduces video memory bandwidth consumption

In DRI2, the allocation of the private offscreen buffers back buffer, fake front buffer, depth buffer, stencil buffer, for a window is done by the X Server itself1415 DRI clients retrieve those buffers to do the rendering into the window by calling operations such as DRI2GetBuffers and DRI2GetBuffersWithFormat available in the DRI2 extension3 Internally, DRI2 uses GEM names —a type of global handle provided by the GEM API that allows two processes accessing a DRM device to refer to the same buffer— for passing around "references" to those buffers thought the X11 protocol15 The reason why the X Server is in charge of the buffer allocation of the render buffers of a window is that the GLX extension allows for multiple X clients to do OpenGL rendering cooperatively in the same window14 This way, the X Server manages the whole lifecycle of the render buffers along the entire rendering process and knows when it can safely recycle or discard them When a window resize is performed, the X Server is also responsible of allocating new render buffers matching the new window size, and notifying the change to the DRI clients rendering into the window using an InvalidateBuffers event, so they would retrieve the GEM names of the new buffers14

The DRI2 extension provides other core operations for the DRI clients, such as finding out which DRM device and driver should they use DRI2Connect or getting authenticated by the X Server in order to be able to use the rendering and buffer facilities of the DRM device DRI2Authenticate3 The presentation of the rendered buffers in the screen is performed using the DRI2CopyRegion and DRI2SwapBuffers requests DRI2CopyRegion can be used to do a copy between the fake front buffer and the real front buffer, but it doesn't provide any synchronization with the vertical blanking interval, so it can cause tearing DRI2SwapBuffers, on the other hand, performs a VBLANK-synchronized swap between back and front buffer, if it's supported and both buffers have the same size, or a copy blit otherwise314


Although DRI2 was a significant improvement over the original DRI, the new extension also introduced some new issues1415 In 2013, a third iteration of the Direct Rendering Infrastructure known as DRI3 was developed in order to fix those issues16

The main differences of DRI3 compared to DRI2 are:

  • DRI3 clients allocate themselves their render buffers instead of relying on the X Server for doing the allocation —that was the method supported by DRI21415
  • DRI3 gets rid of the old insecure GEM buffer sharing mechanism based on GEM names global GEM handles for passing buffer objects between a DRI client and the X Server in favor of the one more secure and versatile based on PRIME DMA-BUFs, which uses file descriptors instead1415

Buffer allocation on the client side breaks GLX assumptions in the sense that it's no longer possible for multiple GLX applications to render cooperatively in the same window On the plus side, the fact that the DRI client is in charge of its own buffers throughout their lifetime brings many advantages For example, it is easy for the DRI3 client to ensure that the size of the render buffers always match the current size of the window, and thereby eliminate the artifacts due to the lack of synchronization of buffer sizes between client and server that plagued window resizing in DRI2141517 A better performance is also achieved because now DRI3 clients save the extra round trip waiting for the X Server to send the render buffers15 DRI3 clients, and especially compositor window managers, can take advantage of keeping older buffers of previous frames and reusing them as the basis on which to render only the damaged parts of a window as another performance optimization1415 The DRI3 extension no longer needs to be modified to support new particular buffer formats, since they are now handled directly between the DRI client driver and the DRM kernel driver14 The use of file descriptors, on the other hand, allows the kernel to perform a safe cleanup of any unused GEM buffer object —one with no reference to it1415

Technically, DRI3 consists of two different extensions, the "DRI3" extension and the "Present" extension1618 The main purpose of the DRI3 extension is to implement the mechanism to share direct rendered buffers between DRI clients and the X Server171819 DRI clients allocate and use GEM buffers objects as rendering targets, while the X Server represents these render buffers using a type of X11 object called "pixmap" DRI3 provides two operations, DRI3PixmapFromBuffer and DRI3BufferFromPixmap, one to create a pixmap in "X Server space" from a GEM buffer object in "DRI client space", and the other to do the reverse and get a GEM buffer object from an X pixmap171819 In these DRI3 operations GEM buffer objects are passed as DMA-BUF file descriptors instead of GEM names DRI3 also provides a way to share synchronization objects between the DRI client and the X Server, allowing both a serialized access to the shared buffer18 Unlike DRI2, the initial DRI3Open operation —the first every DRI client must request to know which DRM device to use— returns an already open file descriptor to the device node instead of the device node filename, with any required authentication procedure already performed in advance by the X Server1718

DRI3 provides no mechanism to show the rendered buffers on the screen, but relies on another extension, the Present extension, to do so19 Present is so named because its main task is to "present" buffers on the screen, meaning that it handles the update of the framebuffer using the contents of the rendered buffers delivered by client applications18 Screen updates have to be done at the proper time, normally during the VBLANK interval in order to avoid display artifacts such as tearing Present also handles the synchronization of screen updates to the VBLANK interval20 It also keeps the X client informed about the instant each buffer is really shown on the screen using events, so the client can synchronize its rendering process with the current screen refresh rate

Present accepts any X pixmap as the source for a screen update20 Since pixmaps are standard X objects, Present can be used not only by DRI3 clients performing direct rendering, but also by any X client rendering on a pixmap by any means17 For example, most existing non-GL based GTK+ and Qt applications used to do double buffered pixmap rendering using XRender The Present extension can also be used by these applications to achieve efficient and non-tearing screen updates This is the reason why Present was developed as a separate standalone extension instead of being part of DRI317

Apart from allowing non-GL X clients to synchronize with VBLANK, Present brings other advantages DRI3 graphics performance is better because Present is more efficient than DRI2 in swapping buffers18 A number of OpenGL extensions that weren't available with DRI2 are now supported based on new features provided by Present18

Present provides two main operations to X clients: update a region of a window using part of or all the contents of a pixmap PresentPixmap and set the type of presentation events related to a certain window that the client wants to be notified about PresentSelectInput1820 There are three presentation events about which a window can notify an X client: when an ongoing presentation operation —normally from a call to PresentPixmap— has been completed PresentCompleteNotify, when a pixmap used by a PresentPixmap operation is ready to be reused PresentIdleNotify and when the window configuration —mostly window size— changes PresentConfigureNotify1820 Whether a PresentPixmap operation performs a direct copy blit onto the front buffer or a swap of the entire back buffer with the front buffer is an internal detail of the Present extension implementation, instead of an explicit choice of the X client as it was in DRI2


Several open source DRI drivers have been written, including ones for ATI Mach64, ATI Rage128, ATI Radeon, 3dfx Voodoo3 through Voodoo5, Matrox G200 through G400, SiS 300-series, Intel i810 through i965, S3 Savage, VIA UniChrome graphics chipsets, and nouveau for Nvidia Some graphics vendors have written closed-source DRI drivers, including ATI and Kyro

The various versions of DRI have been implemented by various operating systems, amongst others by the Linux kernel, FreeBSD, NetBSD, OpenBSD, and OpenSolaris


The project was started by Jens Owen and Kevin E Martin from Precision Insight funded by Silicon Graphics and Red Hat121 It was first made widely available as part of XFree86 40122 and is now part of the XOrg Server It is currently maintained by the free software community

Work on DRI2 started at the 2007 X Developers' Summit from a Kristian Høgsberg's proposal2324 Høgsberg himself wrote the new DRI2 extension and the modifications to Mesa and GLX25 In March 2008 DRI2 was mostly done,262728 but it couldn't make into XOrg Server version 1513 and had to wait until version 16 from February 200929 The DRI2 extension was officially included in the X11R75 release of October 200930 The first public version of the DRI2 protocol 20 was announced in April 200931 Since then there has been several revisions, being the most recent the version 28 from July 20124

Due to several limitations of DRI2, a new extension called DRI-Next was proposed by Keith Packard and Eric Anholt at the XOrg Developer's Conference 201214 The extension was proposed again as DRI3000 at Linuxconfau 20131516 DRI3 and Present extensions were developed during 2013 and merged into the XOrg Server 115 release from December 20133233 The first and only version of the DRI3 protocol 10 was released in November 20135

See alsoedit

  • Free Software portal
  • X Window System
  • Mesa 3D
  • Direct Rendering Manager


  1. ^ a b c Owen, Jens "The DRI project history" DRI project wiki Retrieved 16 April 2016 
  2. ^ a b c Mesa DRI License / Copyright Information - The Mesa 3D Graphics Library
  3. ^ a b c d e f Høgsberg, Kristian 4 September 2008 "The DRI2 Extension - Version 20" XOrg Retrieved 29 May 2016 
  4. ^ a b Airlie, Dave 11 July 2012 "ANNOUNCE dri2proto 28" xorg-announce Mailing list 
  5. ^ a b c Packard, Keith 1 November 2013 "ANNOUNCE dri3proto 10" xorg-announce Mailing list 
  6. ^ a b "Mesa 3D and Direct Rendering Infrastructure wiki" Retrieved 15 July 2014 
  7. ^ Martin, Kevin E; Faith, Rickard E; Owen, Jens; Akin, Allen 11 May 1999 "Direct Rendering Infrastructure, Low-Level Design Document" Retrieved 18 May 2016 
  8. ^ Owen, Jens; Martin, Kevin 11 May 1999 "DRI Extension for supporting Direct Rendering - Protocol Specification" Retrieved 18 May 2016 
  9. ^ Faith, Rickard E 11 May 1999 "The Direct Rendering Manager: Kernel Support for the Direct Rendering Infrastructure" Retrieved 18 May 2016 
  10. ^ a b c d e f Packard, Keith 21 July 2008 "X output status july 2008" Retrieved 26 May 2016 
  11. ^ a b c d e f g Packard, Keith 24 April 2009 "Sharpening the Intel Driver Focus" Retrieved 26 May 2016 
  12. ^ a b Høgsberg, Kristian 8 August 2007 "Redirected direct rendering" Retrieved 25 May 2016 
  13. ^ a b Høgsberg, Kristian 4 August 2008 "Backing out DRI2 from server 15" xorg Mailing list 
  14. ^ a b c d e f g h i j k l Packard, Keith 28 September 2012 "Thoughts about DRINext" Retrieved 26 May 2016 
  15. ^ a b c d e f g h i j Willis, Nathan 11 February 2013 "LCA: The X-men speak" LWNnet Retrieved 26 May 2016 
  16. ^ a b c Packard, Keith 19 February 2013 "DRI3000 — Even Better Direct Rendering" Retrieved 26 May 2016 
  17. ^ a b c d e f Packard, Keith 4 June 2013 "Completing the DRI3 Extension" Retrieved 31 May 2016 
  18. ^ a b c d e f g h i j Edge, Jake 9 October 2013 "DRI3 and Present" LWNnet Retrieved 26 May 2016 
  19. ^ a b c Packard, Keith 4 June 2013 "The DRI3 Extension - Version 10" Retrieved 30 May 2016 
  20. ^ a b c d Packard, Keith 6 June 2013 "The Present Extension - Version 10" Retrieved 1 June 2016 
  21. ^ Owen, Jens; Martin, Kevin E 15 September 1998 "A Multipipe Direct Rendering Architecture for 3D" Retrieved 16 April 2016 
  22. ^ "Release Notes for XFree86 40" XFree86 Project 7 March 2000 Retrieved 16 April 2016 
  23. ^ "X Developers' Summit 2007 - Notes" XOrg Retrieved 7 March 2016 
  24. ^ Høgsberg, Kristian 3 October 2007 "DRI2 Design Wiki Page" xorg Mailing list 
  25. ^ Høgsberg, Kristian 4 February 2008 "Plans for merging DRI2 work" xorg Mailing list 
  26. ^ Høgsberg, Kristian 15 February 2008 "DRI2 committed" xorg Mailing list 
  27. ^ Høgsberg, Kristian 31 March 2008 "DRI2 direct rendering" xorg Mailing list 
  28. ^ Høgsberg, Kristian 31 March 2008 "DRI2 Direct Rendering" Retrieved 20 April 2016 
  29. ^ "Server 16 branch" Xorg Retrieved 7 February 2015 
  30. ^ "Release Notes for X11R75" XOrg Retrieved 20 April 2016 
  31. ^ Høgsberg, Kristian 20 April 2009 "ANNOUNCE dri2proto 20" xorg-announce Mailing list 
  32. ^ Packard, Keith "ANNOUNCE xorg-server 11499901" Xorg Retrieved 9 February 2015 
  33. ^ Larabel, Michael "XOrg Server 115 Release Has Several New Features" Phoronix Retrieved 9 February 2015 

External linksedit

  • Direct Rendering Infrastructure project home page
  • Current specification documents always updated to the most recent version:
    • The DRI2 Extension Kristian Høgsberg, 2008
    • The DRI3 Extension Keith Packard, 2013
    • The Present Extension Keith Packard, 2013

direct infrastructure effects

Direct Rendering Infrastructure Information about

Direct Rendering Infrastructure

  • user icon

    Direct Rendering Infrastructure beatiful post thanks!


Direct Rendering Infrastructure
Direct Rendering Infrastructure
Direct Rendering Infrastructure viewing the topic.
Direct Rendering Infrastructure what, Direct Rendering Infrastructure who, Direct Rendering Infrastructure explanation

There are excerpts from wikipedia on this article and video

Random Posts



The Picts were a tribal confederation of peoples who lived in what is today eastern and northern Sco...
Visual prosthesis

Visual prosthesis

A visual prosthesis, often referred to as a bionic eye, is an experimental visual device intended to...
Mini rugby

Mini rugby

Mini rugby, also known as New Image Rugby, is a form of rugby union designed to introduce the sport ...
List of synthetic polymers

List of synthetic polymers

Synthetic polymers are human-made polymers From the utility point of view they can be classified int...