Wayland (display server protocol)

From Wikipedia, the free encyclopedia
Wayland

Wayland demonstration
Original author(s) Kristian Høgsberg
Initial release 0.85 / 9 February 2012 (2012-02-09)[1]
Stable release 1.4.0 / 24 January 2014 (2014-01-24)[2]
Development status Active
Written in C
Operating system Linux
Type
License MIT
Website wayland.freedesktop.org

Wayland is a protocol that specifies the communication between the display server (called Wayland compositor) and its clients.[3] It was initially designed by Kristian Høgsberg, who already led the development of AIGLX, as a replacement for the X Window System. In stark contrast to the latter, Wayland clients will render without detour directly into their own buffer located in the graphics memory, through the use of EGL with some additional Wayland-specific extensions to EGL. The display manager is to do the compositing, hence it will incorporate a big chunk of the functionality of current day compositing window managers. It will composite those buffers to form the on-screen display of application windows. The Wayland protocol is essentially only about input handling and buffer management. The handling of the input hardware relies on evdev in Linux, and similar components in other operating systems.

The initial implementation, chiefly libwayland-server, libwayland-client, libwayland-EGL and the reference implementation Weston are written in C and published under the MIT License. Weston is written for the Linux kernel. An initial port to FreeBSD is in progress.[4]

Software architecture

① The evdev module of the Linux kernel gets an event and sends it to the Wayland compositor.
② The Wayland compositor looks through its scenegraph to determine which window should receive the event. The scenegraph corresponds to what's on screen and the Wayland compositor understands the transformations that it may have applied to the elements in the scenegraph. Thus, the Wayland compositor can pick the right window and transform the screen coordinates to window local coordinates, by applying the inverse transformations. The types of transformation that can be applied to a window is only restricted to what the compositor can do, as long as it can compute the inverse transformation for the input events.
③ As in the X case, when the client receives the event, it updates the UI in response. But in the Wayland case, the rendering happens by the client via EGL, and the client just sends a request to the compositor to indicate the region that was updated.
④ The Wayland compositor collects damage requests from its clients and then re-composites the screen. The compositor can then directly issue an ioctl to schedule a pageflip with KMS

Wayland: between libwayland and the wayland compositor

The Linux graphic stack
Wayland clients use EGL to draw directly into the framebuffer; the wayland compositor does the compositing
The place of certain Linux kernel modules
The display server (Wayland compositor) sits between the Linux kernel and its clients. It communicates with its clients over its given protocol.

In recent years, Linux desktop graphics has moved from having "a pile of rendering interfaces... all talking to the X server, which is at the center of the universe" towards putting the Linux kernel and its components (i.e. DRI, DRM) "in the middle", with "window systems like X and Wayland ... off in the corner". This will be "a much-simplified graphics system offering more flexibility and better performance".[5]

Høgsberg could have added an extension to X as many recent projects have done, but preferred to "[push] X out of the hotpath between clients and the hardware" for reasons explained in the project's FAQ:[6]

What’s different now is that a lot of infrastructure has moved from the X server into the kernel (memory management, command scheduling, mode setting) or libraries (cairo, pixman, freetype, fontconfig, pango, etc.), and there is very little left that has to happen in a central server process. ... [An X server has] a tremendous amount of functionality that you must support to claim to speak the X protocol, yet nobody will ever use this. ... This includes code tables, glyph rasterization and caching, XLFDs (seriously, XLFDs!), and the entire core rendering API that lets you draw stippled lines, polygons, wide arcs and many more state-of-the-1980s style graphics primitives. For many things we've been able to keep the X.org server modern by adding extension such as XRandR, XRender and COMPOSITE ... With Wayland we can move the X server and all its legacy technology to an optional code path. Getting to a point where the X server is a compatibility option instead of the core rendering system will take a while, but we'll never get there if [we] don’t plan for it.

Wayland consists of a protocol and a reference implementation named Weston. The project is also developing versions of GTK+ and Qt that render to Wayland instead of to X. Most applications are expected to gain support for Wayland through one of these libraries without modification to the application.

