Commit Graph

7157 Commits

Author SHA1 Message Date
Alexander Orzechowski
65e6579c56 wlr_scene: send preferred buffer transform 2024-06-28 13:44:35 -04:00
Simon Ser
85875c47d9 build: build with C23 if supported
This lets us conditionally leverage C23 features.

Force one build to C11 in CI to make sure we stay C11-compatible.
2024-06-27 18:13:05 +00:00
Simon Ser
3880ee15d7 Use standard __VA_OPT__ instead of GNU's ##__VA_ARGS__
C23 has standardized a way to write variadic macros that accept
zero arguments:
https://open-std.org/JTC1/SC22/WG14/www/docs/n3033.htm

Use that instead of the GNU extension when available.
2024-06-27 18:13:05 +00:00
Simon Ser
315e022f2f backend/drm: fix swapped calloc() arguments in get_or_create_layer()
../backend/drm/drm.c:415:49: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
      415 |         layer->candidate_planes = calloc(sizeof(bool), drm->num_planes);
          |                                                 ^~~~
2024-06-27 18:13:05 +00:00
Simon Ser
29cb151987 backend/drm: fix return value type in create_drm_connector()
../backend/drm/drm.c:1435:24: error: incompatible types when returning type ‘_Bool’ but ‘struct wlr_drm_connector *’ was expected
     1435 |                 return false;
          |                        ^~~~~
2024-06-27 18:13:05 +00:00
Simon Ser
a75c6cca54 render/color: fix return value type
../render/color_lcms2.c: In function ‘wlr_color_transform_init_linear_to_icc’:
    ../render/color_lcms2.c:26:24: error: incompatible types when returning type ‘_Bool’ but ‘struct wlr_color_transform *’ was expected
       26 |                 return false;
          |                        ^~~~~
2024-06-27 18:13:05 +00:00
Simon Ser
fe429b2463 Switch to stable tablet-v2 protocol
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/284
2024-06-27 18:04:00 +00:00
Simon Ser
099350a414 build: check eglext.h header version
We use EGL_EXT_device_drm_render_node, which has been introduced
here:
53f038f6fd
2024-06-27 17:54:57 +00:00
Kenny Levinsen
bf67eb342b render/vulkan: vkMapMemory stage spans up front
We always need these mapped for CPU access, so map it up front instead
of duplicating lazy mapping at each site of use.
2024-06-26 21:10:46 +00:00
Kenny Levinsen
bf0246e50c render/vulkan: Fix 3dlut stage span map offset
The mapping is shared between all users of the stage span, so it should
always map the whole thing and apply the allocation offset to the mapped
pointer.
2024-06-26 21:10:46 +00:00
Kenny Levinsen
6da71b6a89 render/vulkan: Unref color transform on pass submit
We increment the ref counter of the color transform at the start of the
render pass. Decrement it at the end to not leak the color transform.
2024-06-26 22:43:15 +02:00
Kirill Primak
f320df65e6 backend/wayland: introduce wlr_wl_output_set_app_id() 2024-06-26 19:43:20 +00:00
Kenny Levinsen
bc82835756 render/vulkan: Use new span map handling for 3dlut
The use of stage spans for 3dluts was missed when the new cached
mappings were introduced, meaning that it would try to map and unmap
memory that might already have a cached mapping.

Vulkan does not support mapping memory multiple times, so make sure the
3dlut code also uses the cached mapping to avoid segfaults after unmap.
2024-06-26 13:14:07 +02:00
Kenny Levinsen
53464074e9 render/vulkan: Unmap span before freeing memory 2024-06-26 13:13:40 +02:00
John Lindgren
6d197eef94 util: let wlr_box_closest_point() be within 1/65536 of right/bottom edge
Limiting the position to (x + width - 1, y + height - 1) created a 1px
"dead zone" at monitor edges, noticeable with high-resolution mice with
motion deltas of <1px.

See: https://github.com/swaywm/sway/issues/8110

Using (x + width - 1/65536, y + height - 1/65536) instead should make
the "dead zone" small enough to be unobservable, while the value 1/65536
is still large enough to avoid rounding to zero (due to loss of
significant digits) in simple floating-point calculations.

This does expose a client-side bug in Qt layer-shell applications,
noticeable in right/bottom panels which do not accept positions beyond
(x + width - 1, x + height - 1) as valid - thus driving the cursor
to the bottom/right of the screen to click on the panel does not work.
I don't have a good workaround for this, and probably it needs to be
fixed in Qt itself.

