Why Wayland & Weston Were Forked

Written by Scott Moreau in Software on 29 March 2013 at 02:05 PM EDT. Page 1 of 4. 131 Comments.

Last week, Wayland/Weston was forked by a long-time contributor, Scott Moreau. The fork of the Wayland/Weston display server ended up becoming known as Northfield/Norwood, following disagreements within the Wayland development camp. Scott Moreau was ultimately banned from the Wayland mailing list and IRC channel, so he's written an exclusive, independent article for Phoronix to explain his actions and why he felt a fork of the Wayland display server protocol and the reference Weston compositor were necessary.

Northfield/Wayland Split - Technical Aspects

Since there are many interested parties involved here, I spent some time assembling this writeup. I would like to change the tune to more positive notes that intend to introduce insight and reason into the picture. Since my actions inadvertently caused a significant disturbance, I feel that I owe it to everyone to explain the technical problems from my point of view. I would like other people to understand the problem as well and see how they might solve it, given the pertinent details. This an involving issue touching on many technical details. This is my attempt to fully explain the issues to all audiences.

It is noteworthy that these views are my own and may not be completely correct. I do not know everything nor do I claim to. There's nothing wrong with being wrong about a technical understanding. In fact, voicing ideas can be a good thing, because it encourages others with further insight, to share their knowledge and start a productive conversation. I will try to explain this in basic and technical terms as best I can.

First, we need to talk a bit about how wayland, weston and wayland clients work together to form a composited image.

Definitions:
- Wayland Display: wl_display: The core global object. A pointer to a wl_display. Used for internal wayland interfaces.
- Wayland Buffer: wl_buffer: The contents of a wl_surface.
- Wayland Surface: wl_surface: This is an image that is displayed on the screen. It has a location, size and pixel contents.
- Wayland: The term Wayland in this context implies two closely related things:
1) A wayland protocol
2) An implementation of this protocol in C
- Weston: The official wayland reference compositor. This is the program that represents the core compositing program
- surface: The term 'surface' is used here to denote 'an application window'

In order for clients to render their content into wayland composited surfaces, it needs to do a few things.

At a basic high level of abstraction these are:

1) Connect to the wayland wl_display - Using wl_display_connect().
2) Create a wl_buffer in which to render content - Buffer creation method varies by type.
3) Draw something - Typically using cairo or GL (though client rendering is not restricted to any specific method).
4) Tell the compositor to show the wl_surface - This is handled by the compositor and shell plugin.
5) Repaint the surface and notify the compositor that the rendering has finished - this can be done by calling wl_surface_damage(), wl_surface_attach() and finally wl_surface_commit() as the sync point. In the EGL case, eglSwapBuffers() uses these specific wayland calls from mesa internally to 'refresh' the surface.
6) Repeat step 5) as necessary for the life of the program.

The compositing program then takes all of these surfaces and paints them to a final buffer that is suitable for output.

The primary argument against the need for a fork is one that sounds reasonable at first:

Why not just fork the shell plugin alone?

This was a suggestion given by many. An example representation of such reasoning can be found in this wayland-devel mailing list post: "What you could aim instead is a new tree with your own shell plugin and stack over the core protocol another high level surface protocol."

Related Articles