Commit graph

10129 commits

Author SHA1 Message Date
Deborah Brouwer
088c8ec21b gitlab-ci: Bump tag to rebuild containers
Bump the tag to trigger container rebuild to include new kernel and also
ci-templates updates.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
5db61f07aa gitlab-ci: Bump kernel from 6.3 to 6.14
Update the kernel used in CI from version 6.3 to 6.14.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
87dea962b8 tests: Use new buffer for second screenshot
When the same buffer is reused for both the first and second screenshot,
this can result in a deadlock. Avoid the issue by using a new buffer for
the second screenshot.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
624d8b2d3d gitlab-ci: Format gitlab logs for build-and-test.sh
Use the FDO_CI_BASH_HELPERS functions from ci-templates to format the
gitlab ci logs for build-and-test.sh. This adds collapsible sections to make
the overall log easier to read.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
675bb24a57 gitlab-ci: Move build-and-test script to separate file
Move the script from the build-and-test job to a separate bash file.
This makes it easier to read the .gitlab-ci.yml file and to edit the bash
script.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
a1360d72f4 gitlab-ci: Format gitlab logs for build-deps.sh
Use the FDO_CI_BASH_HELPERS functions from ci-templates to format the
gitlab ci logs for build-deps.sh. This adds collapsible sections to make
the overall log easier to read.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
86517d36d3 gitlab-ci: Update ci-templates
Update the ci-templates so that the ci tests can use new template
features such as gitlab log formatting.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Deborah Brouwer
28f1dfae95 gitlab-ci: Remove CONFIG_DRM_KMS_FB_HELPER config
CONFIG_DRM_KMS_FB_HELPER was removed in v5.14, it doesn't hurt to have
it here, but removing it makes the code clearer.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-07-17 10:42:30 +03:00
Marius Vlad
8618a29649 shell.lua: Add output_resized callback handler
When resizing the outputs, re-create the background and relayout the
views according to the (newer) output dimensions.

This is a common feature amongs our shells, so do this for lua-shell as
well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-07-08 22:48:19 +03:00
Marius Vlad
56b768d934 shell.lua: Add a helper to re-create background
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-07-08 22:47:46 +03:00
Derek Foreman
5a48cedc7b drm: Improve VRR timing at start of repaint loop
There was an old kernel bug where the drm driver could give us a stale
timestamp. We worked around this by performing a page flip at the
start of the repaint loop.

Now that we support VRR, when we don't render our refresh rate drops to the
display's lowest possible refresh rate. This leaves us with a race where
the repaint loop could be started between the mode's refresh rate and the
lowest possible VRR rate - which is indistinguishable from a stale
timestamp. In this case we'd perform a needless page flip and potentially
miss an opportunity to render.

The kernel bug was introduced in v3.16 in commit 844b03f27739135 and later
fixed in v4.1 in commit fdb68e09bbb1c98

Since the vrr_capable property was introduced in v4.20 in commit
ba1b0f6c73d4ea1, any kernel that supports VRR is new enough not to give us
stale timestamps, so we don't have to miss these opportunities.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-27 14:51:49 +01:00
Erico Nunes
2d34d32893 vulkan-renderer: support dmabuf renderbuffers
Initial support for dmabuf renderbuffers, based on the GL renderer
implementation.
This enables Vulkan renderer to use the pipewire backend with dmabuf.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-06-25 14:12:22 +00:00
Erico Nunes
33c418a85b vulkan-renderer: rework Vulkan dmabuf import
Rework the dmabuf import Vulkan code so that it is possible to reuse
a single routine across the DRM backend gbm import and dmabuf client
import.
This is will also make it possible to reuse it for dmabuf renderbuffers
as a follow-up.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-06-25 14:12:22 +00:00
Erico Nunes
4685cb1d1c vulkan-renderer: rework render_fence_fd
Decouple render_fence_fd from the DRM output, in particular so that
it is allowed in headless outputs (for upcoming dmabuf renderbuffers).
Also simplify the code to make it clear that it is handled per-output.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-06-25 14:12:22 +00:00
Erico Nunes
1a9d46e3bc vulkan-renderer: move render_done semaphore to image
For swapchain outputs, in some cases it is possible that a frame becomes
available by its fence but the last used swapchain image has still not
been returned to the swapchain. If the render_done semaphore is part of
the frame struct it will be reused and cause a validation error.
To prevent this from happening, move the render_done semaphore to the
image struct so that each of those semaphores is only used when the
associated image is safely acquired from the swapchain.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-06-25 14:12:22 +00:00
Erico Nunes
a79e7c3e8d clients/simple-vulkan: move render_done semaphore to image
In some cases it is possible that a frame becomes available by its
fence but the last used swapchain image has still not been returned to
the swapchain. If the render_done semaphore is part of the frame struct
it will be reused and cause a validation error.
To prevent this from happening, move the render_done semaphore to the
image struct so that each of those semaphores is only used when the
associated image is safely acquired from the swapchain.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-06-25 14:12:22 +00:00
Marius Vlad
feb4fd1386 compositor, frontend: Allow to configure placeholder-color
This is a trivial change to allow passing a user-defined color to
specify the color for the placeholder.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-24 16:00:05 +03:00
Pekka Paalanen
0a76b639fe backend-rdp: fix build with freerdp 3.15.0
Every .c file in RDP-backend hits this:

