Commit graph

10061 commits

Author SHA1 Message Date
Daniel Stone
44c2c3ce72 desktop-shell: Remove weston_surface_damage() from rotate
This already calls either weston_view_add_transform() or
weston_view_remove_transform() followed by
weston_view_update_transform(), the combination of which will already
force a repaint for those views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
Daniel Stone
0aafc50419 libweston: Remove weston_surface_damage() from view-layer
This already calls weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
Daniel Stone
d90eed2b99 libweston: Remove weston_surface_damage() from view-alpha update
This already calls weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
Daniel Stone
c71ae0c89b libweston: Remove weston_surface_damage() from view-transform
These already call weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
Erico Nunes
8e7ca3a470 backend-pipewire: add Vulkan renderer support
Add the Vulkan renderer in the pipewire backend renderer switches.
For now this goes over the pipewire memfd path.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-27 17:13:15 +02:00
Erico Nunes
508d5f0bea backend-rdp: add Vulkan renderer support
Add the Vulkan renderer in the rdp backend renderer switches.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-27 17:13:15 +02:00
Erico Nunes
3c2ff4324b backend-vnc: add Vulkan renderer support
Add the Vulkan renderer in the vnc backend renderer switches.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-27 17:13:15 +02:00
Erico Nunes
30aacca3ff vulkan-renderer: add readback for renderbuffers
This will allow use of the vnc, rdp and pipewire (memfd) backends
with the Vulkan renderer.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-27 17:13:02 +02:00
Erico Nunes
f8af0dbf72 vulkan-renderer: fix read pixels for sub regions
The captured buffer cannot be just memcpy'ed to the destination as
it might overwrite existing pixels outside of the capture region.
For now switch it to a pixman composition.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-27 10:45:00 +02:00
liang zhou
4e4d7993ba xdg-shell: fix weston crash while send configuration
When xdg_toplevel_send_configure is executed, the xdg_toplevel resource
may have already been destroyed, causing Weston to crash.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2025-05-25 03:04:40 +00:00
Erico Nunes
df8af39a2a gitlab-ci: Create some jobs for Vulkan build coverage
Adjust the no-GL jobs to also do no-Vulkan and only create a couple more
to cover disabling the individual renderers.
Copy the hack for obscure LLVM leak reports so that tests can pass in CI
with lavapipe for a Vulkan driver.
Disable vulkan-renderer build on debian lts for now as unsupported.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
5536a98e97 clients/simple-dmabuf-vulkan: New Vulkan client example
Example to serve as a reference of a basic Wayland client using
Vulkan with dmabuf. This does not use a traditional Vulkan swapchain
but implements it using imported gbm buffers. Also features use of
linux-explicit-synchronization-unstable-v1 with Vulkan.
Based on weston-simple-dmabuf-egl.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
75c37afa62 clients/simple-vulkan: New Vulkan client example
Example to serve as a reference of a basic Wayland client using
Vulkan, contained in a single source file and with a minimal set
of dependencies.
Features incremental present (similar to swap_buffers_with_damage
from EGL) which is not commonly used by other Vulkan demos and is
useful to test the compositor.
Based on weston-simple-egl.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
ec52e0cdda tests: Add support for Vulkan renderer
Add support for Vulkan renderer in most places where there was
support for GL renderer.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
8f56d03d4b libweston: Vulkan renderer
A Vulkan renderer for weston, based on the GL renderer.
The goal is to impose the least requirements as possible on Vulkan
implementations, as to allow even Vulkan 1.0 (or early development)
drivers to run a Wayland compositor. Any additional features or
extensions are made optional if possible.
Currently supports drm, wayland, x11 and headless backends.
As of this implementation, this is still considered an experimental
renderer.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
60f7b59d8f gitlab-ci: Prepare base CI images for Vulkan build and tests
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
76431a952f clients/simple-dmabuf-egl: Add missing destructors
Destructors for zwp_linux_explicit_synchronization_v1 and
weston_direct_display_v1 were missing.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Erico Nunes
ad4746101a tests: Remove gl_ suffix from force_full_upload
This will also be used for Vulkan-renderer tests.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Rémi Bernon
2f35f84d8e
xwayland: Activate no_focus_window when a Wayland window is activated
None active window might be interpreted from an X point of view as a
transient focus state, and is used by multiple X window managers when
a temporary focus change is in progress, or simply when grabbing the
keyboard.

