Commit graph

10157 commits

Author SHA1 Message Date
Michael Olbrich
d076f2c519 backend-pipewire: implement set_dpms
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.

Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2025-08-04 14:56:26 +00:00
Michael Olbrich
b5843ed366 backend-headless: implement set_dpms
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.

Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2025-08-04 14:56:26 +00:00
Derek Foreman
5b37b09c8a xwm: Clean up windows so we don't crash when Xwayland crashes
If Xwayland crashes when we have windows lying around, we can get a
surface destroyed callback later that tries to log debug messages by
dereferencing a stale pointer to the defunct window manager to find the
log scope.

Let's finish this FIXME from 2012, and wipe out the windows.

Ref #1042

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-08-01 12:31:55 -05:00
Derek Foreman
f132462df7 compositor: Don't pass a time to weston_output_repaint()
Nothing does anything with this.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-08-01 15:08:00 +00:00
Septatrix
28bdcb46be frontend: Log when exiting due to insufficient active outputs
Signed-off-by: Septatrix <24257556+septatrix@users.noreply.github.com>
2025-08-01 14:58:19 +00:00
Leandro Ribeiro
3a1101be34 gitlab-ci: drop outdated comments related to virtme
Since "gitlab-ci: Use virtme-ng for running our tests" we no longer use
a hacky fork of virtme. Also, wee no longer use "--script-dir", as
virtme-ng properly supports "--script-sh".

So drop outdated comments.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-08-01 11:30:23 -03:00
Pekka Paalanen
72ed2c12d8 color-lcms: parametric to parametric transformations
This implements the basic color transformation from parametric to
parametric image description. The colorimetric rendering intents are
implemented. The perceptual and saturation rendering intents are
equivalent to media-relative + BPC rendering intent, subject to be
implemented better later.

Things missing:
- handling target color volumes
- perceptual dynamic range mapping

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 17:32:11 +03:00
Pekka Paalanen
8c2c429fd5 color-lcms: parametric blend-to-output
Implement blend-to-output transformation for parameteric output image
descriptions.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:14:34 +03:00
Pekka Paalanen
3737c9adb6 color-lcms: re-structure transformation creation
We will eventually have 6 different paths for creating color
transformations:
- input to blend, input to output
  - ICC to ICC
  - parametric to parametric
  - ICC to parametric
  - parametric to ICC
- blend to output
  - ICC
  - parametric

Set up their dispatching.

No changes to existing functionality.

xform_realize_chain() is now guaranteed to be called only with ICC
profiles.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:14:22 +03:00
Pekka Paalanen
3b3fa61c31 color: add Bradford matrix computation
This function is required for media-relative rendering intents.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:14:01 +03:00
Pekka Paalanen
b32f353003 color: add NPM computation
This function is required for producing color transformations from
parametric image descriptions.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:13:38 +03:00
Pekka Paalanen
37bee3050e color-lcms: override sRGB two-piece TF on input profile
https://gitlab.freedesktop.org/pq/color-and-hdr/-/blob/main/doc/wayland_qa.md#q-should-srgb-content-be-decoded-with-the-piecewise-srgb-transfer-function

When anything claims to target a display with the sRGB two-piece
transfer function, override it with the power-2.2. That is how sRGB
displays actually work.

This patch includes a small refactoring in
cmlcms_color_transform_create().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:13:26 +03:00
Pekka Paalanen
3999d685bc color-lcms: call it a color transform recipe
I've been wanting a better name than search_param. In the future they
are not always search parameters when we have to replace the input
profile with another one for sRGB power-2.2 decoding purposes.

I think "recipe" describes this struct well: it's the list of
ingredients to cook a color transformation from.

This patch is purely renaming things.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:13:14 +03:00
Pekka Paalanen
67cfcaa0ac color-lcms: remove cmlcms_color_transform.status
This field is redundant, and therefore only confusing.

The success or not is returned from xform_realize_chain() directly. The
color processing steps vs. 3D LUT is recorded in
weston_color_transform.steps_valid.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-28 13:12:47 +03:00
Pekka Paalanen
15a9daad9a tests/color-icc-output: relax max error tolerances
Now that we are testing the more robust average error tolerance pretty
tightly, we can relax the tolerances on the maximum error which is more
flaky between GL drivers and hardware.

This makes sRGB->adobeRGB MAT test pass on radeonsi Polaris 11.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-24 11:30:07 +03:00
Pekka Paalanen
a5a2b3abb1 tests/color-icc-output: gate by average error as well
Maximum error is fragile: radeonsi on Polaris 11 has one error spike
that would force the the tolerances for everything to be much higher
than desired, and it masks changes to usual error levels.

