Commit graph

10728 commits

Author SHA1 Message Date
Pekka Paalanen
dbec8b1ef1 Merge branch 'mr/stmeta' into 'main'
Remove weston_color_characteristics

See merge request wayland/weston!1956
2026-03-17 17:48:14 +02:00
Pekka Paalanen
e0066a8038 libweston: remove weston_renderer::read_pixels
Unused.

Nowdays renderers use weston_output_pull_capture_task().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-17 17:31:48 +02:00
Marius Vlad
c66d0ea09a backend-drm: Rename sprites with hardware planes
Perhaps this would make things a bit more obvious to newcomers not
being familiar with historical 2D bitmap hardware sprite.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-03-17 16:39:34 +02:00
Marius Vlad
dde648a25f man/weston-keybindings: Use generic hardware planes
This disables all of the hardware planes not just overlay (primary and
underlays as well). Change also the debug message.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-03-17 16:39:34 +02:00
Pekka Paalanen
ec74bd0403 Deprecate remoting and pipewire plugins
The intention is that you should be able to replace these with the
pipewire-backend that you can load together with the DRM-backend. The
functionality should be equivalent, but the libweston software
architecture becomes more maintainable for upstream. Also the
pipewire-backend is not tied to the DRM-backend, and can work with any
other backend and even alone.

Once the remoting and pipewire plugins are gone, we can remove the
virtual output API from DRM-backend.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-17 16:10:38 +02:00
Pekka Paalanen
3bb38c0d17 man: fix screenshooting interface name
This was the old interface that was removed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-17 15:14:17 +02:00
Pekka Paalanen
8e5bd610c9 Remove WCAP
This was the original video recorder completely in software and with a
custom file format. It is no longer useful to keep. It used the old way
of getting screenshots: hooking to weston_output::frame_signal and
calling weston_renderer::read_pixels().  This old way stalled Weston
until the GPU work was complete, and supported only wl_shm buffers.

Nowadays video recording should be arranged with the pipewire-backend
which supports dmabuf delivery.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-17 15:07:24 +02:00
Pekka Paalanen
6f6a5dd2c8 libweston: remove weston_screenshooter_shoot()
Unused.

This was using the old way of getting screenshots: hooking to
weston_output::frame_signal and calling weston_renderer::read_pixels().
This old way stalled Weston until the GPU work was complete, and
supported only wl_shm buffers.

At this time there is no libweston API for frontends/plugins to ask for
a screenshot, but there is a protocol interface in
weston-output-capture.xml.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-17 14:53:38 +02:00
Derek Foreman
29b740ffee fullscreen-shell: Remove fullscreen-shell
It was deprecated, and now it is gone.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-03-16 16:00:20 +02:00
Derek Foreman
3bd77f7817 frontend: Remove screen-share module
It was deprecated, and now it is gone.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-03-16 16:00:20 +02:00
Derek Foreman
7c3e3d7544 drm: Remove VAAPI recorder
This was deprecated, and now it is gone.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-03-16 16:00:20 +02:00
Marius Vlad
f454723d4f backend-drm: Move out comments in else branch
No functional change, just move the comments in the else branch.

