INTERVIEW DANIEL STONE

X WINDOWS, WAYLAND AND THE FUTURE OF Will 2014 be the year of Wayland on the Desktop? Daniel Stone thinks so, and Ben Everard caught up with him to find out why.

Windows first came out 30 at Collabora. He gave us the low-down years ago, and it’s been at on what the problems are with X, why X the centre of and Linux Wayland is better, what’s happening graphics ever since. However, times with the project and when we’re likely have changed, and X often struggles to see it come to fruition. to take advantage of the capabilities Along with helping regular Linux of modern graphics hardware. users get snappier graphics, Collabora Linux needs a new display server, are working with the Raspberry Pi and Wayland is the software that foundation to use Wayland to unlock many people hope will keep Linux the graphical powers of the little graphics moving forward. computer and create a much Linux Voice headed over to smoother . Cambridge to meet Daniel Stone – a Despite a lot of talk, it hasn’t yet long-term X contributor, prominent shipped in a major distro, though this Wayland developer and graphics lead should change by the end of the year.

What will a regular Linux user there completely solid. I’m running alternate windows systems. If you go notice when they install a Gnome with Wayland on my back to kind of Berlin, Fresco or KGI, distribution with Wayland for the laptop, and it’s actually really quite good. they just suffered really badly because first time? I hadn’t really tracked any of or there were no video drivers at all. There Daniel Stone: Our main aim is to get Gnome shell, so I was quite surprised by was barely any toolkit support. Definitely out of the way! With X, you’ve got the X how quickly they were able to get it up. no 3D support. So yeah, just getting server, the manager and the over that mountain was really difficult. clients. You’ve kind of got a window What have you found the But now half of the Mesa internals have manager and a compositing manager biggest challenges to be in been rewritten. It’s just been a really and there’s a three-way disaster. developing Wayland? really long slog. We’ve tried to make that whole DS: It’s sort of been this 10-year Just trying to convince people that it’s architecture as simple as possible – or ongoing thing. It’s the culmination of actually ready and usable has been make the protocol as simple and everything we’ve done in X since about really tough as well. Around about a straightforward as possible. I guess 2004. It’s not called X12, because it’s a year ago we had this huge spurt in that’s the big thing: always being very different windows system [from development – to be fair I think you can smooth and responsive and good. X11], but a lot of the work we did to look partially attribute that to , but a lot of at things like kernel mode setting, DRI2 that was that Red Hat had finished an Do you have any idea when – all of that kind of thing – they’re all enterprise cycle and suddenly they had we’re likely to start seeing really designed to get X out of the way a lot of guys come out and say “now Wayland… Other than on Rebecca as much as possible. Partly because we’re actually free to start working on Black OS of course. architecturally it was the right thing to this”. That really got us from a stage of DS: Oh my God, why is it called that? It’s do, but then also there’s an explicit goal “we’ve got a windows system that looks starting to appear. Fedora 21 – it’ll be to make it possible to actually develop like it should work and we’ve got these

40 www.linuxvoice.com DANIEL STONE INTERVIEW

“So far Nvidia are the only ones who’ve tipped their hat and said “yes, we are working on Wayland support.”

