mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-09 13:29:46 -05:00
backend/drm: fix drmModePageFlip() when disabling CRTC on legacy uAPI
drmModePageFlip() will fail with EBUSY on a disabled CRTC.
We can't fix this by clearing the DRM_MODE_PAGE_FLIP_EVENT when
performing a commit which disables CRTCs, because some device-wide
commits might also page-flip other enabled CRTCs (and skipping the
page-flip event would mess up our buffer tracking).
Fix this by immediately completing page-flips which disable a CRTC
on the legacy uAPI.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3918
(cherry picked from commit 3e651b4642)
This commit is contained in:
parent
bdc75d058b
commit
f870d63bad
2 changed files with 14 additions and 2 deletions
|
|
@ -577,6 +577,16 @@ static void drm_connector_apply_commit(const struct wlr_drm_connector_state *sta
|
|||
|
||||
conn->cursor_enabled = false;
|
||||
conn->crtc = NULL;
|
||||
|
||||
// Legacy uAPI doesn't support requesting page-flip events when
|
||||
// turning off a CRTC
|
||||
if (page_flip != NULL && conn->backend->iface == &legacy_iface) {
|
||||
drm_page_flip_pop(page_flip, crtc->id);
|
||||
conn->pending_page_flip = NULL;
|
||||
if (page_flip->connectors_len == 0) {
|
||||
drm_page_flip_destroy(page_flip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue