Commit graph

7782 commits

Author SHA1 Message Date
Félix Poisot
b2f6a390a4 scene: transfer sample syncobj to client timeline 2026-03-17 18:14:35 +00:00
Félix Poisot
bfd6e619fc linux_drm_syncobj_v1: add release point accumulation
This changes the behavior of wlr_linux_drm_syncobj_surface_v1 to
automatically signal release of previous commits as they are replaced.

Users must call wlr_linux_drm_syncobj_v1_state_add_release_point or
wlr_linux_drm_syncobj_v1_state_signal_release_with_buffer to delay the
signal as appropriate.
2026-03-17 18:14:35 +00:00
Félix Poisot
e83a679e23 drm/syncobj: add timeline point merger utility 2026-03-17 18:14:35 +00:00
Félix Poisot
1f3d351abb scene: add buffer release point to 'sample' event 2026-03-17 18:14:35 +00:00
Félix Poisot
0af9b9d003 render/drm_syncobj: add wlr_drm_syncobj_timeline_signal() 2026-03-17 18:13:10 +00:00
David Turner
abb6eeb422 backend/drm/atomic: Add support for color representation
Basic implementation of color representation in drm/atomic: when buffers
are presented for scanout which have color-representation data attached,
set the correct color encoding and range on the plane.  If the plane
does not support color-representation then the commit will fail and the
caller can retry without color-representation.
2026-03-17 16:32:30 +00:00
David Turner
dca0703dac backend/drm: Add color_range/encoding properties
Add the following optional DRM properties, for use by the
color-representation-v1 protocol:
- COLOR_ENCODING
- COLOR_RANGE
2026-03-17 16:32:30 +00:00
David Turner
80bcef908b scene: Set color representation on scanout
When doing direct-scanout, if the surface has color-representation
metadata present then pass on that metadata to the output state.

Also, if a buffer has color representation IDENTITY+FULL then normalise
this to NONE+NONE which is equivalent.
2026-03-17 16:32:30 +00:00
David Turner
58c158dba6 output: Add color-representation to output state
Add color_representation to wlr_output_state, holding color
representation metadata about the primary buffer.  This can be set
using wlr_output_state_set_primary_color_representation() and a
new enum value WLR_OUTPUT_STATE_COLOR_REPRESENTATION in
wlr_output_state.committed indicates when this data is present.

Also add color-representation to wlr_output, and discard
color-representation in wlr_output_state if it matches what's already
been committed to the output.
2026-03-17 16:32:30 +00:00
Isaac Freund
1fa8bb8f7a
virtual-keyboard: handle seat destroy
We must make the virtual keyboard inert when the seat is destroyed.
2026-03-17 09:53:32 +01:00
Isaac Freund
ec746d3e3e virtual-keyboard: add wlr_virtual_keyboard_v1_from_resource()
I want to use the zwp_virtual_keyboard_v1 object in a custom river
protocol and need to be able to obtain the corresponding wlroots struct.
2026-03-17 08:45:12 +00:00
Scott Moreau
1fc928d528 wlr_ext_image_copy_capture_v1: Fix crash when client creates a cursor session not implemented server side
This guards against a crash where the server implements
wlr_ext_image_capture_source_v1_interface without setting .get_pointer_cursor().
In general, we should install a NULL check here because this is a crash
waiting to happen. Now, instead of crashing, the resource will be created and
the copy capture session will be stopped.
2026-03-14 19:04:42 +00:00
llyyr
3cb2cf9425 scene: use wl_list_for_each_safe to iterate outputs
The outputs loop in handle_scene_buffer_outputs_update may remove entries
from the list while iterating, so use wl_list_for_each_safe instead of
wl_list_for_each.

Fixes: 39e918edc8 ("scene: avoid redundant wl_surface.enter/leave events")
2026-03-13 23:32:06 +05:30
Alexander Orzechowski
7f87c7fe90 wlr_scene: Nuke buffer output_enter / output_leave
outputs_update should be used instead.
2026-03-13 13:19:06 -04:00
Isaac Freund
39e918edc8
scene: avoid redundant wl_surface.enter/leave events
Currently we send wl_surface.enter/leave when a surface is hidden
and shown again on the same output. In practice, this happens very
often since compositors like river and sway enable and disable
the scene nodes of surfaces as part of their atomic transaction
strategy involving rendering saved buffers while waiting for
clients to submit new buffers of the desired size.

The new strategy documented in the new comments avoids sending
redundant events in this case.
2026-03-13 17:59:13 +01:00
Diego Viola
736c0f3f25 wlr-export-dmabuf-unstable-v1: fix typo 2026-03-12 11:03:57 +00:00
Jonathan Marler
3c8d199ec1 backend/x11: ignore DestroyNotify events
The X11 backend subscribes to StructureNotify events, so when
output_destroy() calls xcb_destroy_window() the server sends a
DestroyNotify back. This is expected and harmless but was logged
as an unhandled event. Silence it the same way MAP_NOTIFY and
UNMAP_NOTIFY are already silenced.
2026-03-10 22:44:56 -06:00
Kenny Levinsen
7ccef7d9eb Adopt wlr_box_intersects where useful
This makes wlr_scene_node_at roughly 50% faster, and gives a minor boost
to node modification as well.

Before:

create test tree:               7030 nodes, 473.510 s, 15 nodes/ms
wlr_scene_node_at:              10000 iters, 894.945 s, 78552 nodes/ms (hits: 10/10000)
wlr_scene_node_for_each_buffer: 10000 iters, 330.597 s, 212646 nodes/ms (hits: 0/10000)

After:

create test tree:               7030 nodes, 385.930 s, 18 nodes/ms
wlr_scene_node_at:              10000 iters, 586.013 s, 119963 nodes/ms (hits: 10/10000)
wlr_scene_node_for_each_buffer: 10000 iters, 334.559 s, 210127 nodes/ms (hits: 0/10000)
2026-03-09 22:09:40 +00:00
Kenny Levinsen
2938c10cd3 ci: Run tests and benchmarks 2026-03-09 22:09:40 +00:00
Kenny Levinsen
648790f43a tests: Initial test and benchmark setup
Add a unit test for wlr_box and benchmark for wlr_scene_node_at as our
first test examples, lowering the barrier for adding more tests as
suitable.
2026-03-09 22:09:40 +00:00
Kenny Levinsen
ff7d093800 util/box: Add wlr_box_intersects
wlr_box_intersection generates a new box based on the intersection of
two boxes. Often we simply want to know *if* two boxes intersected,
which we can answer much cheaper.

Add wlr_box_intersects, in similar vein as wlr_box_contains_box but
returning true for any overlap.
2026-03-09 22:09:40 +00:00
Kenny Levinsen
285cee5f3a util/box: Use integer min/max for intersection
wlr_box_intersection only operates on integers, so we shouldn't use
fmin/fmax. Do the usual and add a local integer min/max helper.
2026-03-09 22:09:40 +00:00
Christopher Snowhill
9a931d9ffa scene: fix color format compare
bool doesn't really support negative values.

Fixes: 7cb3393e7 (scene: send color_management_v1 surface feedback)
2026-03-06 18:44:26 -08:00
hrdl
3dafaa4df3 render/vulkan: relax minimum Vulkan API version to 1.0
This allows using the vulkan renderer on platforms that provide all
the necessary Vulkan extensions.

Tested on a Mali G52 platform with Mesa 26.0.0 and 25.3.5, which only
support Vulkan API 1.0.
2026-03-06 15:45:05 +01:00
Simon Zeni
67ce318b1f ci: update dalligi upstream repo 2026-03-06 09:37:31 -05:00
YaoBing Xiao
14b3c96c1e treewide: make type-check helpers take const pointers 2026-03-06 16:04:21 +08:00
Andri Yngvason
3336d28813 image_capture_source/output: Update constraints on enable
Without observing the enable event, clients receive no pixel formats and
buffer dimensions are reported as 0 after an output has been re-enabled.
2026-03-05 21:28:55 +00:00
Simon Ser
2d39166146 build: bump version to 0.20.0-rc4 2026-03-05 19:54:06 +01:00
liupeng
1b8c3ea8c5 screencopy: simplify capture error handling
Signed-off-by: liupeng <liupeng01@kylinos.cn>
2026-03-04 21:09:47 +08:00
YaoBing Xiao
55bb69e2c4 render/gles: use optimized clears for unblended rects 2026-03-03 11:02:08 +00:00
Wang Yu
a55b85e2e1 xwayland: fix memory leak on pipe() failure
When pipe() fails in xwm_selection_send_data(), the function
returns without cleaning up the allocated transfer structure
and initialized wl_array. This causes a memory leak.

