backend/drm: add wlr_drm_connector_state.nonblock

Instead of having this condition checked in multiple places,
centralize it so that they don't go out-of-sync.
This commit is contained in:
Simon Ser 2023-11-19 15:16:20 +01:00
parent f47b6e3fce
commit 8c44e86077
4 changed files with 22 additions and 22 deletions

View file

@ -315,12 +315,8 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
}
if (modeset) {
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
} else if (!test_only && (state->base->committed & WLR_OUTPUT_STATE_BUFFER)) {
// The wlr_output API requires non-modeset commits with a new buffer to
// wait for the frame event. However compositors often perform
// non-modesets commits without a new buffer without waiting for the
// frame event. In that case we need to make the KMS commit blocking,
// otherwise the kernel will error out with EBUSY.
}
if (!test_only && state->nonblock) {
flags |= DRM_MODE_ATOMIC_NONBLOCK;
}