git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit877e2f0b94550782b12f546761c45fe2836074dd
parent64dd76eb2c
authorIsaac Freund <[email protected]>
date2024-01-06 19:23
river: re-add wl_drm support for now

It seems to be a bit too early to drop support for this legacy protocol.

Xwayland apparently still relies on it for hardware acceleration as do
fairly recent mesa versions still in widespread use.

 deps/zig-wlroots | 2 +-
 river/Server.zig | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/deps/zig-wlroots b/deps/zig-wlroots
index 68ce607..aae7f23 160000
--- a/deps/zig-wlroots
+++ b/deps/zig-wlroots
@@ -1 +1 @@
-Subproject commit 68ce60769c6a8019c43de35197f4596eaac4df48
+Subproject commit aae7f237e270ed8fc2ff10f3a661ced618c527cf
diff --git a/river/Server.zig b/river/Server.zig
index e1c8036..0922cfd 100644
--- a/river/Server.zig
+++ b/river/Server.zig
@@ -102,6 +102,12 @@ pub fn init(self: *Self) !void {
     try self.renderer.initWlShm(self.wl_server);
 
     if (self.renderer.getDmabufFormats() != null and self.renderer.getDrmFd() >= 0) {
+        // wl_drm is a legacy interface and all clients should switch to linux_dmabuf.
+        // However, enough widely used clients still rely on wl_drm that the pragmatic option
+        // is to keep it around for the near future.
+        // TODO remove wl_drm support
+        _ = try wlr.Drm.create(self.wl_server, self.renderer);
+
         self.linux_dmabuf = try wlr.LinuxDmabufV1.createWithRenderer(self.wl_server, 4, self.renderer);
     }