|
|
|
@ -489,6 +489,13 @@ static void drm_connector_state_init(struct wlr_drm_connector_state *state,
|
|
|
|
|
.modeset = base->allow_reconfiguration,
|
|
|
|
|
.active = (base->committed & WLR_OUTPUT_STATE_ENABLED) ?
|
|
|
|
|
base->enabled : conn->output.enabled,
|
|
|
|
|
// 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.
|
|
|
|
|
.nonblock = !base->allow_reconfiguration &&
|
|
|
|
|
(base->committed & WLR_OUTPUT_STATE_BUFFER),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct wlr_output_mode *mode = conn->output.current_mode;
|
|
|
|
@ -763,16 +770,6 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn,
|
|
|
|
|
if (!drm_connector_state_update_primary_fb(conn, &pending)) {
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// wlr_drm_interface.crtc_commit will perform either a non-blocking
|
|
|
|
|
// page-flip, either a blocking modeset. When performing a blocking modeset
|
|
|
|
|
// we'll wait for all queued page-flips to complete, so we don't need this
|
|
|
|
|
// safeguard.
|
|
|
|
|
if (conn->pending_page_flip != NULL && !pending.modeset) {
|
|
|
|
|
wlr_drm_conn_log(conn, WLR_ERROR, "Failed to page-flip output: "
|
|
|
|
|
"a page-flip is already pending");
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (pending.base->committed & WLR_OUTPUT_STATE_LAYERS) {
|
|
|
|
|
if (!drm_connector_set_pending_layer_fbs(conn, pending.base)) {
|
|
|
|
@ -790,6 +787,16 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// wlr_drm_interface.crtc_commit will perform either a non-blocking
|
|
|
|
|
// page-flip, either a blocking modeset. When performing a blocking modeset
|
|
|
|
|
// we'll wait for all queued page-flips to complete, so we don't need this
|
|
|
|
|
// safeguard.
|
|
|
|
|
if (pending.nonblock && conn->pending_page_flip != NULL) {
|
|
|
|
|
wlr_drm_conn_log(conn, WLR_ERROR, "Failed to page-flip output: "
|
|
|
|
|
"a page-flip is already pending");
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t flags = 0;
|
|
|
|
|
if (pending.active) {
|
|
|
|
|
flags |= DRM_MODE_PAGE_FLIP_EVENT;
|
|
|
|
|