Commit graph

10926 commits

Author SHA1 Message Date
Pekka Paalanen
37860bace5 tests/color-management-protocol: add inert_get_preferred_image_description
Extend test coverage.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:12:33 +03:00
Pekka Paalanen
08af0811cb tests/color-management-protocol: add set_bad_rendering_intent
Extend test coverage.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:12:33 +03:00
Pekka Paalanen
22f6b4ecc7 tests/color-management-protocol: add set_inert_surface_image_description
Extend test coverage.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:12:33 +03:00
Pekka Paalanen
8e7e882b67 tests/color-management-protocol: add set_failed_image_description
Extend test coverage.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:12:33 +03:00
Pekka Paalanen
5776cbb063 tests/color-management-protocol: add soft-fail image description
We need to be able to test cases where a client tries to use a not-ready
image description. Turns out passing an fd for a directory fails just
the right way without triggering protocol errors.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:12:13 +03:00
Pekka Paalanen
1ffa089f7f tests/color-management-protocol: move parametric_cases
Move all the parametric_cases definitions just above the TEST_P() using
them, to be close to the code that needs them.

While the diff might look odd, this is really just moving the one big
block of code verbatim.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:05:14 +03:00
Pekka Paalanen
ad3fbd3823 tests/color-management-protocol: rename case array
There may or may not be more case arrays, so rename these to hint
towards which test is using this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:05:14 +03:00
Pekka Paalanen
a41eac42ce tests/color-management-protocol: trigger error_surface_exists
Cover a new failure case, but also make sure the re-creation is still
accepted.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:05:14 +03:00
Pekka Paalanen
00e9842a1b tests: rename -parametric to color-management-protocol
This is the program's new scope.

Also drop unnecessary dependencies, these were consolidated when color
management protocol helpers moved into the harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:05:14 +03:00
Pekka Paalanen
e593d9142d tests: rename color-management to image-description-query
This is the program's new scope.

Also drop unnecessary dependencies, these were consolidated when color
management protocol helpers moved into the harness.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:05:14 +03:00
Pekka Paalanen
55337ac35a tests: move non-repeated test into parametric
color-management-test will turn into image-description-query test, which
runs with an array of fixtures setting up different output image
descriptions, and checks the preferred and output image
description information.

The param test will test everything else non-screenshots that does not
need to iterate over different output image descriptions.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-26 15:02:43 +03:00
liang zhou
0f3df6f168 libweston: add new API weston_compositor_bind_touch
Allow weston plugins to implement custom touch binding logic by using
this API.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
liang zhou
751a5a5f74 libweston: add set_output param for weston_touch_create_touch_device
Add the set_output function to weston_touch_device to allow touch binding
interfaces to re-assign the touch-to-output mapping.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
liang zhou
3427788c40 libweston: add API to find weston output by head serial
Add new API weston_compositor_find_output_by_head_serial for touch
binding.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
liang zhou
edce1fea4b libweston: add API to get serial number from weston head
Plugins need to get the serial number of the weston_head to match the
touch devices.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
liang zhou
d774dba68a libweston: add API to get touch device list
Add API for plugins to retrieve touch device list for initializing touch
devices at startup.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
liang zhou
1269a908d5 libweston: add touch device creation signal
Add a signal for touch device creation to allow plugins to detect and
respond to touch device changes.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-05-26 09:01:37 +00:00
Elliot Chen
615f6c0322 backend-pipewire: fix dmabuf memory leak on renderbuffer creation failure
When create_renderbuffer_dmabuf() fails and returns NULL, the previously
allocated linux_dmabuf_memory was leaked because pipewire_output_setup_dmabuf()
had already been called with no cleanup path.

