From 8acaabcbab4f08dfae79dbfd9a1b2b5d932137c6 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 27 Feb 2023 11:10:30 +0100 Subject: backend: make wlr_backend_autocreate() fail when DRM is missing When we change the required dependencies for the DRM backend, Meson might auto-disable the backend for users missing the new requirements. This results in confused users [1] because they don't notice the "drm-backend: NO" line burried in the Meson logs, and then get a black screen when starting the compositor. Update wlr_backend_autocreate() to refuse to create a backend with only libinput (without DRM). Users really wanting to start their compositor with a libinput backend and without a DRM backend can manually set WLR_BACKENDS. [1]: https://github.com/swaywm/sway/issues/7457 --- backend/backend.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/backend.c b/backend/backend.c index a439a8f4..b9f7caab 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -350,11 +350,6 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, } #endif -#if !(WLR_HAS_LIBINPUT_BACKEND || WLR_HAS_DRM_BACKEND) - wlr_log(WLR_ERROR, "Neither DRM nor libinput backend support is compiled in"); - goto error; -#endif - // Attempt DRM+libinput #if WLR_HAS_SESSION session = session_create_and_wait(display); @@ -389,6 +384,10 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, wlr_log(WLR_ERROR, "Failed to open any DRM device"); goto error; } +#else + wlr_log(WLR_ERROR, "DRM backend support is not compiled in, " + "refusing to start"); + goto error; #endif success: -- cgit v1.2.3