Commit graph

12 commits

Author SHA1 Message Date
Simon Ser
be05097968 output: add wlr_output_state_init()
This changes the semantics of wlr_output_state. Instead of having
fields with uninitialized memory when missing from the committed
bitflag, all fields are always initialized (and maybe NULL/empty),
just like we do in wlr_surface_state. This reduces the chances of
footguns when reading a field, and removes the need to check for
the committed bitfield everywhere.

A new wlr_output_state_init() function takes care of initializing
the Pixman region.
2023-06-23 18:07:26 +00:00
Alexander Orzechowski
4b7c526578 output: Introduce wlr_output_state_copy() 2023-06-22 11:56:20 +02:00
Alexander Orzechowski
64c0272f81 output_state: Gamma lut should be freed only if committed
We consider state that is not committed to be uninitialized.
2023-06-19 00:19:50 -04:00
Simon Ser
670915eeea output: add wlr_output_state_set_layers() 2023-06-13 12:02:49 +00:00
Alexander Orzechowski
a09bb1314d wlr_output_state: Consider gamma_lut uninitialized if not committed 2023-06-12 18:24:00 +00:00
Alexander Orzechowski
b80e67d6e6 wlr_output_state: Consider buffer uninitialized if not committed 2023-06-12 18:24:00 +00:00
Alexander Orzechowski
ae7bad86dd output: introduce wlr_output_state_set_damage() 2023-06-12 14:12:47 +02:00
Simon Ser
5d5cf34486 output: add wlr_output_state_set_gamma_lut() 2023-06-08 18:47:46 +00:00
Simon Ser
7215bd1e0f output: expose wlr_output_state_set_buffer() 2023-02-21 09:43:43 +00:00
Simon Ser
4629d0ef40 output: expose wlr_output_state_finish()
Same as the original function, but check for the bitfield before
calling pixman_region32_fini(), because that function expects an
initialized region.
2023-02-21 09:43:43 +00:00
Simon Ser
a0345f2854 output: add wlr_output_state.allow_artifacts
When starting up, the compositor might call wlr_output_set_mode()
with a mode which is already the current one. wlroots will detect
this and make the wlr_output_set_mode() call a no-op. During the
next wlr_output_commit() call, wlroots will perform an atomic
commit without the ALLOW_MODESET flag.

This is an issue, because some drivers need ALLOW_MODESET even if
the mode is the same. For instance, if the FB stride or modifier
changed, some drivers require a modeset.

Add a new flag "allow_artifacts" which is set when the compositor
calls mode-setting functions. Use this flag to figure out whether
we want to perform atomic commits with ALLOW_MODESET.

(The name "allow_artifacts" is picked because ALLOW_MODESET is a
misnomer, see [1].)

[1]: https://patchwork.freedesktop.org/patch/505107/

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499
2022-09-30 10:58:17 +00:00
Simon Ser
6688a3d9ea output: add output state setters
This ensures compositors don't forget to set the committed flag
or the mode_type when setting a field.
2022-06-08 18:22:32 +02:00