If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Wayland: A New X Server For Linux

Phoronix: Wayland: A New X Server For Linux

It's no secret that much of the code-base that makes up the modern-day X.Org Server is old and in some places bloated. The X.Org Server continues to evolve and has received a number of major additions in recent times, but wouldn't a clean and lighter server that is designed around today's needs be ideal? Red Hat's Kristian Hogsberg has started a new project, which is currently known as Wayland, and is just that: a new lightweight X Server. Wayland isn't just a rewrite of the current X Server, but instead it's a small server that is designed around some of the latest graphics technologies such as kernel mode-setting and the Graphics Execution Manager. Wayland also has its own built-in compositing manager.

perhpas this is the best thing that xorg could happen. an xserver with only the best new developments from x.org. mpx, gallium, xip2, a clean multi-threaded app... any chance to have gallium3d in this? and is it that heavy to port gtk+ and qt to this?

As far as I can tell, Wayland is not an X server at all, but rather implements its own (currently incomplete and experimental) protocol. The only mentions I see of X are in the sense of running an X server on top of Wayland.

I think this is an interesting approach to modularizing the display system. The component that actually controls the display becomes very lightweight; implement a X11 server on top of it, and you have a completely compatible desktop that should be much more reliable and flexible.

This approach reduces attack surface and improves reliability by massively reducing the amount of code that runs as root: only Wayland itself needs to run as root to control the display. (Or at least that's my understanding.) Since the X11 server itself runs as the user, the X11 server becomes inherently safe in terms of security issues, and crashes/hangs don't effectively bring down the system. This approach should also improve the perceived smoothness of the environment even under heavy load: the Wayland desktop does a relatively small amount of work for any given request, so it should be able to react quickly even when the X11 server is busy doing some expensive operations.

It also increases flexibility because Wayland is small enough that large changes are easily feasible. One interesting possibility is nesting a Wayland desktop into another; this is nearly trivial because it just requires changing Wayland to render to a Wayland surface instead of rendering directly. This could be useful for smooth fast user switching or completely reliable desktop virtualization, among other things.

I don't think it makes sense to actually port applications to Wayland at all: a toolkit trying to implement a desktop directly on top of Wayland would end up duplicating large parts of X11, which seems like a step backwards. And implementing components like a full compositing manager or clipboard in Wayland itself complicates the implementation of Wayland, which also seems like a step backwards. Even something as simple as the login dialog requires services like an IME, and using a different infrastructure for implementing it seems like unnecessary work; I think it makes sense to give the login dialog its own low-privilege X11 server, and implement the authentication layer below that, so that the code to display the login dialog becomes much less security-sensitive.

If I were designing this, I think I would draw the line between outside and inside of Wayland at the point where it's feasible to implement an X11 server on top of Wayland: Wayland would have just enough functionality to read input from the user and send graphics to the user, so for a normal desktop it roughly acts as an abstraction layer between the destop and the mechanisms for managing the desktop.