diff options
author | Simon Ser <contact@emersion.fr> | 2020-04-06 11:53:20 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-04-08 17:33:00 +0200 |
commit | 507d9bc19e05d3fd4378063ad87f4a74b3dfcfca (patch) | |
tree | e2bf1efa32abf9b3e4b979a512824eb358e20267 /include/wlr | |
parent | d3bd5f2a7ba83567983c4a53ee6a69c3f8f6b25f (diff) |
Add wlr_output_impl.rollback
Most of the pending output state is not forwarded to the backend prior
to an output commit. For instance, wlr_output_set_mode just stashes the
mode without calling any wlr_output_impl function.
wlr_output_impl.commit is responsible for applying the pending mode.
However, there are exceptions to this rule. The first one is
wlr_output_attach_render. It won't go away before renderer v6 is
complete, because it needs to set the current EGL surface.
The second one is wlr_output_attach_buffer.
wlr_output_impl.attach_buffer is removed in [1].
When wlr_output_rollback is called, all pending state is supposed to be
cleared. This works for all the state except the two exceptions
mentionned above. To fix this, introduce wlr_output_impl.rollback.
Right now, the backend resets the current EGL surface. This prevents GL
commands from affecting the output after wlr_output_rollback.
This patch is required for FBO-based outputs to work properly. The
compositor might be using FBOs for its own purposes [2], having leftover
FBO state can have bad consequences.
[1]: https://github.com/swaywm/wlroots/pull/2097
[2]: https://github.com/swaywm/wlroots/pull/2063#issuecomment-597614312
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index 53ff1310..1641ab2d 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -23,6 +23,7 @@ struct wlr_output_impl { bool (*attach_render)(struct wlr_output *output, int *buffer_age); bool (*test)(struct wlr_output *output); bool (*commit)(struct wlr_output *output); + void (*rollback)(struct wlr_output *output); bool (*set_gamma)(struct wlr_output *output, size_t size, const uint16_t *r, const uint16_t *g, const uint16_t *b); size_t (*get_gamma_size)(struct wlr_output *output); |