Fixes: 3fc66d4525
("util: fix non-linear behavior of wlr_box_closest_point()")
2024-06-25 11:09:33 -04:00
Kirill Primak
5201836868 backend/drm: store drm prop lists as structs
This makes modifying the property lists slightly easier.
2024-06-25 13:49:54 +00:00
Kenny Levinsen
47c578945c render/vulkan: Recycle memory maps for stage spans
Remapping buffers on every use causes a lot of unwanted pagefaults.
Reuse the mapping to significantly speed up the memcpy.
2024-06-24 15:55:10 +00:00
Leonardo Hernández Hernández
09603cdb0b tinywl: allow specify pkg-config binary 2024-06-22 15:59:12 +00:00
Leonardo Hernández Hernández
d92c238721 tinywl: split compilation into two steps
While we are at it also respect LDFLAGS and optimize pkg-config usage
2024-06-22 15:59:12 +00:00
Leonardo Hernández Hernández
f9214373f8 tinywl: don't try to remove xdg-shell-protocol.c
It is not generated since 62fbf3f4ba
2024-06-22 15:59:12 +00:00
Kenny Levinsen
bedc890935 backend/drm: Use cached vrr support flag
We do not expect the connector support to change throughout the lifetime
of the link on this connector, so use the value we initially probed.
2024-06-21 14:18:34 +00:00
Kenny Levinsen
f10327f915 wlr_output: Add adaptive_sync_supported
This will let compositors know if changing adaptive_sync state has any
chance of working. When false, then the current state is the only
supported state, including if adaptive_sync is currently enabled as is
the case for Wayland and X11 backends.

When true, changing state might succeed, but no guarantee is made. It
just indicates that the backend does not already know it to be
impossible.
2024-06-21 14:18:34 +00:00
Kirill Primak
55bee71a53 backend/wayland: destroy ignored tablet proxies
This fixes a memory leak when there are multiple tablets.
2024-06-20 11:13:15 +03:00
Kirill Primak
27d2eb8596 backend/wayland: dispatch remote display when waiting for a configure event
We don't need to process all events, only those that come from the host
compositor. This also avoids running user event handlers while in the
middle of committing an output.

Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3857
2024-06-18 18:31:34 +03:00
Simon Ser
cedcd3252a backend/session: use "KMS" instead of "DRM" in log messages
Some DRM devices are not KMS-capable. DRM card nodes (also
known as DRM primary nodes) are created for render-only devices
as well. Let's just use "KMS" everywhere instead of "DRM" and
"DRM card".
2024-06-17 09:43:38 +02:00
Simon Ser
2504ca929f backend/session: log when loading WLR_DRM_DEVICES
It may not be obvious in the logs when the user specifies an
explicit fixed list of KMS devices to open.
2024-06-17 09:42:23 +02:00
Simon Ser
213bd88b4c linux-drm-syncobj-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/90
2024-06-12 18:40:25 +02:00
Simon Ser
d9bfb47648 render/drm_syncobj: add helpers to wait for timeline points
References: https://patchwork.freedesktop.org/patch/506761/
2024-06-12 18:39:45 +02:00
Simon Ser
ea75aa3065 render/drm_syncobj: add wlr_drm_syncobj_timeline_import() 2024-06-12 18:38:42 +02:00
Simon Ser
7fc00ef777 render/drm_syncobj: introduce wlr_drm_syncobj_timeline
wlr_drm_syncobj_timeline is a synchronization primitive based on
drm_syncobj timelines. They are heavily inspired from Vulkan
timeline semaphores [1].

[1]: https://www.khronos.org/blog/vulkan-timeline-semaphores
2024-06-12 17:45:06 +02:00
Kirill Primak
f464213447 input-method: unmap popup surfaces on deactivate
Fixes 743da5c0ae
2024-06-11 13:13:00 +00:00
Kirill Primak
1e58e4006d xdg-popup: validate positioner on reposition request 2024-06-11 12:02:35 +03:00
Kirill Primak
e7deea44fd xdg-popup: don't emit parent's new_popup signal too early 2024-06-11 11:28:09 +03:00
Kirill Primak
629a5171f2 backend/wayland: don't ack outdated configures
This commit fixes the following interaction:

