Skip to content

output: fix dangling renderer context after wlr_output_preferred_read_format

Simon Ser requested to merge github/fork/emersion/rollback-render into master

output: rename impl->rollback to rollback_render

The output backend API is now mostly state-less thanks to the atomic hooks (commit and test). There is one exception though: attach_render. This function makes the rendering context current. However sometimes the compositor might decide not to render after attach_render (e.g. when there's nothing new to render to the back buffer). Thus wlr_output_rollback has been introduced to revert the pending state.

Because the output backend API is mostly state-less, the only thing wlr_output_impl.rollback needs to do is revert the current rendering context. Rename the function to rollback_render to make this clear. Add a check in the common wlr_output code to only call rollback_render when attach_buffer has been previously called.

On the long term, we'll be able to remove attach_render and rollback_render together.

output: make rollback_render mandatory

If the output backend provides attach_render, assert it also provides a way to revert it via rollback_render.

output: fix dangling renderer context after wlr_output_preferred_read_format

attach_render was called without un-setting the current rendering context afterwards.

Closes: #2164 (closed)


Breaking change for backends: wlr_output_impl.rollback has been renamed to rollback_render and now needs to unconditionally unset the renderer context. It'll only be called if attach_render has previously been called.

cc @any1

Merge request reports