In the previous post, we learned why the X Window System is one of the most successful open source projects in history, and it’s time to replace it with a new solution for the Linux graphical environment. In the same article, we’ll find out how Wayland is - the most likely candidate for a replacement for X.
It makes sense to first deal with some definitions and terminology.
Compositor - Composite window manager is one of the central concepts of Wayland and around it. Nowhere is it really defined what it is, but this term is used as if everyone knows everything. In any case, I did not find any definition in Russian. Fortunately, examples clarify the essence of the matter. Here is a list of them in the context of Wayland :
KWin
- KDE Display Server,Mutter
is the GNOME display server,Weston
- the reference composite manager for Wayland ,Enlightenment
- desktop GUI,Marco
is the MATE window manager.As we can see, this is nothing more than window managers familiar to us, although in fact not. These are display servers , which all the same differ in their functionality from WM. The former interact with user input / output devices, with iron, and control the flow of client program data. The latter are responsible for displaying windows and placing them in the window interface system.
Illustration from wikipedia page .
But to say that there is a clear semantic and terminological boundary between all these servers, managers and composers , it would be a hoax. For example, KWin
is both a display server and WM, just like Enlightenment
. For this article, a composite window manager (abbreviated as KOM) and a display server will be equivalent to the term Compositor .
$ eix -c enlightenment; eix -ce kwin [N] x11-wm/enlightenment (1.0.17): Enlightenment Window Manager (e16) [I] kde-plasma/kwin (5.8.5(5)@01.02.2017): KDE window manager
A composite manager, or a display server, may also be referred to as a composite window manager .
$ eix -c mutter [N] x11-wm/mutter (3.20.3): GNOME 3 compositing window manager based on Clutter
Weston - Reference Wayland Protocol Display Server. Recently came the second version of the COM.
EGL is the platform-independent equivalent of the OpenGL GLX / AGL / WGL software interfaces, developed by the Khronos Group. EGL provides an infrastructure set for quick application setup and scene initialization.
EGL, unlike GLX / AIGLX, can only perform direct rendering , in which applications through DRI2 / DRI3 can safely and quickly access video equipment bypassing the X server.
GLES - A subset of OpenGL designed specifically for embedded systems - mobile phones, tablets, computers, game consoles.
So what is Wayland ? As with the X Window System, this is a protocol and its implementation. Wayland is a protocol for interaction between COM and clients, as well as its library implementation in C. The client can be a custom application, an X server, or another display server.
At the lowest level of the protocol, the client and KOM synchronize messages, exchange ordered objects using the IPC libraries libwayland-client
and libwayland-server
. At this level, the methods for controlling the window interface are not defined - only messages transmitted via Unix Domain Sockets, objects and events.
+-------------------+ +-------------------+ | | | | | Client | | Compositor | +-------------------+ +-------------------+ | libwayland-client | | libwayland-server | +-------------------+ +--+----------------+ | | | Wayland | User space | protocol | +---------------------------------------------------+ | Kernel space | +---+ | | | +------>|IPC|<----+ | | +---+ | +---------------------------------------------------+
Objects created by the client are represented by the wl_proxy
structure, which contains the message identifier transmitted to the server via a socket, the void
data pointer, and a pointer to the static wl_interface
object. Messages are sent using the wl_proxy_marshal
structure.
static inline void wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_ATTACH, buffer, x, y); }
Wayland is an asynchronous, object-oriented protocol designed to handle messages. The message sent from the client to the server is a call , and in the opposite direction an event . Each message consists of 32-bit words, the values are presented in the order of the host bytes.
Illustration from the main page of Wayland .
How do these blocks interact?
How does the rendering work? Clients independently render their windows in a separate buffer, passing information about updates to the display server, which combines the contents of the buffers of different applications to form the final output, taking into account possible nuances, such as overlapping windows and transparency.
So why is Wayland different for the better? Let's go over the main points in order to understand for what it was all going. For me personally, it’s enough that the xorg.conf
configuration file is missing. However, the fruitful influence of direct hands on editing this file has already been discussed in the comments to the previous post.
Xinput 2.2
minus the Xinput 2.2
obsolete code and Master / Slave order between input devices. The global object is a seat
, i.e. a place defines a group of input devices, including a mouse, keyboard, and a touch screen. The nightmarish multitouch problems will disappear.xfree86.conf/xorg.conf
is needed to remember the settings for two or more monitors, graphic cards. We are not going to be bored without these killer features in the coming post-X era?There are a number of consistently incorrect opinions on this subject.
DRI2
and shared memory, and both cannot work on the network. Everything revolves on the slow synchronous Xlib
, and the exhaust is obtained as with VNC, if not worse.The Wayland Situation: Facts About X vs. Wayland
Layer development status for running X11 applications over Wayland
Wayland Documentation
Source: https://habr.com/ru/post/322580/
All Articles