Commit graph

10083 commits

Author SHA1 Message Date
Pekka Paalanen
556272bae9 color-lcms: change stock sRGB to true power-2.2
The sRGB expected display behavior uses the pure power-law with exponent
2.2, not the two-piece sRGB transfer function.
cmsCreate_sRGBProfileTHR() used the two-piece TF, now we use the proper
display TF.

This is particularly meaningful when implicit sRGB content is converted
to HDR formats, in order to maintain the stimuli reproduction near zero.

cmlcms_send_image_desc_info() is already sending this, it doesn't need
fixing.

Changing the curve also changes the error tolerances. The change is
theoretically a no-op, but the curve and its inverse and temporary
rounding add error. The new curve is more prone to error, so it is not
surprising we need to raise the tolerance. The color transformation does
end up as power-2.2 analytical form and I do not think it is ever
lowered to a LUT in alpha-blending test, so there is no obvious fix
improving the accuracy. The worst case point in alpha-blending still
occurs at the very same point as before.

The test reference images are updated for the same reason, they would
fail otherwise.

Both alpha-blending and color-icc-output contain the same sRGB-optical
sub-test, hence the same error tolerance.

It is surprising to have to increase the ICC roundtrip error tolerance
in color-icc-output test, given that the curves are passed as parametric
to LittleCMS, and adobeRGB case works with the old tolerance even. I did
not investigate further.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
718f7f56df tests/color_util: add power-2.2 transfer function
This is needed by the next commit.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
8468289fa3 tests/color_util: move lcms2 data into struct tone_curve_info
Refactoring data about a thing into one place to simplify code.

Also this function is never expected to fail, so no need for the boolean
return.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
015533bac5 tests/color_util: convert 4 switches into a table
Collect all information of an item into a table entry in one place. Will
be easier to add new items this way.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
338d727d99 tests: drop EOTF from TRANSFER_FN_SRGB_EOTF
The sRGB display uses a power-2.2 transfer characteristic. These enum
values refer to the two-piece sRGB transfer function instead, so they
should not be named "EOTF".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
b2bc30034b color-lcms: do not smooth monotonic shapers
When I was changing the stock sRGB profile from the two-piece TF to the
power-2.2 TF, all CLUT tests in color-icc-output started failing. It
appeared that cmsSmoothToneCurve() caused an already monotonic curve to
become non-monotonic, and then failing its own monotonicity test. I can
only guess that it might have something to do with the power-2.2 curve
having nearly zero derivative near zero.

As a workaround, check if the curve is already monotonic and don't
bother smoothing in that case. This allows the tests to pass in the
future where the sRGB profile has been changed.

OTOH, increasing smoothing_param up to 10.0f still did not help.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
bf1d8c458b color: check steps_valid in weston_color_transform_string()
Do not want to print the steps if they are not correct.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Marius Vlad
63264ae3f4 weston-drm-fourcc: Add fallback for P030
As DRM_FORMAT_P030 was introduced in some later libdrm (2.4.114)
version add a fallback for it to allow building on systems which do
not have that libdrm version.

Fixes 4f4011d79e ("pixel-formats: Add P030")

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-03 06:38:27 +01:00
Marius Vlad
b2c8f35c23 renderer-vulkan: Allow to compile without Vulkan renderer
As spotted in the wild, building without Vulkan still picks up
Vulkan headers. This drops the VkInstance alltogether as that's not
really used.

As this file appears to be pulling XCB headers guard them as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-02 14:37:59 +03:00
Pekka Paalanen
135b95808c shared: fix matrix type computations
When I changed the weston_matrix implementation to linalg-4.h, I broke
the type computations: they were getting reset instead of accumulated.
This manifested with the desktop-shell feature where one can arbitrarily
rotate the windows. A rotated window triggered an incorrect matrix type,
which then did not ignore the surface opaque region as it should have.
That caused rendering artifacts on all renderers.

Fixes: 3fefb5ba44
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/1031

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-30 11:45:08 +00:00
Derek Foreman
a124b19a01 compositor: Remove weston_view_damage_below()
It has no more callers, and hasn't done what its name implies for a very
long time.

Remove it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
cc0edfd13d compositor: Remove weston_view_damage_below from transform add/remove
weston_view_damage_below() does nothing but schedule a repaint, and a
repaint will be scheduled in weston_view_geometry_dirty_internal() anyway,
so remove the extra call.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
1683d7a9d2 compositor: Schedule a repaint directly in weston_view_unmap
Instead of calling weston_view_damage_below(), which only schedules a
repaint, call weston_view_schedule_repaint() instead.

The result is the same, but the code is less confusing.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
601a72dd8c compositor: Remove weston_view_damage_below calls from update_transform
Update transform only does something if we've called
weston_view_geometry_dirty_internal() previously to set the dirty flag.

weston_view_damage_below() just schedules a repaint, and
weston_view_geometry_dirty_internal() will already have done that.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
7900235fee desktop-shell: Remove weston_view_damage_below from desktop_view_destroy
weston_view_damage_below() has done nothing but schedule a repaint for a
long time now.

weston_view_destroy() will trigger the repaint without forcing it here.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Marius Vlad
e70cfe319c fullscreen-shell: Deprecate fullscreen-shell and screenshare module
kiosk-shell/xdg-shell is the (more) modern approach, so let's inform
users that fullscreen-shell is going way.

This also adds an explicit dependency of shell-fullscreen for
screenshare. With this change, both screenshare and fullscreen-share
are disabled by default.

Fixes: #848

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-30 14:31:08 +03:00
Marius Vlad
b3480f5b30 backend-wayland: Remove zwp_fullscreen
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-30 14:31:07 +03:00
Daniel Stone
300d059044 libweston: Remove PAINT_NODE_CONTENT_DIRTY
This was only used by weston_surface_damage(), which we have just
gleefully deleted.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:46:05 +01:00
Daniel Stone
816e4180bc libweston: Remove weston_surface_damage()
There is no valid reason for anyone to call this.

True surface damage is already handled when surfaces are committed. View
damage is already handled through any per-view manipulation which would
generate damage. There is thus no reason for anyone to ever call this.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:43 +01:00
Daniel Stone
653182759f libweston: Damage outputs for content-protection changes
The content-protection state is a property of the output, as it affects
quite a bit of output state, as well as things like whether or not
recording is possible.

Instead of damaging surfaces for content-protection state changes,
damage each output for which the protected surface is relevant.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:31 +01:00
Daniel Stone
9a5b4087c8 libweston: Remove weston_surface_damage() from subsurface commit
When we change the subsurface order, the surface itself has not received
any damage: what's been damaged is the views. Place the damage where it
should be, as the act of moving the view within the view list is where
the damage originates from.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:10 +01:00
Daniel Stone
179aae34f7 desktop-shell: Remove damage for curtain
There is no need to damage a curtain. Adding or removing a view is what
causes the damage.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
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