backend/drm: always perform a CRTC commit in drm_connector_commit

When the mode, status or buffer hasn't changed, drm_connector_commit was
a no-op. Because of this individual changes to the gamma LUT or adaptive
sync status were ignored (if committed without a buffer).

Instead, perform a commit to apply the changes.
This commit is contained in:
Simon Ser 2020-05-27 17:59:16 +02:00 committed by Drew DeVault
parent 1a2e82e327
commit b03eebf7d4
1 changed files with 10 additions and 5 deletions

View File

@ -564,14 +564,19 @@ static bool drm_connector_commit(struct wlr_output *output) {
if (!drm_connector_set_mode(conn, wlr_mode)) {
return false;
}
}
} else if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
// TODO: support modesetting with a buffer
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER &&
!(output->pending.committed & WLR_OUTPUT_STATE_MODE)) {
if (!drm_connector_commit_buffer(output)) {
return false;
}
} else if (output->pending.committed &
(WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED |
WLR_OUTPUT_STATE_GAMMA_LUT)) {
assert(conn->crtc != NULL);
// TODO: maybe request a page-flip event here?
if (!drm_crtc_commit(conn, 0)) {
return false;
}
}
return true;