From 08a06a7b6bbb324e9fc6e49e96379340404135b4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 20 Jan 2024 10:57:01 +0100 Subject: Add debug flag to re-enable wl_drm 7e69a7076fc8 ("Drop wl_drm") has dropped wl_drm, however a lot of software wasn't quite ready for this (Xwayland, libva, amdvlk). Keep wl_drm disabled by default to pressure the wl_drm phase-out, but add a -Dlegacy-wl-drm flag for users to restore the previous behavior in the meantime. References: https://github.com/swaywm/sway/issues/7897 --- sway/main.c | 2 ++ sway/server.c | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'sway') diff --git a/sway/main.c b/sway/main.c index 21f19fc4..73254dc2 100644 --- a/sway/main.c +++ b/sway/main.c @@ -162,6 +162,8 @@ void enable_debug_flag(const char *flag) { debug.txn_timings = true; } else if (strncmp(flag, "txn-timeout=", 12) == 0) { server.txn_timeout_ms = atoi(&flag[12]); + } else if (strcmp(flag, "legacy-wl-drm") == 0) { + debug.legacy_wl_drm = true; } else { sway_log(SWAY_ERROR, "Unknown debug flag: %s", flag); } diff --git a/sway/server.c b/sway/server.c index 33b25000..73bf9d70 100644 --- a/sway/server.c +++ b/sway/server.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -191,6 +192,10 @@ bool server_init(struct sway_server *server) { server->linux_dmabuf_v1 = wlr_linux_dmabuf_v1_create_with_renderer( server->wl_display, 4, server->renderer); } + if (wlr_renderer_get_dmabuf_texture_formats(server->renderer) != NULL && + debug.legacy_wl_drm) { + wlr_drm_create(server->wl_display, server->renderer); + } server->allocator = wlr_allocator_autocreate(server->backend, server->renderer); -- cgit v1.2.3