For the implementation of fifo-v1, we need to be able to track
the presentation of individual surface commits.
This is done already in `wlr_presentation_time`, but the way
that is implemented is suited only for use by clients through the
protocol interface (.feedback requests).
Here we use the `surface_output` structure, which is a low-level
structure that links wlr_surfaces with wlr_outputs.
Within this structure we listen to the surface's and the output's
.commit events. Through these 2 we link a surface commit to an output
commit. Then, a new struct wlr_surface_output_commit is created which
listens to the output's .present event.
For the interface to this functionality, 2 elements are introduced:
the new .present event in struct wlr_surface_output, which signals
listeners whether a particular pair of (surface_seq, output_seq) has
been presented or discarded, and the wlr_surface_textured_on_output()
function, used by the scene logic to inform the implementation that
the surface's buffer has been textured on a particular output.
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
Fixes d1c88e9 "render/vulkan: add linear single-subpass"
`find_or_create_render_setup` still assumed a single-buffer setup
always implied use of an srgb format
When an FD is passed to xcb_connect_to_fd(), xcb takes ownership of that
FD and is responsible for closing it, which it does when
xcb_disconnect() is called. But the xwayland handler code also keeps a
copy of the FD and closes it via safe_close() in
server_finish_process().
This double-close can cause all sorts of problems if another part of
wlroots allocates another FD between the two closes - the latter close
will close the wrong FD and things go horribly wrong (in my case leading
to use-after-free and segfaults).
Fix this by setting wm_fd[0]=-1 after calling xwm_create(), and ensuring
that xwm_create() closes the FD if startup errors occur.
The important bit here is whether this is using a single or two
sub-passes. The flag isn't used for anything else.
Preparation for an upcoming one-subpass codepath.
Upon leasing, the wlr_drm_lease_connector_v1 will be automatically clean up by the wlr_output
destroy handler. There is no need for the wlr_drm_lease_manager to keep track of leased connectors.
We were iterating over involved outputs, applying the new state and
sending the commit event for each one. This resulted in commit
events being fired while we weren't done applying the new state for
all outputs.
Fix this by first applying all of the states, then firing all of
the events.
Closes: https://github.com/swaywm/sway/issues/8829
Add wlr-internal enums for the properties specified in
color-representation-v1 (encoding, range, chroma siting, alpha mode) so
that other parts of wlroots can use these without depending on the
protocol specifics and without needing to include the protocol headers.
Also add conversion functions to convert the protocol enum values into
the wlroots enum values.