diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-26 20:15:52 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-28 13:28:15 -0500 |
commit | e795ea6a0c5420fba505de074ad20797a9797d07 (patch) | |
tree | fdc137a8e01fbec768f71808fde815a1b6b3ef1e /sway/server.c | |
parent | Make GLES2 optional (diff) | |
download | sway-e795ea6a0c5420fba505de074ad20797a9797d07.tar.gz sway-e795ea6a0c5420fba505de074ad20797a9797d07.tar.zst sway-e795ea6a0c5420fba505de074ad20797a9797d07.zip |
Make DRM backend optional
Diffstat (limited to 'sway/server.c')
-rw-r--r-- | sway/server.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/server.c b/sway/server.c index b750d10c..9208a838 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -7,13 +7,11 @@ | |||
7 | #include <wlr/backend.h> | 7 | #include <wlr/backend.h> |
8 | #include <wlr/backend/headless.h> | 8 | #include <wlr/backend/headless.h> |
9 | #include <wlr/backend/multi.h> | 9 | #include <wlr/backend/multi.h> |
10 | #include <wlr/backend/session.h> | ||
11 | #include <wlr/config.h> | 10 | #include <wlr/config.h> |
12 | #include <wlr/render/wlr_renderer.h> | 11 | #include <wlr/render/wlr_renderer.h> |
13 | #include <wlr/types/wlr_compositor.h> | 12 | #include <wlr/types/wlr_compositor.h> |
14 | #include <wlr/types/wlr_content_type_v1.h> | 13 | #include <wlr/types/wlr_content_type_v1.h> |
15 | #include <wlr/types/wlr_data_control_v1.h> | 14 | #include <wlr/types/wlr_data_control_v1.h> |
16 | #include <wlr/types/wlr_drm_lease_v1.h> | ||
17 | #include <wlr/types/wlr_drm.h> | 15 | #include <wlr/types/wlr_drm.h> |
18 | #include <wlr/types/wlr_export_dmabuf_v1.h> | 16 | #include <wlr/types/wlr_export_dmabuf_v1.h> |
19 | #include <wlr/types/wlr_gamma_control_v1.h> | 17 | #include <wlr/types/wlr_gamma_control_v1.h> |
@@ -46,13 +44,19 @@ | |||
46 | #include "sway/output.h" | 44 | #include "sway/output.h" |
47 | #include "sway/server.h" | 45 | #include "sway/server.h" |
48 | #include "sway/tree/root.h" | 46 | #include "sway/tree/root.h" |
47 | |||
49 | #if HAVE_XWAYLAND | 48 | #if HAVE_XWAYLAND |
50 | #include "sway/xwayland.h" | 49 | #include "sway/xwayland.h" |
51 | #endif | 50 | #endif |
52 | 51 | ||
52 | #if WLR_HAS_DRM_BACKEND | ||
53 | #include <wlr/types/wlr_drm_lease_v1.h> | ||
54 | #endif | ||
55 | |||
53 | #define SWAY_XDG_SHELL_VERSION 2 | 56 | #define SWAY_XDG_SHELL_VERSION 2 |
54 | #define SWAY_LAYER_SHELL_VERSION 3 | 57 | #define SWAY_LAYER_SHELL_VERSION 3 |
55 | 58 | ||
59 | #if WLR_HAS_DRM_BACKEND | ||
56 | static void handle_drm_lease_request(struct wl_listener *listener, void *data) { | 60 | static void handle_drm_lease_request(struct wl_listener *listener, void *data) { |
57 | /* We only offer non-desktop outputs, but in the future we might want to do | 61 | /* We only offer non-desktop outputs, but in the future we might want to do |
58 | * more logic here. */ | 62 | * more logic here. */ |
@@ -64,6 +68,7 @@ static void handle_drm_lease_request(struct wl_listener *listener, void *data) { | |||
64 | wlr_drm_lease_request_v1_reject(req); | 68 | wlr_drm_lease_request_v1_reject(req); |
65 | } | 69 | } |
66 | } | 70 | } |
71 | #endif | ||
67 | 72 | ||
68 | bool server_init(struct sway_server *server) { | 73 | bool server_init(struct sway_server *server) { |
69 | sway_log(SWAY_DEBUG, "Initializing Wayland server"); | 74 | sway_log(SWAY_DEBUG, "Initializing Wayland server"); |
@@ -189,6 +194,7 @@ bool server_init(struct sway_server *server) { | |||
189 | 194 | ||
190 | sway_session_lock_init(); | 195 | sway_session_lock_init(); |
191 | 196 | ||
197 | #if WLR_HAS_DRM_BACKEND | ||
192 | server->drm_lease_manager= | 198 | server->drm_lease_manager= |
193 | wlr_drm_lease_v1_manager_create(server->wl_display, server->backend); | 199 | wlr_drm_lease_v1_manager_create(server->wl_display, server->backend); |
194 | if (server->drm_lease_manager) { | 200 | if (server->drm_lease_manager) { |
@@ -199,6 +205,7 @@ bool server_init(struct sway_server *server) { | |||
199 | sway_log(SWAY_DEBUG, "Failed to create wlr_drm_lease_device_v1"); | 205 | sway_log(SWAY_DEBUG, "Failed to create wlr_drm_lease_device_v1"); |
200 | sway_log(SWAY_INFO, "VR will not be available"); | 206 | sway_log(SWAY_INFO, "VR will not be available"); |
201 | } | 207 | } |
208 | #endif | ||
202 | 209 | ||
203 | wlr_export_dmabuf_manager_v1_create(server->wl_display); | 210 | wlr_export_dmabuf_manager_v1_create(server->wl_display); |
204 | wlr_screencopy_manager_v1_create(server->wl_display); | 211 | wlr_screencopy_manager_v1_create(server->wl_display); |