Wayland does not currently provide network transparency, but it may in the future.[7] It was attempted as a Google Summer of Code project in 2011, but was not successful.[8] Adam Jackson has envisioned providing remote access to a Wayland application by either 'pixel-scraping' (like VNC) or getting it to send a "rendering command stream" across the network (as in RDP, SPICE or X11).[9] As of early 2013, Høgsberg is experimenting with network transparency using a proxy Wayland server which sends compressed images to the real compositor.[10]

Differences between Wayland and X

There are several differences between Wayland and X in regards to performance, code maintainability and security. Wayland delegates many tasks to the client such as drawing, font rendering, and multiple monitor support.[11] With the client handling the tasks, less code needs to run with root privileges, improving security.[12] Another added security feature compared to X is that the screensaver/locker is always a part of the compositor.[11]

The major differences between the operating modes of a Wayland compositor and the X.Org Server were explained at linux.conf.au 2013 by Daniel Stone.[13] He also points out that the X.Org Server has not been "network transparent" for a very long time now, very much in contrast to common beliefs.

Some of the differences can also be easily understood by comparing the architecture diagrams of both protocols.[14]

Compatibility with X

A screenshot showing xwayland

xwayland[15] was written to enable running X11 applications through an X server, optionally rootless, running as a Wayland client.[16] This is similar to the way X applications run in OS X’s native graphics environment.

Qt applications can switch between graphical backends like X and Wayland at load time with the -platform command-line option.[17] In January 2011, Wayland support was moved into the Lighthouse branch of the upstream Qt repository.[18] Qt Lighthouse is shipped in the Qt 4.8 release.[19]

In December 2010, GTK+ added preliminary support for switching back-ends at run time, saying "interesting combinations are X11+Wayland or Quartz+X11".[20][21] In January 2011, the GTK+ Wayland backend was updated to support the multiple-backends feature and moved to the gdk-wayland-backend branch of the upstream GTK+ Git repository.[22] In April 2011, the gdk-wayland-backend branch was merged in the GTK+ master branch.

Adoption

GENIVI Alliance
The GENIVI automotive industry consortium for in-vehicle infotainment (IVI) supports Wayland.[23]
Maliit
Maliit, an input method framework, runs under Wayland.[24][25][26]
Mesa
Mesa, to which AMD and Intel directly contribute to support their graphics processors, has Wayland support integrated.[27] Within the Mesa projects drivers for Qualcomm Snapdragon (freedreno)[28][29] and Nvidia GPUs (nouveau)[30][31] are being developed by Red Hat and community contributors.[32][33]
Sailfish OS
Jolla's first smartphone uses Wayland.[34][35][36]
Tizen
Tizen up to 2.x supports Wayland in IVI setups[37] and from 3.0 onward defaults to Wayland.[38]

Planned adoption

Enlightenment
The Enlightenment project declared full support for Wayland with their Enlightenment Foundation Libraries and window manager.[39]
Fedora
Fedora ships Wayland since release 17.[40] Fedora developer Matthias Clasen released a tentative roadmap in March 2013, targeting to use Wayland as default by Fedora 21.[41] Fedora 20 ships with a technology preview of a Wayland-enabled Gnome 3.10 session.[42][43]
GNOME
In March 2013 GNOME developers announced plans for a complete Wayland port within a year.[44] GNOME 3.10 includes initial support that “will enable the project to fully adopt the next generation display and input technology in the future”.[45][46]
KDE
KWin, the KDE window manager, added support for OpenGL ES output[47] in version 4.7.[48] In January 2013 KWin’s main developer Martin Grässlin started working for Blue Systems with one of the goals being a complete Wayland port.[49] Experimental Wayland support is now working in current KWin 4.11.[50]
Raspberry Pi
The Raspberry Pi Foundation are working in collaboration with Collabora[51] to improve performance and memory consumption, but do not expect to be able to replace X11 as the default display server until later in the year.[52]

Toolkits

As of October 2013:

  • Clutter has complete Wayland support.[53]
  • EFL has complete Wayland support, except for selection.[54]
  • GTK+ 3.10 (released 23 September 2013) has complete Wayland 1.2 support, including the client-side decorations, which is required by Weston.[55][56]
  • Qt 5 has complete Wayland support, including the client-side decorations, which is required by Weston but not KWin.
  • SDL support for Wayland is under development.[57]