toy clients; GTK kind of works and we’ve Avanti, Qualcomm and Broadcom – if DS: Mobile is a lazy shortcut for got this toy desktop environment” to you want 3D, all of those need to add Arm-based! Wayland has been shipped “we know this actually works and runs support to their drivers. That’s about as in a set-top box a couple of years ago, a well on a proper fully-fledged desktop” much as I can say, unfortunately. TV and also the Jolla phone, so in terms – that’s only quite recent. of actual mobile, we’re in a really good Is it likely to be a difficult job spot because we worked together with Intel has been quite active. to get drivers to run Wayland the Jolla guys to do libhybris [a How have the other hardware on the desktop? compatibility layer to allow glibc-based manufacturers responded to DS: It shouldn’t be! If it isn’t seamless software to run on bionic libc (the Wayland? then we’ve done something really badly Android library) systems]. We sort of DS: For 2D support, if you have kernel wrong. On the desktop it should be did two halves of it, then they glued it mode setting [KMS], then that’ll just totally fine. Mesa supports it fine, and together where you can reuse the binary work fine. For 3D support, Nvidia have they all have KMS support, so in that blob – or if you have source, even better. said publicly that they’re working on sense, it should be completely You can re-use the Android vendor Wayland. Then you’ve got Arm with the seamless. On mobile, it’s just up to the drivers you get, and that just adds Mali GPU, Imagination, PowerVR and manufacturer. So far, Nvidia are the only Wayland to any Android-capable ones who have actually tipped their hat platform. That’s used on the Jolla and said ‘yes we are working on Sailfish phone. If the switch to Wayland isn’t Wayland support’. “ Do you mind telling us a bit seamless then we’ve done When you say on mobile, about how you got started something really badly wrong. which mobile platform are you contributing to open source and ” talking about? Free Software?

www.linuxvoice.com 41 INTERVIEW DANIEL STONE

Wayland has brought huge improvements to the graphics of low-power devices such as the Raspberry Pi.

DS: I think I got started with either KDE when we had the old build system with Gnome Shell and Mutter are separate. It or , I can’t remember how. everything whacked in one and it took a shouldn’t look any different than it does day to build. Modularisation was really now where you just pick a window Was it KDE on Debian? great, but we kind of took it one step too manager basically. DS: There was also that, but that far and ended up with something like was later on. Yeah, I just trundled along 380 different modules. Most of them What would you say you’ve doing a couple of small KDE bits on never change, but it went a bit too far in learned from XFree86? It’s one their IM client (Kopete), and a lot of the other direction. Now we’ve just got of the best pieces of software, and packaging in Debian. For some reason, I Wayland and Weston and whatever GL it’s adapted and interconnected ended up maintaining Apache 2 and stack you have. Fingers crossed, it won’t everything. Is there anything from KDE and then started working on get out of hand! the success of X that’s gone into XFree86, which I kind of got tricked into. Wayland? Like that the client and the From a user’s perspective, will server are the wrong way around? So you got all the good jobs! they need to know the DS: We kept that one! I guess it’s DS: Yeah! I was working at a compositing manager from the easiest to look at the things we did college at Melbourne Uni and they said ? differently. X has this awkward thing “We’ve just got this new lab and we DS: We merged those! The key where the clients mostly render need a new version of X to support the architectural change is that the window everything, but then you get the server new Intel GPU. Do you reckon you could manager and the compositing manager to do about a third of it. do that?” I thought that’d take about a got merged into the display server, so Longevity is kind of hard to pick week, then a year later… That was right we’ve got Weston, which is our because, as I said, we spent 10 years about the time of the XFree86/X.org reference compositor, and that has digging all of these bits out of X, and split. Somehow I did the modular build plugins. It’s got a super basic UI on top before that, there was no real alternative system for the X server, then I did a of that. The IVI [In-Vehicle Infotainment] either. It’s partially artificial. I guess it bunch around that, and I gradually got guys have been working on their own taught us that no matter how high you dragged into working on the core server. shell for automotive stuff. make the barrier to entry, people will still It was pretty much 11 years ago… I’m The new desktop we released for the do it. I’ll have to think about it… still here! It was a miss-spent youth. Pi, called Maynard, is a Weston module. It runs in-process, which is really nice, We suppose X always did the How much easier is Wayland but by the same token, we don’t have to job, despite being complicated. going to be to package than re-invent the compositor. DS: It’s definitely mostly good enough. It XFree86 was? Other projects like Kwin – I think – are was quite easy to push it in some quite DS: So much easier! It was a disaster doing their own compositor. Definitely unexpected directions, so it was this

42 www.linuxvoice.com DANIEL STONE INTERVIEW

