output: fix leak of empty back buffer lock

This refactors output_ensure_buffer() to not mutate the state passed,
making the previous subtle behavior much more explicit.

Fixes: d483dd2f ("output: add wlr_output_commit_state")
Closes: #3442
This commit is contained in:
Isaac Freund 2022-06-03 00:15:42 +02:00 committed by Simon Ser
parent 5cca72958a
commit 0deef6fe44
3 changed files with 77 additions and 34 deletions

View file

@ -13,6 +13,6 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
const struct wlr_drm_format_set *display_formats, uint32_t format);
void output_clear_back_buffer(struct wlr_output *output);
bool output_ensure_buffer(struct wlr_output *output,
struct wlr_output_state *state);
const struct wlr_output_state *state, bool *new_back_buffer);
#endif