cc -Ilibweston/backend-rdp/rdp-backend.so.p -Ilibweston/backend-rdp
-I../../git/weston/libweston/backend-rdp -I. -I../../git/weston
-Iinclude -I../../git/weston/include -Ilibweston
-I../../git/weston/libweston -I/home/pq/local/include
-I/usr/include/pixman-1
-I/usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/
-I/usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/winpr3
-I/usr/include/libdrm -fdiagnostics-color=always
-fsanitize=address,undefined -fno-omit-frame-pointer
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror
-std=gnu11 -O0 -g -Wmissing-prototypes -Wno-unused-parameter
-Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic
-Wundef -fvisibility=hidden -Wmissing-prototypes -Wno-unused-parameter
-Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic
-Wundef -fvisibility=hidden -fPIC -MD -MQ
libweston/backend-rdp/rdp-backend.so.p/rdp.c.o -MF
libweston/backend-rdp/rdp-backend.so.p/rdp.c.o.d -o
libweston/backend-rdp/rdp-backend.so.p/rdp.c.o -c
../../git/weston/libweston/backend-rdp/rdp.c

In file included from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/client/rdpgfx.h:28,
                 from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/gdi/gdi.h:34,
                 from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/freerdp.h:35,
                 from ../../git/weston/libweston/backend-rdp/rdp.h:32,
                 from ../../git/weston/libweston/backend-rdp/rdp.c:37:
/usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/codecs.h:93:9: error: ‘codecs_free’ is deprecated: [since 3.6.0] Use freerdp_client_codecs_free [-Werror=deprecated-declarations]
   93 |         WINPR_DEPRECATED_VAR("[since 3.6.0] Use freerdp_client_codecs_new",
      |         ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/winpr3/winpr/winpr.h:22,
                 from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/winpr3/winpr/stream.h:26,
                 from /usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/freerdp.h:25:
/usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/freerdp3/freerdp/codecs.h:91:47: note: declared here
   91 |                              FREERDP_API void codecs_free(rdpCodecs* codecs));
      |                                               ^~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/pkgconfig/../../../include/winpr3/winpr/platform.h:497:41: note: in definition of macro ‘WINPR_DEPRECATED_VAR’
  497 | #define WINPR_DEPRECATED_VAR(text, obj) obj __attribute__((deprecated(text)))
      |                                         ^~~
cc1: all warnings being treated as errors

Looks like there is a magic define that fixes this, as we are not using
the deprecated things to begin with.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-23 13:19:40 +00:00
Robert Mader
c8f71ff503 pixel-formats: Move FOURCC defines to weston-drm-fourcc.h
Which is the correct place for them.

Currently they cause warnings like:
```
/usr/include/libdrm/drm_fourcc.h:389:9: warning: ‘DRM_FORMAT_S010’ redefined
```

with libdrm >= 2.4.125.

Fixes: 3dce9e8c2 (pixel-formats: Add Sx1x software decoder formats)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-06-23 15:03:06 +02:00
Taehyeon Jeong
0add10986d input: improve keyboard keys array traversal in notify_key()
The loop in notify_key() that traverses the keyboard keys array has been
improved by adding a break statement after removing a key and simplifying
the loop structure. This eliminates unnecessary iterations and removes
ambiguity in the code flow, making it both more efficient and clearer.

Signed-off-by: Taehyeon Jeong wxogus25@gmail.com
2025-06-20 20:17:37 +00:00
Derek Foreman
37bf61c68c drm: Fix pageflip counter crash when using multiple backends
We need to skip non-drm backends in the output list to avoid a NULL pointer
dereference.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-20 14:05:08 -05:00
Robert Mader
3dce9e8c24 pixel-formats: Add Sx1x software decoder formats
Expected to land in Linux 6.17 and already pulled into a
libdrm release (2.4.125).

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-06-17 15:07:01 +02:00
Pekka Paalanen
275155812c color: fine-tune pipeline printing
Separate the parts a bit better.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
6b051ce76b color: print details of the color pipeline
Give a little more insight to the values in a pipeline.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
c533be60d6 color: fix count_parameters type
It's a count, so it's not a bool. Luckily the only counts ever assigned
to it so far were 0 and 1.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
4d6e690fd0 color: de-dup curve printing
Less repetition, easier to modify the format later.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
2fc5e8b2e9 color-lcms: fix lcms matrix printing
If the offset was negative, there would be no space between the columns:

    Matrix
       1.0025  0.0000  0.0000-0.0012

Add the space.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
fec6a3c51e color: print CIE xy with 4 decimals
Usually even three is enough, but D65 tends to be given with four.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
5f22ba7e2e color: refactor to weston_color_gamut_fprint()
Removes repetition and makes weston_color_profile_params_to_str() a
little more concise. Eases changing the xy number formatting next.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
acd3e557af color: shorten the named of primaries
These can be much more terse and still remain completely readable,
improving debug prints' readability.