infinitely flexible framework that you Will there be an easy out of X, and also libhybris which we could make do almost anything. equivalent to VNC? originally did to run Wayland on Android DS: There’s already an RDP [remote – they were able to take that and run We remember being amazed desktop protocol] back-end for Weston, Mir on top of it instead. We’re both that you could get anti-alised and the RealVNC guys have been on the standing on the same foundations. fonts. Just the fact that you could Wayland list looking into doing patch something old to come up something quite similar. One of the Do they re-use your driver with something new. Then wobbly things we did – it’s almost a happy hooks? windows as well! accident, but partly by design – makes DS: No. Not for EGL. DS: That was a blessing and a curse! it much easier for the compositor to Inside the X server, it’s not a clear, stream out windows externally, so you So they have their own? straightforward process that everything can do things like the hangouts or DS: The last time I looked, they flows through. You’ve got this one Skype-style screen show. hadn’t got that far yet. They can’t re-use the EGL hooks directly because the EGL How much work is it to convert extension is literally: here is a struct for “We just kept adding more an X driver to Wayland? the display, and you can call Wayland DS: Not a lot if you already have methods on it. It’s so baked into that layers… in the end it made it something that can already to a that they can’t re-use it. In terms of the really hard to work with.” composited X server, which is fewer open source infrastructure, they than you’d think. wouldn’t have been able to do that without KMS, much like we couldn’t massive structure that everything Is it just renaming a few of the have done Wayland without it, without hangs off which has about 50 function calls? all the Mesa EGL work, without libhybris, pointers in it, and everything goes DS: Simplifying a lot of them! One of the without XKB being common (which I did through those. We just kept adding things we did which ends up making it a for Wayland) they wouldn’t have more and more layers. It was great that lot easier for driver manufacturers is – keyboard handling. It also took a hell of it allowed us to do that, but in the end it you know previously the X server would a lot of work to go into GTK 3 and make made it really hard to work with. load the graphics driver which was it not just an X-only toolkit. Mir re-uses Things like composite were done with specific to the 3D hardware and the all of these foundations as well. the core being completely unaware that display controller, and then you had your the composite was ever there. We just client-side GL library and they had to Does this mean you’ll need wrapped everything up and did a couple agree on a protocol. You had to get this separate drivers for Wayland of tricks on the way in and undid them marriage between what you had on the and Mir? on the way back out. It made it client and the X server driver you had, DS: There’s now an EGL platform incredibly fragile and hard to work with. and your display controller as well. We extension which now says instead of ‘I Things like minor rendering bugs (like broke that out quite nicely. That was want to open a display’, ‘I want to open when the screen flashes black for a something that took a couple of an X display’, or ‘I want to open a Mir second) – you wonder why that iterations of refining before we got right, display’, so you can now ship a single happened and three weeks later you but it’s now split out so that all of the blob which supports all of them. come out with the answer. Wayland 3D stuff in the GL library rather than the X server that had an API But it would need to have the that changed about every six months. Mir bit in it as well as a Wayland bit? Will Wayland make it easier for DS: Exactly. The Wayland part of that Nouveau, Lima and the open extension is already ratified by Khronos, driver projects? and that’s part of their official set of DS: Most of their complexity is extensions unrelated to be honest. We’ve got a nice clean split between the windowing Will 2015 be the year of system and the actual rendering – Wayland on the desktop? which is reflecting in the GL and GLES DS: I think so. We’re already seeing it in – so it doesn’t make any odds to them set-top boxes because for that kind of to be honest! All that infrastructure’s in stuff where we can say “We can core Mesa and they don’t have to deal guarantee you super low latency, and no with it – much as I’d love to say yes. jitter – you can actually use overlays, which you can’t in X, that sort of thing”. What are your thoughts on They’ve already taken a shine to it. I “Intel are hugely involved in Mir? really hope Fedora 21 give the desktop a Wayland development – they are completely behind it. DS: They’re doing their own thing. That bit of a kick. It is actually really builds on ten years of us extracting stuff remarkably solid, at least on Gnome.

www.linuxvoice.com 43