Add wl_array_release() and free() to clean up resources when
pipe() fails.

Signed-off-by: Wang Yu <wangyu@uniontech.com>
2026-03-03 14:37:42 +08:00
Diego Viola
6d9aa17572 treewide: fix typos
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2026-02-28 04:26:47 -03:00
Kenny Levinsen
1ce992d7cb scene/layer_shell_v1: Add support for exclusive_edge
The v5 layer shell interface allows the client to specify which edge the
exclusive zone will apply to, instead of deducing it from the anchor
points. Add support for this to the layer shell scene helper.
2026-02-24 13:28:46 +00:00
Simon Ser
2367d78c3c render/vulkan: fix missing DMA-BUF implicit write fence for render buffer
Same as previous commit for the read side, but this one waits for
all readers to be done before starting to write.
2026-02-23 09:33:27 -05:00
Simon Ser
8c8d6363a1 render/vulkan: add "acquire" to vulkan_sync_foreign_texture()
Makes it more obvious that this is about the acquire side, not the
release side.
2026-02-23 09:33:27 -05:00
Simon Ser
ff4ce12179 render/vulkan: introduce buffer_export_sync_file()
Same as buffer_import_sync_file(), but for the export side.
2026-02-23 09:33:27 -05:00
Simon Ser
43b37e34d6 render/vulkan: fix missing DMA-BUF implicit read fence for textures
When we're reading from a DMA-BUF texture using implicit sync, we
need to (1) wait for any writer to be done and (2) prevent any
writers from mutating the texture while we're still reading. We
were doing (1) but not (2).

Fix this by calling dmabuf_import_sync_file() with DMA_BUF_SYNC_READ
for all DMA-BUF textures we've used in the render pass.
2026-02-23 09:33:27 -05:00
Simon Ser
73bbad8433 render/vulkan: take render pass in vulkan_sync_render_buffer()
We'll need to grab textures from there in the next commit.

Also rename it to better reflect what it does: synchronize release
fences after a render pass has been submitted.
2026-02-23 09:33:27 -05:00
Simon Ser
a6e5807e86 render/vulkan: introduce buffer_import_sync_file()
Will be used in two spots in a following commit.
2026-02-23 09:33:27 -05:00
Simon Ser
7be5e3689c build: bump version to 0.20.0-rc3 2026-02-22 23:38:52 +01:00
hrdl
25bec59c75 CONTRIBUTING.md: update git host
gitlab.freedesktop.org -> ssh.gitlab.freedesktop.org
2026-02-20 00:31:06 +01:00
Kenny Levinsen
1efb216c6d backend/drm: Close non-master drm fd on failure
If we are not able to prepare the fd for non-master usage, close the fd
before returning an error.
2026-02-19 15:11:56 +00:00
Simon Ser
884d29e5f3 backend/libinput: guard against new enum entries
When libinput introduces new enum entries, we'd abort or send bogus
events to the compositor. Instead, log a message and ignore the
event.

Keep all enums without a default case so that the compiler warns
when we're missing a case.
2026-02-13 09:41:02 -05:00
Isaac Freund
25f94c5965
backend/x11: reject shm buffers with non-min strides
This fixes an X11 backend direct scanout bug with foot.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/4046
2026-02-13 11:56:08 +01:00
Simon Ser
910fd264fb build: bump version to 0.20.0-rc2 2026-02-12 22:47:22 +01:00
Aleksei Bavshin
3676ab4df0
backend/libinput: add support for LIBINPUT_SWITCH_KEYPAD_SLIDE 2026-02-08 11:01:06 -08:00
Aleksei Bavshin
c1452d8811
backend/libinput: fix build with libinput 1.31 2026-02-08 10:56:16 -08:00
Steve Williams
436bcf9a47 color-representation-v1: fix condition in surface commit 2026-02-07 08:36:29 +04:00
Steve Williams
ef88246642 types/wlr_buffer: add buffer_get_drm_format helper function 2026-02-06 13:53:46 +00:00
Steve Williams
bb78861ca9 color-representation: add support for identity+full 2026-02-06 13:53:46 +00:00