From Wine side, we translate any active window change to the Win32
application, and handling None active window as an actual window
deactivation and focus loss creates spurious events and an undesired
feedback loop, as apps might react to it.

We still want to be able to detect actual focus loss under an XWayland
session, and having XWayland window manager focus an actual X window
instead will make the distinction possible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2025-05-23 18:07:02 +02:00
Rémi Bernon
87ae07b63f
xwayland: Create a dummy no_focus_window to use for non-X window focus
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2025-05-23 18:07:02 +02:00
Erico Nunes
4ab8d6d2c4 libweston: move gl-borders up to weston_renderer
This just moves gl-borders up to libweston weston_renderer as-is,
with no change in functionality.
This is a preparation step so that other renderers can use the
same interface.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-18 18:00:08 +02:00
Pekka Paalanen
f71db77341 tests/client-buffer: reduce the scope of #if
Containining the pre-compiler conditionals inside tiny functions makes
the code easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 16:24:53 +03:00
Pekka Paalanen
381bc2761f tests/client-buffer: annotate unintended test cases
These cases were never meant to exist, but because the harness assumes
all tests must run on all fixtures, we have to return something.

This is a temporary measure to improve readability. Eventually this test
program should be split:

- shm RGB + YUV
- dmabuf RGB without force-yuv-fallback
- dmabuf YUV with and without force-yuv-fallback

or

- shm RGB + YUV
- dmabuf RGB + YUV without force-yuv-fallback
- dmabuf YUV with force-yuv-fallback

or

- shm + dmabuf; RGB + YUV without force-yuv-fallback
- dmabuf YUV with force-yuv-fallback

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 16:24:53 +03:00
Pekka Paalanen
33d82b6b79 tests/client-buffer: handle no-list in format_must_pass()
Make the callers simpler and easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 15:49:23 +03:00
Robert Mader
55a85e8e16 pixel-formats: Remove unimplemented header
The implementation got removed already and we can just check
the color_model now.

