Re-add support for wlr_output's atomic API

This reverts commit 724926ea6a and
re-applies commit 6e0565e9de.

Outputs now need to be explicitly enabled when performing a modeset.
We need to roll back wlr_output_attach_render when we decide not to
render.

See also: https://github.com/swaywm/wlroots/pull/1797 (wlroots PR)
See also: https://github.com/swaywm/sway/pull/4355 (Original sway PR)
See also: https://github.com/swaywm/sway/pull/4434 (Revert sway PR)
This commit is contained in:
Simon Ser 2019-12-27 11:47:51 +01:00 committed by Drew DeVault
parent 658b779662
commit ef2332f7a6
2 changed files with 37 additions and 30 deletions

View file

@ -560,8 +560,12 @@ int output_repaint_timer_handler(void *data) {
clock_gettime(CLOCK_MONOTONIC, &now);
output_render(output, &now, &damage);
} else if (surface_needs_frame) {
wlr_output_schedule_frame(output->wlr_output);
} else {
wlr_output_rollback(output->wlr_output);
if (surface_needs_frame) {
wlr_output_schedule_frame(output->wlr_output);
}
}
pixman_region32_fini(&damage);