Compositors

Typical elements of a window. Neither Wayland nor X11 do specify which software has to do the drawing of the window decoration. Weston requires that they be drawn by the client, but KWin will implement server-side decoration.[1]

Display managers that implement the Wayland display server protocol are also called Wayland compositors because they additionally perform the task of a compositing window manager.

  • Weston – the reference implementation of a Wayland compositor; Weston implements client-side decoration
  • Enlightenment 0.19 (E19) is expected to have full Wayland support.[58]
  • KWin had incomplete Wayland support in April 2013.[59]
  • Mutter has incomplete Wayland support.
  • Clayland is a simple example Wayland compositor using Clutter.[60]

Weston

Weston is the reference implementation of a Wayland compositor. It is written in C and was initially published under GPLv2, but is currently published under the MIT license. Weston is written for the Linux kernel API, i.e. it is only officially supported to work with the Linux kernel due to dependence on certain features, such as KMS, Graphics Execution Manager (GEM), and udev, which are either Linux-specific or uncommon in other Unix-like operating systems.[61]

Weston relies on GEM to share application buffers between the compositor and applications. It contains a plugin system, external "shells" for WM/dock/etc, and Weston supports X clients. Clients are responsible for the drawing of their window borders and their decorations. For rendering, Weston can use OpenGL ES or software (the pixman library).[62] The full OpenGL implementation is not used, because on most current systems, installing the full OpenGL libraries would also install GLX and other X-Windows support libraries as dependencies.[63]

Releases

Major Wayland/Weston releases[64]
Version Date Wayland main features Weston main features
Old version, no longer supported: 0.85 9 Feb 2012[1] First release
Old version, no longer supported: 0.95 24 Jul 2012[65] Began API stabilization
Old version, no longer supported: 1.0 22 Oct 2012[66][67] Stable wayland-client API
Old version, no longer supported: 1.1 15 Apr 2013[68][69] Software rendering[70]
Older version, yet still supported: 1.2 12 Jul 2013[71][72] Stable wayland-server API. Multi seat support Color management
Older version, yet still supported: 1.3 11 Oct 2013[73] Support for language bindings Android driver support via libhybris
Current stable version: 1.4 23 Jan 2014[74] New wl_subcompositor and wl_subsurface interfaces xdg_shell API
Future release: 1.5 May 2014[75] Move xdg_shell into Wayland itself
Legend:
Old version
Older version, still supported
Latest version
Latest preview version
Future release

History

Wayland uses direct rendering over EGL.

Kristian Høgsberg (krh), a software engineer who works on the Linux graphics stack, started Wayland as a spare-time project in 2008, while working for Red Hat;[76] he is now at Intel.[77] His earlier work on X included AIGLX,[78] which enabled hardware acceleration of compositing window managers, and DRI2.[79][80][81]

His stated goal was a system in which "every frame is perfect, by which I mean that applications will be able to control the rendering enough that we'll never see tearing, lag, redrawing or flicker."

In October 2010 Wayland became a freedesktop.org project.[82][83]

Wayland is free software, and the libraries (libwayland-server and libwayland-client) were released under the MIT License, with the demo compositor and clients originally under the GPLv2 license. Moving the whole project to LGPLv2 was planned[84] but did not occur and the project is now switching fully to the MIT License.[85] Wayland works with all Mesa-compatible drivers with DRI2 support[27] as well as Android drivers via the Hybris project.[86][87][88] As of November 2010, Nvidia has no plans to support it in their proprietary drivers.[31][89] On 4 October 2013 Nvidia released a beta version of their 331.13 driver which supports the EGL API.[90] Although limited to X11, IT publications such as Phoronix and Golem.de noted that EGL support in the Nvidia driver could pave the way for future Wayland support.[91][92]

The developers of Wayland are largely present X.Org Server developers.[93]

The name "Wayland" comes from the town of Wayland, Massachusetts. Høgsberg was driving through that town when the concepts behind Wayland "crystallized".[94]