Reorder the calls so that create_renderbuffer_dmabuf() is invoked first.
If it fails, explicitly destroy linux_dmabuf_memory and return early to
avoid the leak.

Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
2026-05-26 09:10:58 +01:00
Pekka Paalanen
d36596b25c color: dissolve cm_image_desc_destroy()
The only legal way to destroy a cm_image_desc is to go through the
wl_resource destruction. Calling the function otherwise would have left
a dangling pointer in the resource. Let's not have the temptation to
"fix" that dangling pointer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-25 13:38:57 +00:00
Pekka Paalanen
bc554e537b color: remove unnecessary cm_image_desc->cprof checks
Since "color: refactor cm_image_desc_create()" if cm_image_desc exists
then the cprof exists as well.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-25 13:38:57 +00:00
Pekka Paalanen
209afd400d color: refactor cm_image_desc_create()
Previously, cm_image_desc_create() created the wl_resource, the
compositor object, and linked them together. Call sites that do not have
a ready-made color profile to use for it, had to call
cm_image_desc_create() with a NULL cprof. Then they would attempt to
create the cprof, and:
- if it succeeded, patch it into struct cm_image_desc;
- if it failed, release the cm_image desc and reset resource user data
  to NULL.

Let's make this more straightforward by refactoring.

create_image_description_resource() creates the wl_resource and sets up
the implementation, but user data remains NULL. This is a common
operation done at all cm_image_desc_create() call sites.

link_image_description_resource() creates struct cm_image_desc and links
it to the resource via user data. This can only be called with a valid
cprof.

If anything fails, there is no need to back things out like before. The
sending of errors and 'ready' events is consolidated.
cm_image_desc->cprof is guaranteed to be non-NULL.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-25 13:38:57 +00:00
Derek Foreman
1edb3a6fe2 trace: Convert fixed to double for prettier display of pointer events
Convert the pointer surface coordinates to doubles so we can more readily
see what they mean.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
abccfe3b5c trace: drop the explicit flow from COMMIT_ANNOTATION
Replace this with flow annotations, allowing us to burn down even more
copy pasta.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
df36535499 commit-timing: Remove unused flow_id
We never hooked this up, so let's remove it for now and worry
about it later, if at all.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
5f3bfc0d2f trace: Remove old flow macros and functions
Now that flows are mostly annotations, we can burn down all the old
unused flow macros.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
41fd97e0ea trace: Update input to use flow annotation
Use the new method of adding flows for input.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
8f6a824c48 trace: Update transaction to use annotated flows
Use the new annotation flows for this as well.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
bc41a11c3b trace: Use flow annotation for weston_surface and surface_state
Use the new method of adding flows for these.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
cc2a85cb59 trace: Add flow as an annotation and use it for paint nodes
Annotations give us a more generic way to incorporate flows into our
perfetto traces.

This will eventually let us remove some _FLOW() variants of our trace
macros.

It also lets us have multiple flows through the same function/annotation.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
3796267cfc trace: Fix WESTON_TRACE_ANNOTATE_FUNC() when not building perfetto
This should be variadic. Nothing uses it, so it hasn't broken yet,
but we're about to use it, so clean it up.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
dc9ce8dd20 trace: update annotations even when not tracing
This hopefully isn't ridiculously heavy. The heavy part is committing the
flow array later, which is already gated by perfetto internally, so we
don't have to protect anything here ourselves.

This makes it easier to put flows in annotation arrays, because flows need
to be kept up to date even when not tracing.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
d35259e3b2 trace: Fix typo in double annotations
They're setting the float value instead of the double value, which leads
to corrupt output.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:45:31 -05:00
Derek Foreman
dee08a8a32 trace: Fix buffer annotator
This was supposed to early return after logging the NULL buffer, not
foolishly carry on and attempt to dereference it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:11:26 -05:00
Derek Foreman
6adef7fa06 trace: Don't try to show details when there's no focus client
This can turn into a NULL pointer dereference, and the values
aren't meaningful in this state anyway.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-21 16:10:04 -05:00
Marius Vlad
a276db50f8 input: Add support for tracking input events on egress side
This includes an additional _double variant for _Generics and a bool
one.

Similarly, _WESTON_TRACE_ANNOTATE_FUNC_FLOW gets a _Generics macro variant
to handle the case were we have a integer flow ID, rather than an a
pointer.

Finally we always have a flow ID set when weston_input_event gets
initalized.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-21 21:58:17 +03:00
Marius Vlad
5d07696101 input: Add TL_POINTs for kernel timestamps at input initialization
This basically starts tracking input event. From here on we can start
flow tracking the event until it exits and is being delivered to the
client.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-21 21:47:05 +03:00
Marius Vlad
a1ac3c2e8d timeline: Add support for weston_input_event
And with it include a dedicated track in Perfetto to display the event
timestamp on that a weston_seat. This includes support for timeline and
for timeline Perfetto.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-21 21:47:02 +03:00
Derek Foreman
9ce3759bc5 trace: Ensure flow id is always set
Ever since 160394b2c3 we can have
perfetto flow ids in const structs.