Fixes: 51ed256d (libweston: Replace pixel format's sampler_type with color_model enum)

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
fe5a846512 tests: client-buffer: Use gl_force_import_yuv_fallback quirk
Ensure we test our internal YUV->RGB shader and multiplane paths.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
d24caf5f32 gl-renderer: Add gl_force_import_yuv_fallback test quirk
Forcing the fallback paths for YUV formats. This will allow us
to test these paths on CI now that llvmpipe supports all tested
formats natively.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
65e3a7324a tests: client-buffer: Return RESULT_SKIP where appropriate
Split up the test to run it for SHM and DRM individually so we
get fine-grained results.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
68aed0775e tests: client-buffer: Remove llvmpipe workarounds
The issue were fixed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
e476276bf6 gitlab-ci: Bump wayland-protocols to 1.44
Which we'll need soon, so reuse the image bump in the previous
commit.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
244f930365 gitlab-ci: Build with llvmpipe multiplanar YCbCr support
As well as fixes for broken packed YUYV variants.

Latest Mesa requires Meson >= 1.3.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Leandro Ribeiro
e6289aee68 color-lcms: rewrite misleading comment
Update a comment explaining what we may do in the future when
cmsSmoothToneCurve() fails.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-15 14:42:45 +03:00
Daniel Stone
4393bec40a core: Short-circuit assign_outputs() during shutdown
If we're shutting down, moving surfaces to a different output will not
be profitable. Just clear out the output mask entirely and return early.

This specifically avoids the following issue seen with the Wayland
backend when shutting down:
  - outputs destroyed
  - colour manager destroyed
  - seats destroyed
  - pointer destroyed
  - sprite view destroyed
  - find new output for the sprite view
  - update colour profile for the sprite view
  - neither the view nor the compositor has any outputs left
  - try to use the stock sRGB transfer
  - oops, no colour manager

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-14 17:24:43 +00:00
Leandro Ribeiro
8ef3423bf7 color: remove unused WESTON_COLOR_MAPPING_TYPE_3D_LUT
Since "color: do not use color steps for non-optimized pipelines",
WESTON_COLOR_MAPPING_TYPE_3D_LUT became unused. So drop it from our
code.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
df07af056d color: do not use color steps for non-optimized pipelines
For non-optimized pipelines, stop using the color steps (pre curve,
color mapping and post curve). Instead, make use of the
xform->to_shaper_plus_3dlut() vfunc.

In this patch we add a bool to signalize that the steps are valid (for
optimized pipelines) or not. If not (non-optimized ones), the vfunc must
be used.

This brings flexibility for the renderer/backend implementing the xform.
For now we only implement xform's in the GL-renderer, and this has no
behavior changes. It should be relevant when we implement the xform in
our DRM-backend, see commit "color: add to_shaper_plus_3dlut() vfunc to
struct weston_color_transform".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
3187999208 tests: add color-math-test
This tests a few mathematical operations that are common to color work.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
0945ac3fa8 color: add to_shaper_plus_3dlut() vfunc to struct weston_color_transform
This function allow us to get a shaper (3x1D LUT) + 3D LUT that is
equivalent to a certain xform.

With that, we allow backend/renderer that are not capable of handling
the color steps of the xform to fallback to something else.

E.g. when we introduce the code to offload color xform to KMS using the
DRM-backend, we'll depend on the driver/hardware implementing the color
steps. With this patch, DRM-backend should be able to fallback to a
shaper (3x1D LUT) + 3DLUT, color operations that should be commonly
supported by drivers/hardwares.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
9f1cf0db24 color-lcms: keep fallback LCMS xform even when pipeline is optimized
Up to now, when we were able to optimize a color pipeline, we'd delete
xform->cmap_3dlut. In such cases, we'd have a pre curve, color mapping
and post curve that Weston recognizes and implements in the shaders. So
there was no need to use xform->cmap_3dlut.

But at some point we'll try to offload such color transformations to our
DRM-backend, and we are not in control of what color operations the
hardware/driver are capable of. In such case, we may want to use the
fallback LCMS xform (xform->cmap_3dlut) and decompose it into a shaper
(3x1D LUT) + 3D LUT, as such operations should be commonly supported
by hardwares/drivers.

This shows that using the optimized pipeline or not should be a
renderer/backend decision. So do not delete xform->cmap_3dlut even when
we optimize the pipeline.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
b3fae5ae6b gl-renderer: split gl_color_curve_lut_3x1d()
For now this is useless, but in the next commits this split will be
pretty useful.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
4fe16c1bec gl-renderer: split gl_color_mapping_lut_3d()
For now this is useless, but in the next commits this split will be
pretty useful.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
334ae04614 gl-renderer: cosmetic improvement to gl_color_mapping_lut_3d()
Change this function signature to look similar to
gl_color_curve_lut_3x1d(), as they do similar things.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Leandro Ribeiro
209a5b8400 gl-renderer: rename gl_3d_lut() to gl_color_mapping_lut_3d()
We are filling a struct gl_renderer_color_mapping in this function,
so rename to better reflect that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-05-13 17:36:52 +03:00
Erico Nunes
14d95cd6ce tests: client-buffer: Support must pass list per renderer
This test has only supported the GL renderer, with a must pass list of
formats which matches what the GL renderer advertises and supports.
This commit prepares the test to support other renderers by moving the
must pass list to the test setup declaration, so that it can be defined
per renderer. This is in preparation to add more renderers here as a
followup.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Erico Nunes
6f6576dec2 tests: client-buffer: Add arguments to fixture setup
Prepare to add more multiple renderer options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Erico Nunes
0c84f990d6 tests: output-decorations: Add arguments to fixture setup
Prepare to add more multiple renderer options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Marius Vlad
d76a89c9d8 debug-flight-recorder.rst: Describe how to grab flight recorder
As I found myself writing these for a MR think it would better
to have to easily available to point people to.

Another small change is that since c706e1f8c8 we no longer
default subscribe to drm-backend for the flight recorder so update docs
as well. Combined with this new file should actually explain better how
to make use of it.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-13 10:10:23 +03:00
Marius Vlad
a40c638003 doc/sphinx/conf.py.in: Change sphinx.ext.intersphinx
To latest change.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-12 20:29:01 +03:00
Marius Vlad
ac2bbe24cb doc/sphinx/doxygen.ini.in: Removed deprecated HTML timestampt option
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-12 15:15:01 +03:00
Marius Vlad
35da5ca5a6 xdg-client-helper: Use a default WINDOW size value
If the shell doesn't provide a configure size, use a default one.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:30:37 +03:00
Marius Vlad
7bb9fc5b62 weston-test-client-helper: Move helpers into weston-test-client-helper
As we can re-use this for other tests make them available.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-06 15:27:58 +03:00