Wayland is only a protocol, explaining how userland processes can receive input events from the kernel, and update display outputs. As such, a wayland compositor needs a way to receive inputs, and update outputs. This is called a "backend". ## X11 backend A typical example is the X11 backend. When started from within an X session, the wayland compositor acts like any other X client. It receives input as X notify event, and sends configure requests to the server to have the X server update its window. This works fine for testing purposes, but has a limited use case, because your compositor doesn't work on its own, and you still rely on an X server being present. ## Wayland backend Of course, a wayland compositor can be used as a backend. This allow starting wayland compositor as clients of another compositor. This however require a primary compositor running, thus not solving our chicken-and-egg problem. ## DRM/KMS backend To be used to start a session on its own, a wayland compositor must be able to alter the Direct Rendering Manager (DRM) of the kernel. This is an in-kernel feature providing an API to communicate directly with the graphic card (through its driver), and this feature is exposed to userland thanks to libdrm. As the compositor needs to talk directly to the driver, right from the TTY, the driver must then be loaded early on, before a graphical session is started. This is the "Kernel Mode Setting" (KMS) feature. The kernel will load the driver directly at boot time, so that the graphical driver can be used with the DRM feature. Make sure that your GPU's driver is supported for KMS. For example, the nvidia proprietary driver isn't. Drivers known to have KMS support - nouveau (nVidia) - radeon (AMD/ATI) - amdgpu (AMD) ## Mesa / EGL Because libdrm is pretty generic, it doesn't support all the specific features a graphical driver can provide, and thus require the client to put vendor-specific code for each driver. This is highly impractical, so higher level library exist to provide a "stable" API that would translate generic calls to vendor-specific API. This is OpenGL, and its open-source implementation: mesa3d. The API usually chosen for wayland (eg, wlroots) is OpenGL for Embedded Systems (OpenGL|ES), or EGL. Mesa obviously supports it. ## GBM To make rendering even faster, and easier, mesa can hand over the graphic card buffer to the underlying application, so they can draw directly to a buffer, and pass it to the graphic driver for rendering, rather than having the driver compute de rendering operation. This is the Generic Buffer Management API, which is sometimes used by compositor to avoid tearing, and handle more complex use cases like dynamic refresh rates and such. Mesa can be compiled with GBM support.