mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-01-01 11:08:21 -05:00
Use env helpers
This commit is contained in:
parent
31a9fc1fb6
commit
8bd7170fd9
7 changed files with 70 additions and 96 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue