The new display servers

Freedom!

Wayland does not prescribe a rendering mechanism. EGL and OpenGL are optional, although the official documentation mentions them [6]. You can replace the EGL implementation at any time independently of Wayland. (The clients and the compositor must agree on an implementation.) The system can even connect more graphics stacks if the compositor offers the appropriate buffer. For instance, you could have a special buffer for stereo images, which are sent to VR glasses. If the compositor has the necessary support, the hardware can even directly adopt and display the buffer contents. (This feature is especially useful for games and videos in full-screen mode.)

The Wayland compositor does not need to run as a stand-alone display server but can itself be a Wayland or X11 client. In these cases, the Wayland compositor usually opens a window, in which the output from the Wayland clients appears.

A client could be a normal application, an X server, or another Wayland compositor. X-Wayland is an X server that runs as a client in Wayland. Thanks to X-Wayland, you can continue to use legacy X11 applications under Wayland. After launching, they connect to X-Wayland, which relies on Wayland to output the window content to the screen.

On to Weston

Weston is a reference implementation of the Wayland compositor by the Wayland developers. Like the client libraries, Weston is released under the MIT license. Weston also serves as a model for developers of desktop environments: To make desktop environments run under Wayland, the developers need to rework their window managers to complete Wayland compositors. (See the "Compositor Help" box.) These efforts are currently in progress at the KDE and Gnome projects. Gnome users can test the results obtained so far with the latest Fedora (Figure 4).

Compositor Help

The compositor has to monitor and manage the input devices. To make the work easier for compositor manufacturers, the Weston developers have outsourced the code to a separate library. Libinput detects newly connected input devices, receives events sent by them, and passes the information on the compositor following preparation. Libinput communicates with udev and the evdev interface in the kernel (Figure 3). In addition to mice and keyboards, Libinput also supports touch devices.

Figure 4: Most distributions with Wayland support let you change to a session with Wayland in the login screen. The figure shows this for Fedora 24.

KDE users can test the state of development using the KDE Neon live system [7]. The following command

sudo apt-get install plasma-workspace-wayland

first retrofits Wayland. In the login screen, the user then goes to

<C>Desktop session:</C> Plasma (Wayland)<C>

in the bottom left corner. Another option is RebeccaBlackOS, a live system that relies entirely on Wayland and Weston and comes with several compositor models you can try out (Figure 5, [8]).

Figure 5: RebeccaBlackOS running Weston; the terminal is a native Wayland application.

On the Network?

In the X Window System, clients can communicate with the X server via a network if necessary. You can thus launch programs on a remote computer, and the windows will display on a local system. This process is transparent for the user and even works across different systems. This network transparency is missing in Wayland. Although there have been repeated attempts to extend Wayland, they have not made it into the official specification thus far. One of failed projects is Remote Wayland, which was launched in the scope of the Google Summer of Code 2011 [13]. The Gnome project has also conducted [14] its own experiments; remote control software such as VNC offers an alternative.

Pekka Paalanen explains why the introduction of network transparency is so complicated: "The Wayland protocol was written with shared memory in mind. The costs for the data transmission are effectively zero, thanks to shared main memory. Because of this optimization, the points where network transmissions can tap in are missing. You would need to evaluate many Wayland messages before you knew when and which parts of a buffer you need to transfer; therefore, simply forwarding individual messages does not work. When you start to build the necessary machinery that knows what and when to send, you soon realize that you've written a quarter of a compositor. [...] Also, you would need to evaluate quite a large number of Wayland messages to send content over a network.

Instead of artificially establishing network transparency and creating unnecessary overhead and complications that a local environment does not need, Wayland has limited its field of activity to local communication and is optimized for local activity. If you separate the network support and local communication, the translation layers between the two can be as complicated, smart, and pre-emptive as they want to be.

Last but not least, you can support an existing remote protocol, such as RDP, and thus avoid inventing a (bad?) new one. This design decision also completely evades the question as to whether you want to transmit a single window or the entire desktop. It allows for interesting applications, such as displaying the same window locally and on remote screens, and possibly even allowing people from different countries to use it at the same time."

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Wayland

    The X11 graphics protocol is showing some serious signs of age, but Wayland is poised to come to the rescue.

  • Wayland 1.4 Challenges X11

    X marks the target for the next-generation windowing system.

  • Hawaii Desktop

    The Hawaii desktop relies on Qt Quick, supports Wayland, and comes with its own compositor. Thanks to the Maui Linux system, you can test Hawaii on a Live CD or on a VMware virtual machine.

  • Tech Tools
    • New Intel Xeon Phi
    • Intel-HP HPC Center
    • Oracle Supports Azure Cloud
    • Wayland 1.2 Released
    • Java Enterprise Edition 7 Released
  • New Nvidia Driver Offers Wayland Support

    Graphics vendor embraces new reality in Linux graphics

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News