Added with 5429302e, ("backend-drm: add KMS plane's formats to
per-surface dma-buf feedback").

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-03-16 13:06:24 +02:00
Pekka Paalanen
a2f6eb4fe2 build: add manual gcovr coverage report
Meson's 'coverage-html' target defaults to using the Perl script LCOV.
LCOV has problems with newer GCCs like 14 in Debian Trixie, leading to
many consistency errors about function end lines. Gcovr OTOH runs just
fine.

Create a new target

  $ meson compile gcovr-report

that creates a coverage report in HTML and Cobertura using gcovr.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-13 15:25:31 +02:00
Pekka Paalanen
cddebbf5d5 tests: ensure constraints-test has the header
I was doing
$ mseon setup --wipe
$ meson test

and hit

../../git/weston/tests/constraints-test.c:31:10:
fatal error: pointer-constraints-unstable-v1-client-protocol.h:
No such file or directory
   31 | #include "pointer-constraints-unstable-v1-client-protocol.h"

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-13 15:25:31 +02:00
Pekka Paalanen
3534c77b66 tests: fix desc[] left-over
In function ‘encode_PAM_comment_line’,
    inlined from ‘write_PAM_image_rgba’ at ../../git/weston/tests/surface-screenshot-test.c:85:9,
    inlined from ‘trigger_binding’ at ../../git/weston/tests/surface-screenshot-test.c:202:8:
../../git/weston/tests/surface-screenshot-test.c:44:22: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
   44 |         size_t len = strlen(comment);

Fixes: d40af215a3

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 17:47:47 +02:00
Pekka Paalanen
ece987a808 frontend,libweston: remove color_characteristics
Since the commit "color-lcms: extract HDR static metadata from profile"
this was all dead code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
b27043c96c color-lcms: extract HDR static metadata from profile
Extract the HDR static metadata type 1 from the output color profile
directly, instead of relying on a separate weston.ini section to provide
the metadata separately.

Weston should tell the monitor what target color volume it is rendering
for. I don't see a reason to be able to control the metadata separately,
and it would add complexity.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
275df28f2a frontend: default color-profile to auto:
Now that ICC<->parametric image description interoperability is
implemented, and the stock sRGB profile is parametric, we can change the
default to what it should be.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
5c87fe21b1 color-lcms: adjust supported TF mask
TF_SRGB will be deprecated, best to never advertise it. The test can
simply use gamma22 instead.

TF_EXT_LINEAR has an implementation and should be usable nowadays.
TF_ST2084_PQ, GAMMA22 and GAMMA28 likewise.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
318005c9bc color-lcms: do not advertise saturation intent
Weston does not support the saturation rendering intent for parametric
image descriptions yet. Not really, Weston would just do the same as
media-relative with BPC does.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
8e7f812570 color-lcms: switch default sRGB profile to parametric
This avoids ICC paths when no ICC profiles are explicitly used.

We can simplify the profile information sending and use the generic path
for the stock profile as well, no longer hard-coding the stock profile
in two places.

Since the stock profile creation cannot fail, we can streamline
cmlcms_init() a little, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
55b0d471ab color-lcms: optimize linear TRCs
The icc<->parametric color transformation code uses "optical ICC
profiles" as part of the ICC pipeline. These profiles use a linear TRC
to encode the black point. When such TRC survives all optimizations, it
will cause the 3D LUT fallback path to be taken.

Detect such curve sets on the ICC pipeline optimizer, and convert them
to matrix stages. The matrix stages will then be optimized as usual,
often eliminating the stage completely.

The results can be seen in color-icc-output test after the stock sRGB
profile has been changed into a parametric one, causing all cases in the
test to hit the parametric-to-icc path. Some tests fail when they
suddenly start using the 3D LUT path which causes the errors to rise.
This patch fixes those (future) cases, and the errors remain the same as
before changing the stock profile.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
3563190724 color-lcms: recognize single bounded curve segment
I don't have a specific use case in my mind for this, but it is
something we can easily handle.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
cca907c1d4 color-lcms: refactor into get_defining_curve_segment()
I need the new function for another purpose later, and this makes
get_parametric_curveset_params() easier to read.

Pure refactoring: no change in behavior.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
720f69c44d color: add weston_cm_send_parametric_info()
Implementation of sending the protocol info events for an arbitrary
parametric image description.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
7c4df878eb color: weston_cm_send_tf() handles power-law
The power-law TF uses a different protocol event than others. Adding
support for it requires passing in the parameters.

Now we have a single send function that handles all protocol TFs, not
just those without parameters.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Pekka Paalanen
fbb7b8307d color-lcms: move code into cmlcms_send_icc_info()
Pure refactoring to clean up cmlcms_send_image_desc_info() ahead of
implementing generic parametric information sending.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-12 16:53:32 +02:00
Leandro Ribeiro
8ea328471b clients: fix build issue with simple-im
Since glibc version 2.43, bsearch may return const void * instead of
void * when the input array is const:

"For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is a
pointer to a const-qualified type."

So change variable that receives the return value from bsearch to const,
as the input array has the const qualifier. This fixes a "discards const
qualifier from pointer" error.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-11 08:29:05 +02:00
Pekka Paalanen
6077ba5fec backend-drm: use bits_to_str_stream() in state-propose
Before, these pieces of code were allocating, formatting and freeing the
bit flags string regardless of whether debug logging was used or not.

Now, the bit flags string is formatted only when debug logging is
active, and it does not involve malloc+free.

This should improve performance a bit.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
c5dcdacdc0 backend-drm: refactor open-coded connector_add_prop()
The only difference is a small one in the debug print, otherwise this is
completely identical.

Makes drm_pending_state_apply_atomic() slightly more maintainable.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
9b177e381a libweston: store format modifier name in weston_buffer
This should cut the cost of debug_scene_view_print_buffer() in half on
ARM A55 CPU. Debug printing is quite expensive on such platform.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
d993f783b0 libweston: add internal weston_buffer_destroy()
Two lines open-coded in two places was not much a problem, but I'm going
to add a new member to weston_buffer that needs freeing, and I want to
do it in just one place.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
9d1320b8fb libweston: use fputs() in scene-graph printing
Use fputs() as much as possible. My theory is that since fprintf() needs
to scan through the format string to find any formatting codes, it must
be less efficient than fputs() that does not scan.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Marius Vlad
cba56affdc libweston: Add a bits_to_str_stream() equivalent variant
This is useful for cases where we already have an open stream which we
can pass straight in and use it when printing node information.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
e9665ef36f libweston: print scene-graph into FILE
Being able to print the scene-graph straight into a FILE removes one
temporary memory allocation that used to be mandatory. That memory
allocation is now gone from the DRM-backend debug log. It has moved into
the scene-graph log scope. In the case of
weston_log_subscription_printf() it shouldn't matter, because it is only
used when new subscribers appear.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
60567e7bd6 libweston: route log scope printf through FILE
The old implementation malloc'd a temporary buffer to hold the formatted
string, flushed it out to subscribers, and freed the buffer. On every
single call.

Forwarding the formatted output to the input stream instead avoids the
malloc. It is flushed explicitly so that interleaving messages through
multiple scopes continues to work. Color-lcms module uses that.

Also fix reference to the non-existing function
weston_debug_stream_write().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
664e882415 libweston: add weston_log_scope_stream()
Printing directly into an stdio stream and hooking up to the flush (the
write callback) avoids having to allocate+free a temporary buffer on
every printing call. The FILE uses a permanent buffer for storing the
text, and once it fills up or a newline is detected, it is flushed out.

It is fine to mix the new and the old APIs, since the old API flushes
the stream.

The buffer size of 3 kB is just a guess.

The man-page for fopencookie() recommends setting _FILE_OFFSET_BITS to
64. Even though this patch does not strictly need it (we don't implement
seek or take the address of fopencookie()), I think it's good to follow
anyway.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Pekka Paalanen
007faaf2d2 backend-drm: track drm_repaint_flush() with Perfetto
to follow its performance.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-03-10 16:40:40 +02:00
Marius Vlad
f8b39037ad libweston: Track weston_compositor_print_scene_graph
For logging performance profiling.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-03-10 16:40:40 +02:00
Marius Vlad
02aa53eb4b libweston/renderer-vulkan: Fix minor warning messages
When building without any of the x11 and wayland we still to have some
unused variables/functions.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
2026-03-06 16:50:49 +02:00
liupeng
4f963b68e0 tests: add newline to test-harness-plugin description
Signed-off-by: liupeng <liupeng01@kylinos.cn>
2026-03-06 14:07:18 +02:00
Erico Nunes
ba10e6d814 vulkan-renderer: guard surface output creation with backend defines
Fix compilation errors when compiling with x11 or wayland backends
disabled or not available.

Fixes: 8f56d03d ("libweston: Vulkan renderer")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2026-03-05 17:37:13 +01:00
Leandro Ribeiro
becbd36b61 tests: ensure image description done event received
We may break out of the loop if wl_display_dispatch(client->wl_display)
fails and returns -1. So we need to assert that info->done is true after
the loop.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-05 13:17:25 +02:00
Leandro Ribeiro
672402c2c0 tests: add tests for grayscale color effect
We've just added support for grayscale output color effect. This adds
test cases for that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-04 13:12:07 -03:00
Leandro Ribeiro
32d0bd3d0e compositor: add grayscale output color effect
This adds a new output color effect: grayscale. It takes RGB color as
input and computes a gray pixel color using the luminance formula for
linear sRGB:

Y = 0.2126 * R + 0.7152 * G + 0.0722 * B

Just like the other color effects we have, this only works for sRGB and
are not enabled when color-management is on.

Note: although the technique is designed to be applied in linear, it's
costly to convert to linear and then back to electrical. As doing the
conversion in electrical still gives a reasonable result, we do it this
way. When we add support for color effects with color-management on,
we'll apply the effect in linear.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-04 13:11:56 -03:00
Leandro Ribeiro
ed29f588e4 gl-renderer: log inversion color effect to paint node scope
This was logging the CVD correction effects, but not the inversion one.
This commit adds this.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-04 13:09:14 -03:00
Leandro Ribeiro
bb12c7225a man: better explain color inversion
The explanation of what a color inversion is was not clear. With this
commit we improve that.

Color inversion computes the RGB complement (i.e. 1.0 - color) of the
input.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-04 12:27:19 -03:00
Leandro Ribeiro
a44d01b918 frontend: simplify wet_output_set_color_effect()
This function has a few leftovers. At first (downstream) it was
returning error, and callers would handle it. The effect would be a
black screen in case of failure.

Instead, when the MR was proposed we've decided to just log an error and
not set the effect, as it is easy to see that the effect is not applied.
It is better displaying the output without effects than a black screen.

We ended up with a function that always return success. So let's remove
the return value and simplify callers.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-03-04 12:27:19 -03:00
Michael Tretter
d0d878972c backend-drm: prefer crtc with most supported planes
When selecting a crtc for an output, prefer the first available crtc that
supports the most hardware planes.

This increases the chance that the compositor can make use of hardware planes
for compositing instead of falling back to rendering just because it selected a
crtc that only supports one plane.

I found this on i.MX6, which has 4 crtcs and 6 planes. crtc 0 and crtc 2 have
two planes, and crtc 1 and crtc 3 have one plane. The current selection
algorithm selects the last matching crtc, which is crtc 3 and prevents the use
of planes.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2026-03-04 13:27:07 +00:00
Derek Foreman
bbcd7d005b drm: Make underlay/overlay per output
Now that we have per output plane lists, we can make the overlay/underlay
subtype be part of the plane handle, and make the has_underlay property
part of the output.

This fixes bugs on platforms where not all CRTCs have the same
minimum zpos, and underlays can be broken for all outputs because
one output doesn't have any.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-03-04 13:17:49 +00:00