We need to preserve the perfetto flow even when tracing is disabled -
a flow will start in a function that has non-const access to a struct,
but other functions further along the flow may only have const access.

Fix up "instant annotations" to preserve flows when not tracing, and to
reset the annotation count on commit when not tracing.

I suppose this also fixes a potential race where annotations aren't
properly reset if tracing is started and stopped multiple times during
the execution of a single function - but I can't imagine that being possible
to hit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-20 18:31:02 -05:00
Philipp Zabel
8a1c91e771 backend-vnc, gitlab-ci: Update to Neat VNC 1.0.0, aml 1.0.0
Update to Neat VNC 1.0.0 and aml 1.0.0, which promise stable API.

Adapt to API changes:
 - authentication API now wraps username/password into
   credentials and can be asynchronous
 - userdata get/setters are now type specific
 - fbs have been renamed to frames, storing dimensions and damage
 - nvnc_open() is split into nvnc_new() and nvnc_listen_tcp()
 - nvnc_close() is now nvnc_del()

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2026-05-20 13:26:34 +03:00
Pekka Paalanen
0123bee273 x11-backend: fix key-press typo
Probably copy-pasta. Noticed by gcc 15

../../git/weston/libweston/backend-x11/x11.c: In function ‘x11_backend_handle_event’:
../../git/weston/libweston/backend-x11/x11.c:1687:58: error: ‘key_release’ may be used uninitialized [-Werror=maybe-uninitialized]
 1687 |                                               key_release->detail - 8,

Fixes: 99527e6b92
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-05-19 17:48:15 +03:00
Marius Vlad
c6ae939221 input: Introduce weston_touch_event
Similar to "input: Introduce weston_key_event struct" this struct is for
touch events. With this we add the initialization helpers, pass the
weston_touch_event as a const and remove the timespec argument.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
98f8a08896 input: Re-work weston_pointer_axis_event
Move to a const struct weston_pointer_axis_event, add the base_event
struct that contains the timespec and use the initialization functions.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
539bb34df4 input: Introduce weston_pointer_button_event
Similar to "input: Introduce weston_key_event struct", this adds a way
to store all required information with a common struct event to be able
to pass it down and to allow also pass additonal information like
Perfetto's flow IDs.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
ce2f53a2f9 input: Remove notify_motion_absolute
We're now able to use the mask to pass the proper type so need for
a specialized version.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
f9c1a4bf5d input: Re-work weston_pointer_motion_event
This adapts weston_pointer_motion_event struct to align in with
weston_key_event and includes the following changes:

- include base struct
- remove the const struct timespec from calls and use the base struct
- pass by a const pointer motion event in all the callers
- add init helper

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
754d00e400 input: Drop time field from weston_pointer_motion_event
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:52 +03:00
Marius Vlad
47a3823672 input: Use weston_pointer_move_to on output re-configuration
Replace weston_pointer_move with weston_pointer_move_to and drop
uneeded weston_pointer_motion_event, as weston_pointer_move_to
would clamp the pointer inside the output's area.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-19 00:21:18 +03:00
Marius Vlad
99527e6b92 input: Introduce weston_key_event struct
Rather than passing a time stamp, key, key state and key event state
use a weston_key_event struct to pass by all that using it.

This would allow in further patches to attach additional information
like a flow id used by Perfetto debug annotations for input events.

This patch has no functional change as it is now.

All the callees will just will extract the required information out of
struct weston_key_event.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-13 21:38:55 +03:00
Robert Ancell
f41430a4eb Check positioner anchor and gravity enums
Signed-off-by: Robert Ancell <robert.ancell@canonical.com>
2026-05-13 16:50:37 +03:00
Derek Foreman
160394b2c3 trace: Use generics to allow flows in const structs
The flow_id set code obnoxiously wants write access to the flow_id always,
which can lead to situations where we can't pass a struct as const to
appease the perfetto code.

Now that we're embracing C generics, we can tell if a struct is const,
update the flow if it's not, and assert if we don't have a valid flow_id
when it is.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-13 15:27:51 +03:00