If you have hardware 3D acceleration, you use a graphics processor instead of a CPU to create 3D images. CPU is forced to render everything on its own without hardware 3D acceleration, using Mesa library.
What is Mesa
Mesa is an open source implementation of the OpenGL, Vulkan, OpenCL, and other graphics APIs, as well as a set of user-space video drivers for AMD, Intel, Nvidia, and Qualcomm GPUs. Written in C, C++ and Assembler. Project site.
- OpenGL / OpenGL ES is a cross-platform, industry standard graphics programming API for 3D graphics.
- Vulkan is the next-generation graphics programming API from The Khronos Group.
- EGL is an interface between Khronos rendering APIs such as OpenGL or OpenVG and the base of the native platform window system.
- OpenMAX is a opensource cross-platform set of C-language programming interfaces, provides abstractions for processing of media stack.
- OpenCL is a framework for writing programs that execute across different platforms consisting of CPUs, GPUs, DSPs, FPGAs and other processors or hardware accelerators.
- VDPAU is the Video Decode and Presentation API for UNIX. It provides an interface to video decode acceleration and presentation hardware present in modern GPUs.
- VA API is an opensource library and API, which provides access to graphics hardware acceleration capabilities for video processing.
- XvMC is an extension for Xorg. The XvMC API allows video programs to offload portions of the video decoding process to the GPU hardware.
Mesa is focused on providing high performance during working with 3D graphics, including through the use of 3D hardware acceleration supported by GPUs. Mesa is at the heart of the graphics stack of Linux and BSD distributions, so that on these operating systems, without using Mesa, it’s impossible to achieve the work of the graphical interface, desktop environment, applications and graphical interface, 3D graphics, including games, performance in which largely depends on Mesa. Therefore, for all users of Linux and BSD distributions using the GUI.
DRI and DRM
DRI (Direct Rendering Infrastructure) is an interface that allows you to access the graphics card in a safe and efficient way through a layer of GPU and Mesa drivers. The most common usation of DRI is to create fast OpenGL addons. DRI includes patches for Xorg, some client libraries, and for the kernel.
DRM (Direct Rendering Manager) is an addon to Xorg that provides 3D acceleration by adding the core modules required for direct access to the graphics card. The project is developing by Freedesktop.
Nowadays DRM works good with all video drivers, including amdgpu, radeon, nouveau, and proprietary Nvidia drivers.
Advantages of DRM:
- DRM provides synchronized access to the video card.
- DRM provides secure access to the graphics hardware.
- DRM supports DMA (Direct Memory Access), which increases the throughput of Xorg buffer pools.