diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-19 10:10:52 -0400 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-22 10:18:52 -0400 |
commit | 8bd7170fd95aa0753dc859457808d7f7f81d560d (patch) | |
tree | b51d0586fae5ab51af9728616bbc9c2c91662d5f /backend/drm | |
parent | 31a9fc1fb60f8001f43186d36e3fbb5fce584d91 (diff) |
Use env helpers
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 9acb4175..94dd7023 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -29,6 +29,7 @@ #include "render/drm_format_set.h" #include "render/swapchain.h" #include "render/wlr_renderer.h" +#include "util/env.h" // Output state which needs a KMS commit to be applied static const uint32_t COMMIT_OUTPUT_STATE = @@ -74,8 +75,7 @@ bool check_drm_features(struct wlr_drm_backend *drm) { return false; } - const char *no_atomic = getenv("WLR_DRM_NO_ATOMIC"); - if (no_atomic && strcmp(no_atomic, "1") == 0) { + if (env_parse_bool("WLR_DRM_NO_ATOMIC")) { wlr_log(WLR_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface"); drm->iface = &legacy_iface; @@ -91,8 +91,7 @@ bool check_drm_features(struct wlr_drm_backend *drm) { int ret = drmGetCap(drm->fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap); drm->clock = (ret == 0 && cap == 1) ? CLOCK_MONOTONIC : CLOCK_REALTIME; - const char *no_modifiers = getenv("WLR_DRM_NO_MODIFIERS"); - if (no_modifiers != NULL && strcmp(no_modifiers, "1") == 0) { + if (env_parse_bool("WLR_DRM_NO_MODIFIERS")) { wlr_log(WLR_DEBUG, "WLR_DRM_NO_MODIFIERS set, disabling modifiers"); } else { ret = drmGetCap(drm->fd, DRM_CAP_ADDFB2_MODIFIERS, &cap); |