Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
backend/drm: DRM_CAP_TIMESTAMP_MONOTONIC is now required
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckb0ne committed Oct 13, 2021
1 parent dc22a06 commit 1367a4a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ bool check_drm_features(struct wlr_drm_backend *drm) {
return false;
}

if (drmGetCap(drm->fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap) || !cap) {
wlr_log(WLR_ERROR, "DRM_CAP_TIMESTAMP_MONOTONIC unsupported");
return false;
}

const char *no_atomic = getenv("WLR_DRM_NO_ATOMIC");
if (no_atomic && strcmp(no_atomic, "1") == 0) {
wlr_log(WLR_DEBUG,
Expand All @@ -86,14 +91,13 @@ bool check_drm_features(struct wlr_drm_backend *drm) {
drm->iface = &atomic_iface;
}

int ret = drmGetCap(drm->fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap);
drm->clock = (ret == 0 && cap == 1) ? CLOCK_MONOTONIC : CLOCK_REALTIME;
drm->clock = CLOCK_MONOTONIC;

const char *no_modifiers = getenv("WLR_DRM_NO_MODIFIERS");
if (no_modifiers != NULL && strcmp(no_modifiers, "1") == 0) {
wlr_log(WLR_DEBUG, "WLR_DRM_NO_MODIFIERS set, disabling modifiers");
} else {
ret = drmGetCap(drm->fd, DRM_CAP_ADDFB2_MODIFIERS, &cap);
int ret = drmGetCap(drm->fd, DRM_CAP_ADDFB2_MODIFIERS, &cap);
drm->addfb2_modifiers = ret == 0 && cap == 1;
wlr_log(WLR_DEBUG, "ADDFB2 modifiers %s",
drm->addfb2_modifiers ? "supported" : "unsupported");
Expand Down

0 comments on commit 1367a4a

Please sign in to comment.