Add a new condition to opaque_pixel_conversion: average two-norm error
statistic. The average is not as susceptible to outliers as maximum is.
We still keep the maximum error tolerance as well, to detect gross
outliers that might not sway the average enough to cause a test failure.

The new average error tolerances have been collected from the worst case
among the following + 0.01:
- GL renderer: Mesa Intel(R) HD Graphics 4600 (HSW GT2)
- GL renderer: AMD Radeon RX 550 Series (radeonsi, polaris11, ACO,
  DRM 3.61, 6.12.35+deb13-amd64)
- GL renderer: llvmpipe (LLVM 19.1.7, 256 bits)

(There is no need to separately print matrix vs. clut, it is already in
the fixture name.)

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-24 11:30:07 +03:00
Pekka Paalanen
b55a1d5bff tests/color-icc-output: remove outdated comment
Since around 9002667aa0 the power-law
curves have been implemented.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-24 11:30:07 +03:00
Pekka Paalanen
ef52b0adb4 tests/color-icc-output: re-layout my_setup_args
The concise table style was nice, but is getting more unwieldy as more
fields will be added. The new style won't fall apart.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-24 11:30:07 +03:00
Pekka Paalanen
d254ccdcc5 tests/color-icc-output: rename tolerance to max_tol
I will be adding yet another tolerance. This name disambiguates.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-07-24 11:30:07 +03:00
Derek Foreman
5a1e925759 wayland-backend: Remove unused cairo_device_t
The frame_device variable wasn't used in the commit that added it, and
later another commit that performed a bunch of clean-up bookkeeping added
cairo_device_destroy() for it. This was non-destructive because
cairo_device_destroy() handles NULL gracefully, but still Very Weird.

Remove it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-07-23 08:02:43 -05:00
Derek Foreman
a9958154a9 cairo-util: Remove dead code
Nothing calls this.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-07-23 07:59:36 -05:00
Erico Nunes
1939c732e8 gitlab-ci: Enable vulkan-renderer on debian lts jobs
With newer Vulkan-Headers built in the container, we may un-disable
vulkan-renderer in the debian lts jobs.
This also simplifies the CI script by removing a variant that existed
only for that purpose.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-07-21 12:09:54 +00:00
Erico Nunes
7bc103e5a1 gitlab-ci: Build Vulkan-Headers for CI
The version in Debian 11 (bullseye) is only slightly too old to build
vulkan-renderer.
We already build our own Mesa drivers to a newer version anyway, so it
should be possible to test vulkan-renderer in bullseye if it builds.
The actual Vulkan-Headers version here could actually be older and still
build, but was chosen to be same as in Debian 12 (bookworm) for now as
it is a tested version which has also been available for a while.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-07-21 12:09:54 +00:00
Leandro Ribeiro
3f81d2fd38 compositor: let backends handle output->disable_planes
On weston_output_repaint(), we have:

output_assign_planes(output);
...
output->repaint(output);

output_assign_planes() avoids calling output->assign_planes() when
output->disable_planes > 0. This brings a few complications to backends,
because they can't rely on the repaint loop starting from a certain
function: sometimes it starts from assign_planes(), others from
repaint().

Let's be more consistent: always call assign_planes() and let backends
handle output->disable_planes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-18 17:58:45 +02:00
Leandro Ribeiro
3eed20254c backend-drm: add missing FAILURE_REASONS_FORCE_RENDERER
If we call drm_output_find_plane_for_view() with
DRM_OUTPUT_PROPOSE_STATE_RENDERER_AND_CURSOR for a view that is not a
cursor view, it should fail to get a plane.

In such case, set the failure reason to FAILURE_REASONS_FORCE_RENDERER.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-18 17:58:45 +02:00
Leandro Ribeiro
2efc1838cb backend-drm: rename renderer-only to renderer-and-cursor mode
In the next commit we introduce a real "renderer-only" mode. So let's
rename DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY to
DRM_OUTPUT_PROPOSE_STATE_RENDERER_AND_CURSOR, as it also assign views
to cursor planes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-18 17:58:45 +02:00
Jeri Li (李杰)
44533f0ed6 ivi-shell: print surface id with decimalism
when use weston-debug to print view info, make sense if
use decimalism align with the configurable ivi surface id

Signed-off-by: Jeri Li <jeri.li>
2025-07-17 11:02:42 +00:00
Jeri Li
0f969fd6b0 ivi-shell: print available description of desktop surface
set label func for desktop surface, then it can
print available description of desktop surface

Signed-off-by: Jeri Li <jeri.li>
2025-07-17 11:02:42 +00:00
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