See also

References

  1. 1.0 1.1 Høgsberg, Kristian (9 February 2011). "[ANNOUNCE] Wayland and Weston 0.85.0 released". Wayland mailing list. Retrieved 8 June 2013. 
  2. "Wayland and Weston 1.4 releases are out". Retrieved 2014-01-24. 
  3. "Wayland". "Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol." 
  4. Larabel, Michael (16 February 2013). "Wayland Begins Porting Process To FreeBSD". Phoronix. Retrieved 14 July 2013. 
  5. Jonathan Corbet (5 November 2010). "Linux Plumbers Conference: Life after X (reporting a talk by Keith Packard)". LWN.net. 
  6. "Wayland FAQ". Retrieved 17 February 2011. 
  7. Kristian Høgsberg (9 November 2010). "Network transparency argument". 
    "Wayland isn't a remote rendering API like X, but that doesn't exclude network transparency. Clients render into a shared buffer and then have to tell the compositor (...) what they changed. The compositor can then send the new pixels in that region out over the network. The Wayland protocol is already violently asynchronous, so it should be able to handle a bit of network lag gracefully. Remote fullscreen video viewing or gaming isn't going to work well, [but] I don't know any other display system that handles that well and transparently."
  8. Michael Larabel (18 August 2011). "Remote Wayland Server Project: Does It Work Yet?". 
  9. Adam Jackson (ajax) (9 November 2010). "[Re:] Ubuntu moving towards Wayland". 
  10. Stone, Daniel (1 February 2013). The real story behind Wayland and X. 42:00 minutes in.  Presentation at linux.conf.au 2013.
    "[W]e think it's going to better at remoting than X."
  11. 11.0 11.1 "The Wayland Situation: Facts About X vs. Wayland". Phoronix.com. 2013-06-07. p. 2. Retrieved 2013-07-18. 
  12. "XDC2012: Graphics stack security". LWN.net. Retrieved 2013-07-18. 
  13. Stone, Daniel (2013-01-28). "The real story behind Wayland and X linux.conf.au". 
  14. "Wayland architecture". freedesktop.org. Retrieved 2013-07-18. 
  15. Corentin Chary (21 June 2011). "Introducing xwayland and xf86-video-wlshm". "This driver really make things easy to test, since you don't need any specific hardware...." 
  16. Darxus (27 November 2010). ""hosted" patch for nouveau – X under Wayland". "It's possible to run X.org as a client of Wayland, rootless or not, if you have an Intel video card" 
  17. "Getting started with Lighthouse". Retrieved 17 December 2010. 
  18. Kristian Høgsberg (25 January 2011). "Add wayland lighthouse plugin". 
  19. Nokia (15 December 2011). "Qt Lighthouse git-repository". 
  20. Michael Larabel (22 December 2010). "GTK+3 Now Uses X Input 2 By Default, New Back-End Caps". 
  21. Matthias Clasen (21 December 2010). "GTK+ 2.91.7 released". 
  22. Kristian Høgsberg (3 January 2011). "Multiple backends for GTK+". 
  23. "Wayland Backend DRM | IVI Layer Management". GENIVI Alliance. Retrieved 2013-07-15. 
  24. "Maliit Status Update". Posterous. April 2, 2013. Archived from the original on 2013-05-17. Retrieved 2013-10-14. 
  25. "More Maliit Keyboard Improvements: QtQuick2". Murray's Blog. 2013-04-02. Retrieved 2013-10-14. 
  26. "Maliit under Wayland". Retrieved 2013-09-14. 
  27. 27.0 27.1 Richard Hillesley (13 February 2012). "Wayland – Beyond X". The H Open. Heise Media UK. p. 3. 
  28. "Mesa/Gallium3D Gets Its First ARM SoC GPU Driver". Phoronix. 2013-03-12. Retrieved 30 July 2013. 
  29. Rob Clark (30 July 2013). "freedreno update: drm/kms and ifc6410". Blogspot. Retrieved 30 July 2013. 
  30. "Nouveau Merged". Phoronix. 2006-12-20. Retrieved 2013-07-30. 
  31. 31.0 31.1 Michael Larabel (8 November 2010). "NVIDIA Says It Has No Plans To Support Wayland". Phoronix. 
  32. "Red Hat Picks Up Another Graphics Driver Developer". Phoronix. 2013-02-15. Retrieved 2013-07-30. 
  33. "Red Hat Talks About Nouveau, Open-Source Drivers". Phoronix. 2010-05-11. Retrieved 2013-07-30. 
  34. "The First Jolla Smartphone Runs With Wayland". LinuxG.net. 2013-07-14. Retrieved 2013-10-08. 
  35. "sailfishos main components diagram". 
  36. "our first Jolla will ship with wayland, yes". 
  37. "IVI/IVI Setup". Tizen Wiki. Retrieved 2013-04-08. 
  38. "[IVI] Tizen IVI 3.0-M1 released". Tizen.org. Retrieved 2013-07-15. 
  39. "Enlightenment and EFL backing Wayland". Enlightenment.org. 2013-03-14. Retrieved 2013-07-15. 
  40. "Package wayland". Fedora Project. Retrieved 2013-07-15. 
  41. "Wayland and Fedora". Lists.fedoraproject.org. Retrieved 2013-07-15. 
  42. "You Can Now Run GNOME Shell Wayland On Fedora 20". Phoronix. 2013-10-03. Retrieved 2013-10-08. 
  43. "GNOME / Wayland in Fedora". 2013-10-03. Retrieved 2013-10-08. 
  44. Larabel, Michael (13 March 2013). "GNOME Will Move Full-Speed With Wayland Support". Phoronix. Retrieved 8 Apr 2013. 
  45. "GNOME 3.10 Has Been Officially Released". Phoronix. 2013-09-25. Retrieved 2013-10-08. 
  46. "3.10 Released!". GNOME. 2013-09-25. Retrieved 2013-10-08. 
  47. Grässlin, Martin (28 November 2010). "KWin runs on OpenGL ES". "It does not only help, it is a must have to start working for Wayland. So to say it’s the first part of the KWin port to Wayland" 
  48. Grässlin, Martin (2011-01-19). "On the Road to Modern OpenGL (ES)". Retrieved 2013-07-31. 
  49. Grässlin, Martin. "KWin Hacking++". Retrieved 2013-04-08. 
  50. Larabel, Michael (14 June 2013). "KDE 4.11 Beta Released, Works On Wayland". Phoronix. Retrieved 16 June 2013. 
  51. "Raspberry Pi Case Study". Collabora. Retrieved 2013-08-09. 
  52. "Wayland preview". Raspberry Pi. Retrieved 2013-08-09. 
  53. "Clutter on Wayland". Retrieved 28 March 2012. 
  54. "Wayland – Enlightenment". Retrieved 6 March 2013. 
  55. "GTK+ 3.10 release mail". 2013-09-23. Retrieved 2013-09-24. 
  56. "Documentation of the Wayland support in GTK+". 2013-09-03. 
  57. "Toolkits on Wayland". Retrieved 28 March 2012. 
  58. e-releasemanager (2013-08-18). "A Double Dose Of The W |". E19releasemanager.wordpress.com. Retrieved 2013-08-23. 
  59. Grässlin, Martin. "The History on Wayland Support inside KWin". Martin’s Blog. Retrieved 2013-07-15. 
  60. "Clayland". GitHub. Retrieved 2013-08-11. 
  61. README file from the Wayland source code repository
  62. Stone, Daniel (1 February 2013). The real story behind Wayland and X. 38:46 minutes in.  Presentation at linux.conf.au 2013.
    "It doesn't require GL. Nothing in Wayland requires GL."
  63. Kristian Høgsberg (9 December 2010). "Blender3D & cursor clamping.". 
  64. "Wayland". Wayland.freedesktop.org. Retrieved 2013-07-15. 
  65. Høgsberg, Kristian (24 July 2012). "Wayland and Weston 0.95.0 released". Wayland mailing list. Retrieved 14 July 2013. 
  66. Høgsberg, Kristian (22 October 2012). "Wayland and Weston 1.0". Wayland mailing list. Retrieved 14 July 2013. 
  67. Scherschel, Fabian (23 October 2013). "Wayland's 1.0 milestone fixes graphics protocol". The H - Open. Heinz Heise. Retrieved 14 July 2013. 
  68. Larabel, Michael (16 April 2013). "Wayland 1.1 Officially Released With Weston 1.1". Phoronix. Retrieved 14 July 2013. 
  69. "1.1 Released". freedesktop.org. Retrieved 2013-07-18. 
  70. Larabel, Michael (6 January 2013). "A Software-Based Pixman Renderer For Wayland's Weston". Phoronix. Retrieved 14 July 2013. 
  71. Larabel, Michael (13 July 2013). "Wayland 1.2.0 Released, Joined By Weston Compositor". Phoronix. Retrieved 14 July 2013. 
  72. "Wayland and Weston 1.2.0 released". Lists.freedesktop.org. 2013-06-28. Retrieved 2013-07-18. 
  73. "Wayland and Weston 1.3 release notes". 2013-10-11. 
  74. "Wayland and Weston 1.4 is out". 2014-01-24. 
  75. http://worldofgnome.org/gnome-3-12-release-might-slightly-rescheduled-and-wayland/
  76. Høgsberg, Kristian. "Wayland – A New Display Server for Linux". Linux Plumbers Conference, 2009.  (Video available here )
  77. Høgsberg, Kristian. "EGL and GLES1/2 on Linux". Linux Plumbers Conference, 2010. 
  78. "Interview: Kristian Høgsberg". FOSDEM 2007. 6 February 2007. 
  79. Høgsberg, Kristian (8 September 2008). "DRI2 Protocol Spec Draft". 
  80. Høgsberg, Kristian (31 March 2008). "DRI2 Direct Rendering". 
  81. "An Experimental GNOME Shell Running On Wayland". Retrieved 6 Apr 2012. "Founder Kristian Høgsberg responsible for key X improvement of the past few years: DRI2...." 
  82. "Wayland Becomes A FreeDesktop.org Project". Phoronix. 2010-10-29. Retrieved 2013-07-31. 
  83. Kristian Høgsberg (2010-10-29). "Moving to freedesktop.org". Retrieved 2013-07-31. 
  84. Larabel, Michael (22 November 2010). "Wayland License Changing To LGPLv2". Phoronix. Retrieved 21 September 2011. 
  85. Larabel, Michael (20 September 2011). "Wayland Reference Code Being Re-Licensed". Phoronix. Retrieved 21 September 2011. 
  86. Carsten Munk (2013-04-11). "Wayland utilizing Android GPU drivers on glibc based systems, Part 1". Mer Project. Retrieved 2013-07-03. 
  87. Munk, Carsten (2013-05-08). "Wayland utilizing Android GPU drivers on glibc based systems, Part 2". Mer Project. Retrieved 2013-07-03. 
  88. "Jolla Brings Wayland Atop Android GPU Drivers". Phoronix. 2013-04-11. Retrieved 2013-07-03. 
  89. Aaron Plattner, nvidia's primary Linux developer (7 November 2010). "nvidia and the wayland display server". "We have no plans to support Wayland." 
  90. "Nvidia drivers 331.13 beta". 2013-10-04. Retrieved 2013-10-05. "Added support for the EGL API on 32-bit platforms. Currently, the supported client APIs are OpenGL ES 1.1, 2.0 and 3.0, and the only supported window system backend is X11." 
  91. "NVIDIA Releases Major Linux Driver With New Features, EGL". Phoronix. Retrieved 5 October 2013. 
  92. "Unterstützt Nvidia Wayland und Mir?". Golem.de (in German) (Klass & Ihlenfeld Verlag GmbH). Retrieved 5 October 2013. 
  93. Daniel Stone (March 2013). "The real story behind Wayland and X linux.conf.au". Ars Technica. 
  94. Evan Jenkins (March 2011). "The Linux graphics stack from X to Wayland". Ars Technica. 

External links

This article is issued from Wikipedia. The text is available under the Creative Commons Attribution/Share Alike; additional terms may apply for the media files.