1) The host compositor sends a configure sequence for an output.
2) Before handling it, the guest compositor disables and immediately
re-enables the output.
3) The guest compositor tries to ack the configure event from step 1
which isn't relevant anymore after unmapping and re-initialization.

Instead, ignore all configure events after unmapping until we're sure
the host compositor has processed the unmapping.

Also see
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108.
2024-06-11 09:44:42 +03:00
Kirill Primak
d80c46250d backend/wayland: improve/fix xdg_toplevel (re-)initialization
- Reset all variables representing an initialized xdg_toplevel's state
on unmap.
- Send an initial commit only when an output is about to be enabled.
- If an output isn't configured yet, don't commit a buffer.
2024-06-11 09:44:42 +03:00
Kirill Primak
d9f6498f8a backend/wayland: commit null buffer only on unmap
If the guest compositor disabled an output and then immediately
committed another state, we would perform a commit with a null buffer,
which is against the protocol, as the host compositor expects an
initial commit with no buffer at all.
2024-06-11 09:44:42 +03:00
Kirill Primak
baf1e4f674 backend/wayland: don't ack a configure event too early
Postpone sending xdg_surface.ack_configure until the guest compositor
commits a buffer, if at all.

Also see
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/128.
2024-06-11 09:44:42 +03:00
Kirill Primak
94e7165e85 backend/wayland: don't request a state too early
An xdg_toplevel configure sequence ends with xdg_surface.configure.
Wait for it before relaying the request to the guest compositor.
2024-06-11 09:44:42 +03:00
Kirill Primak
a62dfebf10 backend/wayland: store output xdg_toplevel title
This will be required to re-initialize the toplevel properly later.
2024-06-11 09:44:42 +03:00
Leonardo Hernández Hernández
385c9ade5f
add an option to enable/disable libliftoff
instead of always using it if found
2024-06-05 22:33:05 -06:00
Simon Ser
a4e1184712 ci: add debugoptimized GCC build
This makes it possible for GCC to print more warnings. For instance,
the docs for -Wmaybe-uninitialized state [1]:

> These warnings are only possible in optimizing compilation, because
> otherwise GCC does not keep track of the state of variables.

Other warning options have similar requirements as well.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmaybe-uninitialized
2024-06-05 00:56:22 +02:00
Kirill Primak
bd7a47e139 backend/drm: avoid "maybe uninitialized" warning
Fixes: 95ac3e9924
2024-06-05 01:07:24 +03:00
Simon Ser
6d07193bda render/color: add fallback stub when LCMS2 is disabled
It's cumbersome for compositors to guard every
wlr_color_transform_ref() or wlr_color_transform_unref() call
behind a #if WLR_HAS_COLOR_MANAGEMENT. Moreover, none of the LCMS2
types are used in our public API.

Instead, always install the color.h header, and add a stub for
wlr_color_transform_init_linear_to_icc().
2024-06-04 17:45:51 +00:00
Kirill Primak
95ac3e9924 backend/drm: add libliftoff log handler 2024-05-31 18:52:51 +00:00
Simon Ser
6e6c4408d3 backend/drm: add support for libliftoff v0.5.0
Don't require libliftoff 0.5.0 just yet: we want to be able to
backport this patch.
2024-05-31 12:32:32 +00:00
Kirill Primak
862a0b4826 fullscreen-shell: deprecate
There are no real-world clients that use this protocol.
2024-05-28 15:08:26 +00:00
Simon Ser
4a093c1082 build: override versioned name
Match the pkg-config name in the meson.override_dependency() call.

Fixes: 4b4f76cc13 ("Version pkgconfig, headers, and library for parallel installation")
2024-05-28 11:17:19 +02:00
Simon Ser
dc5996a8b4 seat/keyboard: drop unnecessary check in handle_keyboard_keymap()
This condition always holds true: the listener is set up for
state->keyboard.
2024-05-27 23:08:20 +00:00
Violet Purcell
c76a232835 tinywl: update for versioned pkg-config file 2024-05-27 22:15:00 +00:00
Violet Purcell
4b4f76cc13 Version pkgconfig, headers, and library for parallel installation
Since wlroots almost always significantly breaks API each minor release,
allowing parallel installation of wlroots helps packagers deal with
programs that require conflicting versions of wlroots.

Closes: #3786
2024-05-27 22:15:00 +00:00