3 ms·
Not many people use X forwarding, and X isn't really network transparent anyway. The X wire protocol is so chatty that modern clients do anything they can to wo
by bitwize 8y ago
Not many people use X forwarding, and X isn't really network transparent anyway. The X wire protocol is so chatty that modern clients do anything they can to work around it. See this Daniel Stone talk: https://www.youtube.com/watch?v=RIctzAQOe44 https://www.youtube.com/watch?v=RIctzAQOe44
- toast0 8y ago> The X wire protocol is so chatty that modern clients do anything they can to work around it. So there's two things here. Part one is modern clients render everything on the client, instead of the original design of X where clients more or less sent geometric things down the wire; this makes much nicer looking and more functional windows, but it is also a lot more data. Classic X has a single stream, so you get everything great about that; that's part of why everything works better locally -- the big chunks of data skip the socket, and there's much rejoicing. The other thing is not a fault of the wire protocol, but of programing (much of it in xlib) -- at around 23:14 in the video, gedit startup is described as 130 blocking InternAtom calls, 34 blocking GetProperty calls, and 116 property change requests, resulting in upwards of 25 ms sitting around waiting for the Xserver. But --- there's no reason that you can't send all the atoms you want in one go, maybe some are dependent on earlier responses, but even then, it should be a couple round trips, not 130 for atoms. Once you have enough atoms, you can start the getpropery calls; there's likely to be more dependencies there, but still. These things that block, but shouldn't, combined with the realities of shipping large data over the same pipe as commands is what has made remote X11 work worse over time, to the point where it's fairly unworkable. There's a couple X11 protocol issues that make window management really hard (some things should really have been made synchronous), but there has been no ability to change the protocol, which is clearly a problem. The reason that people are still really attached to networked X11 is because, even though it's often crappy, and it's gotten worse over time, is that when it's useful, it's really useful. Honestly, all the discussions of Wayland seem to be "X is terrible, we're doing something else, but not everything is ready; oh and there's a lot of stuff in flux still" Maybe that's an unfair summary, and I feel better about Wayland after watching the talk; but it would be nice if there was a way to use it to fit my workflows. And I'll always wonder if making xlib not suck, and being willing to change X11 protocol over time wouldn't have gotten us to a better place faster.
- derefr 8y ago> Part one is modern clients render everything on the client, instead of the original design of X where clients more or less sent geometric things down the wire Ever since we've moved to the paradigm where window rendering and compositing happens on the GPU, I've been wondering whether the X11 protocol would make a comeback. After all, from the CPU's perspective, we're essentially doing what X11 does again: sending descriptions of geometry and texmaps to "somewhere else", where they're put together, and then referring to the elements we've sent by handles we got back from the "somewhere else." That somewhere else is the GPU. In the case of combining GPU rendering with X11, we're doing a weird sort of dance (direct rendering) where—just in this one case—the X11 server allocates a GPU handle, and then we get an X11 handle wrapping the GPU handle, from which we can extract the GPU handle and reference it in GPU commands, with X11 being able to use the result as, essentially, an X11 texmap in the compositing process. (Wayland is the same, just with more efficient compositing and no other primitives than the DRI surface.) But what if we went the other way: gave the X11 protocol primitives for all of the primitives that GPU drivers expose, such you X11 is essentially acting as a proxy for the GPU? So, instead of speaking to the GPU and getting GPU handles back, we'd be speaking to X11 and getting X11 handles back, which—on the X11 server side—would be toll-free-bridged to GPU handles? You could take any code that makes OpenGL calls, and just switch out the DRI OpenGL driver for an X11Client OpenGL driver, and it would all suddenly be network-transparent (with not even that much overhead for the loopback case, because these are high-level commands streaming over the socket, not pixbufs.) An X11 "display server" would be made into, in effect, a network-transparent "virtual GPU." (Which, of course, you could also implement yourself in software—xvfb would handle X11GL messages just fine, doing internal Mesa software rendering in response.)
- toast0 8y agoI'm rather uninformed about the nuts and bolts of rendering: my dabbling in X includes getting things to more or less work as a user of an X desktop, with varying degrees of success since about 1997 but also a bit of wire protocol tweaking with ex11, an erlang x11 client protocol library, just enough so I could output images from an erlang program at 3 frames per second without the background color flashing I was getting with the wxWindow bindings. I debugged some crashes I was having, and added interfaces to set window titles and window dimensions via ICCCM standards. But, with that meager background, it sounds like you may be describing GLX? Originally, that supported OpenGL over the network, although later versions stopped working, because it was hard/nobody cared enough. Although, the spec says that GLX 1.4 only supports up to OpenGL 1.3; and my understanding is the newer versions of OpenGL are a lot easier to work with / better specified. And/or Vulkan is supposed to be cool? :)