aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/atomic.c7
-rw-r--r--backend/drm/drm.c2
-rw-r--r--backend/drm/legacy.c15
3 files changed, 13 insertions, 11 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index c1b1229c..0b2cf8b3 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -144,8 +144,8 @@ error:
atom->failed = true;
}
-static bool atomic_crtc_pageflip(struct wlr_drm_backend *drm,
- struct wlr_drm_connector *conn) {
+static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
+ struct wlr_drm_connector *conn, uint32_t flags) {
struct wlr_drm_crtc *crtc = conn->crtc;
bool modeset = crtc->pending & WLR_DRM_CRTC_MODE;
@@ -179,7 +179,6 @@ static bool atomic_crtc_pageflip(struct wlr_drm_backend *drm,
}
}
- uint32_t flags = DRM_MODE_PAGE_FLIP_EVENT;
if (modeset) {
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
} else {
@@ -267,7 +266,7 @@ static size_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm,
const struct wlr_drm_interface atomic_iface = {
.conn_enable = atomic_conn_enable,
- .crtc_pageflip = atomic_crtc_pageflip,
+ .crtc_commit = atomic_crtc_commit,
.crtc_set_cursor = atomic_crtc_set_cursor,
.crtc_get_gamma_size = atomic_crtc_get_gamma_size,
};
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 0d7f3f25..9c397752 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -345,7 +345,7 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn) {
return false;
}
- bool ok = drm->iface->crtc_pageflip(drm, conn);
+ bool ok = drm->iface->crtc_commit(drm, conn, DRM_MODE_PAGE_FLIP_EVENT);
crtc->pending = 0;
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c
index 46a0309e..4ca9d57c 100644
--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
@@ -6,8 +6,8 @@
#include "backend/drm/iface.h"
#include "backend/drm/util.h"
-static bool legacy_crtc_pageflip(struct wlr_drm_backend *drm,
- struct wlr_drm_connector *conn) {
+static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
+ struct wlr_drm_connector *conn, uint32_t flags) {
struct wlr_drm_crtc *crtc = conn->crtc;
struct wlr_drm_plane *cursor = crtc->cursor;
@@ -42,9 +42,12 @@ static bool legacy_crtc_pageflip(struct wlr_drm_backend *drm,
return false;
}
- if (drmModePageFlip(drm->fd, crtc->id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, drm)) {
- wlr_log_errno(WLR_ERROR, "%s: Failed to page flip", conn->output.name);
- return false;
+ if (flags & DRM_MODE_PAGE_FLIP_EVENT) {
+ if (drmModePageFlip(drm->fd, crtc->id, fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, drm)) {
+ wlr_log_errno(WLR_ERROR, "%s: Failed to page flip", conn->output.name);
+ return false;
+ }
}
return true;
@@ -114,7 +117,7 @@ static size_t legacy_crtc_get_gamma_size(struct wlr_drm_backend *drm,
const struct wlr_drm_interface legacy_iface = {
.conn_enable = legacy_conn_enable,
- .crtc_pageflip = legacy_crtc_pageflip,
+ .crtc_commit = legacy_crtc_commit,
.crtc_set_cursor = legacy_crtc_set_cursor,
.crtc_get_gamma_size = legacy_crtc_get_gamma_size,
};