aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config/output.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-11-26 20:15:52 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-11-28 13:28:15 -0500
commite795ea6a0c5420fba505de074ad20797a9797d07 (patch)
treefdc137a8e01fbec768f71808fde815a1b6b3ef1e /sway/config/output.c
parentMake GLES2 optional (diff)
downloadsway-e795ea6a0c5420fba505de074ad20797a9797d07.tar.gz
sway-e795ea6a0c5420fba505de074ad20797a9797d07.tar.zst
sway-e795ea6a0c5420fba505de074ad20797a9797d07.zip
Make DRM backend optional
Diffstat (limited to 'sway/config/output.c')
-rw-r--r--sway/config/output.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 9c7082d0..914cf6c4 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -6,10 +6,10 @@
6#include <sys/socket.h> 6#include <sys/socket.h>
7#include <sys/wait.h> 7#include <sys/wait.h>
8#include <unistd.h> 8#include <unistd.h>
9#include <wlr/config.h>
9#include <wlr/types/wlr_cursor.h> 10#include <wlr/types/wlr_cursor.h>
10#include <wlr/types/wlr_output_layout.h> 11#include <wlr/types/wlr_output_layout.h>
11#include <wlr/types/wlr_output.h> 12#include <wlr/types/wlr_output.h>
12#include <wlr/backend/drm.h>
13#include "sway/config.h" 13#include "sway/config.h"
14#include "sway/input/cursor.h" 14#include "sway/input/cursor.h"
15#include "sway/output.h" 15#include "sway/output.h"
@@ -17,6 +17,10 @@
17#include "log.h" 17#include "log.h"
18#include "util.h" 18#include "util.h"
19 19
20#if WLR_HAS_DRM_BACKEND
21#include <wlr/backend/drm.h>
22#endif
23
20int output_name_cmp(const void *item, const void *data) { 24int output_name_cmp(const void *item, const void *data) {
21 const struct output_config *output = item; 25 const struct output_config *output = item;
22 const char *name = data; 26 const char *name = data;
@@ -286,6 +290,7 @@ static void set_mode(struct wlr_output *output, struct wlr_output_state *pending
286 290
287static void set_modeline(struct wlr_output *output, 291static void set_modeline(struct wlr_output *output,
288 struct wlr_output_state *pending, drmModeModeInfo *drm_mode) { 292 struct wlr_output_state *pending, drmModeModeInfo *drm_mode) {
293#if WLR_HAS_DRM_BACKEND
289 if (!wlr_output_is_drm(output)) { 294 if (!wlr_output_is_drm(output)) {
290 sway_log(SWAY_ERROR, "Modeline can only be set to DRM output"); 295 sway_log(SWAY_ERROR, "Modeline can only be set to DRM output");
291 return; 296 return;
@@ -295,6 +300,9 @@ static void set_modeline(struct wlr_output *output,
295 if (mode) { 300 if (mode) {
296 wlr_output_state_set_mode(pending, mode); 301 wlr_output_state_set_mode(pending, mode);
297 } 302 }
303#else
304 sway_log(SWAY_ERROR, "Modeline can only be set to DRM output");
305#endif
298} 306}
299 307
300/* Some manufacturers hardcode the aspect-ratio of the output in the physical 308/* Some manufacturers hardcode the aspect-ratio of the output in the physical
@@ -436,9 +444,11 @@ static void queue_output_config(struct output_config *oc,
436 enum wl_output_transform tr = WL_OUTPUT_TRANSFORM_NORMAL; 444 enum wl_output_transform tr = WL_OUTPUT_TRANSFORM_NORMAL;
437 if (oc && oc->transform >= 0) { 445 if (oc && oc->transform >= 0) {
438 tr = oc->transform; 446 tr = oc->transform;
447#if WLR_HAS_DRM_BACKEND
439 } else if (wlr_output_is_drm(wlr_output)) { 448 } else if (wlr_output_is_drm(wlr_output)) {
440 tr = wlr_drm_connector_get_panel_orientation(wlr_output); 449 tr = wlr_drm_connector_get_panel_orientation(wlr_output);
441 sway_log(SWAY_DEBUG, "Auto-detected output transform: %d", tr); 450 sway_log(SWAY_DEBUG, "Auto-detected output transform: %d", tr);
451#endif
442 } 452 }
443 if (wlr_output->transform != tr) { 453 if (wlr_output->transform != tr) {
444 sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, tr); 454 sway_log(SWAY_DEBUG, "Set %s transform to %d", oc->name, tr);