News for hackers. Stuff that matters.
Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by Spivak on Friday March 12, 2021 @02:44PM (#26440045)
This is more a culture thing than anything technical. Wayland is meant as a replacement for X which is "just" the wire protocol that windows use to talk to the display server. But compositors like Sway, Mutter, and Kwin are angling to replace Xorg, the single monolithic display server that happened to speak X. Xorg could have just added Wayland support (in theory not in practice) and so the death of Xorg left a huge hole that everyone is trying to fill and no dominant project as emerged yet and Wayland has made it easier than ever to just DIY.

To me this is a good thing because having multiple competing implementations of a standard makes the standard authoritative and avoids the "do what Xorg does" problem.

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by sprash on Friday March 12, 2021 @03:08PM (#26440296)
> angling to replace Xorg

The Xrandr extension enabling all this functionality is defacto part of the X11 protocol for a long time and not just "Xorg".

> Xorg could have just added Wayland support

You already can run any Wayland client in Xorg with a simple Weston wrapper script. However since X11 supports DRI3 which is as efficient as Wayland will ever be it is completely pointless.

> To me this is a good thing

Speak for yourself. For me standardization is a good thing. The "Desktop" is essentially a solved problem. There is no reason to invent a new incompatible standard every week. What is happening here is the opposite of standardization.

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by d110af5ccf on Friday March 12, 2021 @05:16PM (#26441635)
> The "Desktop" is essentially a solved problem.

Serious question, what are the key differences and tradeoffs between the DRI3 and Wayland APIs? I've done some OpenGL programming, but always in a fully abstracted manner (ie using cross platform wrapper libraries).

As a bystander, my impression is that the real issue (outside of refactoring a massive codebase & associated ecosystem on a volunteer basis) is one of security and efficiency. Without reworking the underlying protocol to require compositing, how do you properly sandbox applications from one another? And as long as you're making such a significant overhaul, why not throw out a bunch of cruft and split off any extra functionalities into their own standards? And as long as you're doing all that, why not completely restructure the protocol to handle things like minimized windows updating thumbnails of themselves at an interval determined by the compositor?

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by sprash on Friday March 12, 2021 @06:33PM (#26442270)
> Serious question, what are the key differences and tradeoffs between the DRI3 and Wayland APIs?

DRI3 gets you a file descriptor which can be used as a DMA-Buffer to directly render and present graphics. The Wayland protocol never clarifies how the compositor is supposed to implement the rendering but in practice the current implementations do exactly the same thing as DRI3 except in the case of GNOME and KDE on proprietary drivers from NVIDIA which use nvm_eglstreams.

> As a bystander, my impression is that the real issue is one of security and efficiency.

That is correct. As of now X11/Xorg has very broken security.

> Without reworking the underlying protocol to require compositing, how do you properly sandbox applications from one another?

There are many X11 security protocols already standardized [1,2,3] using access control hooks which lets you sandbox any aspect of your application but no client and/or toolkit ever adopted it. Also the current implementation of xinput invalidates many of those protocols.

> And as long as you're making such a significant overhaul, why not throw out a bunch of cruft and split off any extra functionalities into their own standards?

Wayland shows in a very painful way that those functionalities are strongly interdependent and untangling them leads only to more protocol overhead.

> And as long as you're doing all that, why not completely restructure the protocol to handle things like minimized windows updating thumbnails of themselves at an interval determined by the compositor?

That is a very specific problem, however A custom xcompmgr implementation would allow you do that today on X11.

1.: https://www.x.org/wiki/Development/Documentation/Security/

2.: https://www.x.org/releases/current/doc/xextproto/security.ht...

3.: https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/Xserv...

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by d110af5ccf on Friday March 12, 2021 @10:50PM (#26443759)
Thanks for the detailed answer, those security protocols in particular are quite interesting.

Regarding rendering callbacks (thumbnails & etc), it's perhaps not as specific a problem as it might seem. In classic OpenGL, the potential to block the render loop (and thus the entire window event system) when placing a swap buffer (ie present) call is incredibly frustrating. Also, particularly on resource constrained devices, an event driven approach can be quite useful (both for performance and battery reasons). It's generally just a much more flexible model overall.

You mentioned a custom xcompmgr implementation. I didn't think X11 used a callback model though? Was I mistaken? (Again, I've only ever done cross platform OpenGL code using wrapper libraries. That's always involved a potentially blocking call to swap the buffer at the end of the render loop in my experience.)

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by zbuf on Friday March 12, 2021 @06:09PM (#26442072)
> > Xorg could have just added Wayland support

> You already can run any Wayland client in Xorg with a simple Weston wrapper script. However since X11 supports DRI3 which is as efficient as Wayland will ever be it is completely pointless.

Far from completely pointless, it sounds useful to run Wayland applications on X11; and could well be a useful contingency or ease to transition.

Do you have a link or more detail on which script and how to do this?

Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by pedrocr on Friday March 12, 2021 @03:16PM (#26440367)
It's a little bit more than just culture. The Wayland protocol has made the compositor, window manager and window server concepts a single thing whereas in X those are provided by different applications talking a standardized protocol. It did that for good reason and there are technical ways to then implement those parts with common code still. But since that sharing is not enforced by the protocol itself there's still duplication of things that in the Xorg world were more stabilized with no real competing implementations.
Re:Gnome 40 Introducing Headless Native Back End, Virtual Mo... by d110af5ccf on Friday March 12, 2021 @04:58PM (#26441491)
> more than just culture. The Wayland protocol has made the compositor, window manager and window server concepts a single thing

I realize that any implementation of the Wayland protocol must of necessity involve compositing somewhere in the stack simply due to the nature of the protocol itself. And I also realize that all current Wayland "compositors" happen to roll all this functionality into a single monolithic implementation. But I honestly don't understand what's stopping someone from implementing a modular Wayland display server which you plug a conforming compositor into (with the caveat that, unlike X11, such a module would not be optional).

Is there some technical issue I'm unaware of that would prevent a standalone display server implementation speaking the Wayland protocol from delegating all the necessary behavior via indirection?