aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/legacy.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-11-15 16:38:51 +0100
committerSimon Ser <contact@emersion.fr>2023-11-17 16:59:04 +0000
commit3b53d1cbf199aa5db0b1c81df92e43fc05670543 (patch)
treeca7b0a2a87911eaf7738e1a6fb5b7425958a31b6 /backend/drm/legacy.c
parentc9c9dd6a5b866055a6a39fd78e55f6d5797fec28 (diff)
backend/drm: introduce page-flip tracking struct
Introduce a per-page-flip tracking struct passed to the kernel when we request a page-flip event for an atomic commit. The kernel will pass us back this pointer when delivering the event. This eliminates any risk of mixing up events together. In particular, if two events are pending, or if the CRTC of a connector is swapped, we no longer blow up in the page-flip event handler. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3753
Diffstat (limited to 'backend/drm/legacy.c')
-rw-r--r--backend/drm/legacy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c
index ee64f78c..7663c0be 100644
--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
@@ -59,7 +59,7 @@ static bool legacy_crtc_test(struct wlr_drm_connector *conn,
static bool legacy_crtc_commit(struct wlr_drm_connector *conn,
const struct wlr_drm_connector_state *state,
- uint32_t flags, bool test_only) {
+ struct wlr_drm_page_flip *page_flip, uint32_t flags, bool test_only) {
if (!legacy_crtc_test(conn, state)) {
return false;
}
@@ -181,7 +181,7 @@ static bool legacy_crtc_commit(struct wlr_drm_connector *conn,
}
if (drmModePageFlip(drm->fd, crtc->id, fb_id,
- page_flags, drm)) {
+ page_flags, page_flip)) {
wlr_drm_conn_log_errno(conn, WLR_ERROR, "drmModePageFlip failed");
return false;
}