Only one place needs to explicitly mention it's about primaries, the
rest are already evident.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
16e958607a color-lcms: clarify ICC-to-ICC pipeline prints
In the future parametric<->ICC color transformations will be a thing.
Clarify that the printed pipeline is just the ICC-to-ICC part of it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-16 17:01:17 +03:00
Pekka Paalanen
ddd03a3606 color: drop "transfer function" from TF descriptions
Several places that print this string already include "transfer
function", so there is no need to say it twice. The one place where it
is needed is fixed accordingly. Other places already imply it enough.

This shortens the prints without losing anything.

A few descriptions are improved to help understanding.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-16 17:01:17 +03:00
Marius Vlad
a4494f2ea3 backend-drm: Use a local variable to store output frame rate data
As otherwise we might trip because the output might be not available.

Fixes: cda8de1089 ("backend-drm: Count and display KMS page flips")

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-10 12:00:07 +00:00
Pablo Saavedra
c0dfeaf156 frontend: Assign output before registry shared output init
Set the shared output's Weston output reference before obtaining
the registry from the parent display. Ensures proper access to
output context during registry event handling.

Also prevent weston_seat_init when shared output lacks a compositor,
avoiding crashes on invalid initialization.

Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
2025-06-09 12:18:03 +00:00
zhou liang
fc3e3cf653 compositor: prevent weston_surface references a destroyed output
weston_surface retains a pointer to its associated output, but if the
output is destroyed, the pointer becomes invalid. In set_fullscreen(),
weston_shell_utils_get_focused_output may return this stale output via
weston_keyboard, leading to a use-after-free crash.

This change ensures the output reference is cleared when the output is
destroyed, preventing potential crashes.

Signed-off-by: zhou liang <liang.zhou@gehealthcare.com>
2025-06-09 11:23:37 +00:00
zhou liang
0286b37d76 xdg-shell: Reset configure_idle to NULL at first
To prevent configure_idle from being called again by wl_event_source_remove,
now set configure_idle to NULL inside its handler function. This ensures
the idle source won't be removed multiple times if the handler is called
again.

Signed-off-by: zhou liang <liang.zhou@gehealthcare.com>
2025-06-07 15:08:08 +08:00
Joshua Goins
dc33a296b8 doc: Update to the new --no-resizable RDP flag
This was changed in 75280d2e40 but only
updated in the weston CLI help. But there's still documentation leftover
in .ini files and manpages that refer to the older flag.

Signed-off-by: Joshua Goins <joshua.goins@kdab.com>
2025-06-04 15:38:05 -04:00
Marius Vlad
0600265c64 frontend: Make use of the advertised debug scopes
This patch introduces a new cmd line option, namely `--debug-scopes`
(or shorthand `-d`) to limit which debug scopes are being advertised
over the westond-debug protocol.

To avoid tedious work to make this work in the same time as `--debug`, a
boolean type of option which doesn't accept any other entries, I've
decided to have a dedicated string cmd line argument.

If passing `--debug` all debug scopes are advertised by default
(keep the same behaviour). If you'd like to limit which of those scopes are
advertised, use the -d and only that one those scopes be advertised.
Pass these as a command-separated list.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:43:47 +03:00
Marius Vlad
2dd870adac weston-log: Add a advertised list of debug scopes
This introduces a new list that is being checked up when advertising
or when the client attempts to bind a debug scope.

This would allow for a way in which the frontend can determine which
debug scopes the weston-debug protocol can advertise or the client
using the protocol can bind to.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:43:33 +03:00
Marius Vlad
762e286a44 cp: Correctly format debug scope for content protection
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
a3ab74028a launcher-libseat: Don't hard-stop on libseat-debug
If not libseat-debug scope is not set we would hit an assert, and
we might have a legitimate case where we don't want to have it enabled.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
1181d638ac timeline: Check for timelog scope being enabled
As further weston_log_subscription_iterate implicitly assumes we can
create one, and that might not be always the case.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
413e471fb1 gl-renderer: Don't hard-stop if debugging scopes aren't enabled
We might not want to enable these scopes always so don't limit
the GL-renderer availability based if these are enabled or not.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Derek Foreman
e91eccd709 lua-shell: Add lua-shell
lua-shell is a new meta-shell for Weston. It does nothing in and of
itself, but is defined to be user-scriptable and configurable. A
supplied Lua script will be interpreted and executed by Weston, allowing
full control over window management in response to events.

This includes a shell.lua example script which behaves as a tiling WM.

Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Co-authored-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-04 15:47:06 +03:00
Derek Foreman
cf44b691c6 compositor: Add weston_view_move_before_layer_entry
Add a function to move a view in front of a layer entry, so we can easily
add this functionality to lua-shell in a future commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-04 15:39:03 +03:00
Pekka Paalanen
c24685d14b tests/color-icc-output: reduce tolerance on BT2020 MAT
I don't know when this was improved, I just noticed that we can reduce
the tolerance here.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
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