Hi everyone!
It's been some time since our last Wayland driver update ([1]), and, with the year coming to an end, I wanted to share information about the progress we made this year and discuss future steps.
The focus in 2022 was on maturing the Wayland driver and keeping up to date with the Wine upstream internal changes. This involved, among other things, splitting the driver into a PE and Unix part, updating it for the latest internal driver APIs, and making preparations to support WoW64 (we are not there yet, but we are close).
A significant improvement compared to last year is support for cross-process rendering, which is required by Chromium/CEF applications. Last year the driver was able to run Chrome with the "--in-process" command-line option. This year Chrome is supported without any special flags, fully GPU accelerated on both OpenGL and Vulkan! This was achieved by implementing what is effectively an internal off-screen swapchain in the driver's OpenGL and Vulkan integration code, along with a mechanism to send buffers to other processes for presentation when needed.
This update also brings enhanced support for the linux-dmabuf v4 Wayland protocol (aka dmabuf-feedback), which allows compositors to dynamically send information about optimal formats and modifiers, e.g., depending on the surface presentation mode (fullscreen vs windowed). Our new internal OpenGL swapchain can handle such feedback directly, while for Vulkan we rely on the Wayland WSI to provide this functionality.
This year we also made a lot of smaller scale fixes and enhancements, that in aggregate have greatly improved driver stability. These were a result of both testing we performed ourselves, and also of reports from people trying out the Wayland driver, for which we are very grateful.
All the features listed in our previous update (multi-monitor, display mode changes, copy-paste, keymaps, relative mouse etc) have been further refined. One issue for which we haven't yet found a reasonable solution, is how to properly position the context/right-click menu in the standalone systray.
The Wayland driver uses the Wayland protocol in a manner that, although in spec, exercises less well-trodden paths in compositor code. Throughout the year we have come across a few issues with compositors, which we have been working with upstreams to address. One issue that people should be aware of, in particular, manifests as improper relative mouse motion in first-person 3D games when using the Wayland driver with some compositors (e.g., see [2]).
TL;DR of how to use the development branch:
$ git clone -b wayland https://gitlab.collabora.com/alf/wine/ $ cd wine $ ./configure --with-wayland [--with-vulkan] $ make [-jN] $ DISPLAY= WAYLAND_DISPLAY=wayland-0 ./wine ...
Especially note the use of 'DISPLAY=', which we use to opt in to the Wayland driver by disabling the higher priority X11 driver.
Here is a video showing the latest version of the Wayland driver in action (note that in this video I am using Mutter from git main that includes the fix for the relative motion issues mentioned above):
https://www.youtube.com/watch?v=lZ-MK72Kyp8
---
Next steps:
Last year, due to the extensive ongoing internal rework in Wine (e.g., win32u), the decision was made to postpone the upstreaming of the Wayland driver until some amount of internal stability had been reached. My impression is that things are a lot more stable now, from the drivers' point of view at least. Is there any upcoming work that people feel would be severely hindered by the upstreaming of the Wayland driver?
Ideally, I would like to start the upstreaming effort (which I expect will take some time) at some point early next year, after the codebase has been unfrozen. Does this sound reasonable?
Thanks, Alexandros
[1] https://www.winehq.org/pipermail/wine-devel/2021-December/203035.html [2] https://gitlab.gnome.org/GNOME/mutter/-/issues/2223