backend/drm: properly delay syncobj signalling

DRM CRTC signals when scanout begins, but
wlr_output_state_set_signal_timeline() is defined to signal buffer
release. Delay to the next page flip

(cherry picked from commit cd555f9261)
This commit is contained in:
Félix Poisot 2025-01-31 18:59:10 +00:00 committed by Simon Ser
parent 8daba3246d
commit eff5aa52e6
3 changed files with 41 additions and 2 deletions

View file

@ -425,8 +425,13 @@ void drm_atomic_connector_apply_commit(struct wlr_drm_connector_state *state) {
}
if (state->out_fence_fd >= 0) {
// TODO: error handling
wlr_drm_syncobj_timeline_import_sync_file(state->base->signal_timeline,
state->base->signal_point, state->out_fence_fd);
if (crtc->primary->current_release_timeline != NULL) {
wlr_drm_syncobj_timeline_import_sync_file(crtc->primary->current_release_timeline,
crtc->primary->current_release_point, state->out_fence_fd);
wlr_drm_syncobj_timeline_unref(crtc->primary->current_release_timeline);
crtc->primary->current_release_timeline = NULL;
crtc->primary->current_release_point = 0;
}
close(state->out_fence_fd);
}