Commit graph

10756 commits

Author SHA1 Message Date
Derek Foreman
b61898fecd compositor: Initialize output vrr_mode
weston_output_init() should be setting all members to a default value,
it can't assume anything is already 0.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-23 11:02:02 +00:00
Leandro Ribeiro
96f51b72d3 tests: add xdg-shell defunct surfaces test
Since commit "xdg-shell: handle xdg_wm_base being destroyed before its
children", we raise a protocol error DEFUNCT_SURFACES for misbehaved
clients.

This adds a test to ensure that DEFUNCT_SURFACES is being posted for
such clients.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
ddb1f1973a tests: rename xdg-shell-initial-commit to xdg-shell-test
In the next commit we add more tests to this, so let's rename.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
e7d300f79e tests: use SHELL_TEST_DESKTOP in xdg-shell-initial-commit
There's no need to use the desktop-shell if the purpose of these tests
is to test our xdg-shell implementation.

In the next commits it will be important to have a simpler shell to
work with, as we'll introduce additional tests for xdg-shell that
trigger leaks that are hard to fix with the desktop-shell.

So let's change this test file to use SHELL_TEST_DESKTOP.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
446f36b0cd xdg-shell: ensure that client resource is not NULL before use
Functions that implement the xdg_surface, toplevel and popup
interfaces may depend on struct weston_desktop_client::resource.

In normal circumstances, this resource can't be NULL. The xdg protocol
extension forbids destroying xdg_wm_base before destroying all its child
surfaces. If that happens, we disconnect the client with protocol error
DEFUNCT_SURFACES (see commit "xdg-shell: handle xdg_wm_base being
destroyed before its children").

But during client teardown resources are destroyed in arbitrary order,
so it is possible that client resource becomes NULL before its surfaces
are destroyed.

This commit adds checks to avoid using NULL client resource, in order to
avoid crashes. It is safe to silently do nothing in these cases, as the
client is being destroyed anyway.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
a7321d7515 xdg-shell: avoid leaving dangling pointers on resource creation failure
Currently if weston_desktop_surface_add_resource() fails to create a
wl_resource, it disconnects the client and destroys the desktop surface
that we pass.

It is odd to do that, callers should be responsible for destroying the
desktop surface when it is reasonable to do so. This is dangerous and
can leave dangling pointers.

Besides that, in many cases callers should not even destroy the desktop
surface, as they are not the owners of it. When we are giving the role
of toplevel/popup to a xdg_surface and we fail to do so, client gets
disconnected and the base desktop surface will get destroyed by the
destructor of the xdg_surface resource.

This commit fixes these issues, bringing a more consistent behavior.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
2263cbf2ea xdg-shell: handle xdg_wm_base being destroyed before its children
According to the xdg-shell protocol specification, if the xdg_wm_base
object is destroyed while there are still xdg_surface objects associated
with it, the compositor must post a protocol error (DEFUNCT_SURFACES) to
the client. In this patch we do that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
Leandro Ribeiro
65e82a47d8 libweston: do not forget to emit touch->focus_signal
This signal is never emitted when touch focus changes. In this patch we
start emitting it, allowing listeners to react to touch focus changes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-20 22:13:01 +00:00
Derek Foreman
0e320f3364 drm: Burn down drm_output_set_cursor_view
We can get this right from the plane state/paint node now, so let's do
that and get rid of a bunch of crufty stuff.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-19 14:37:04 -06:00
Derek Foreman
0a0ed0653b compositor: return paint node from weston_output_damage_flush_for_plane
Right now, any non-renderer plane only has a single paint node on it. It
can be useful to know what paint node that was after the damage flush.

This will be used shortly to simplify cursor handling in the drm backend.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-19 14:35:53 -06:00
Pekka Paalanen
42cf94143c libweston: give paint nodes internal_name and use it
Makes it much easier for humans to track paint nodes through debug logs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
62d1516fc2 libweston-desktop: replace surface %p with name
The name is easier to read and match for humans than a memory address.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
ccce888a68 libweston: two more view %p to change
Use the internal name here as well, to match the scene-graph and for
easier reading.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
b9a8c4d80c libweston: reword FAILURE_REASONS_NO_COLOR_TRANSFORM
I found it confusing to read:

[view] view 3-2-1 will be placed on the renderer: no color transform

The view definitely has a color transform. What this means is:

[view] view 3-2-1 will be placed on the renderer: cannot off-load color transform

I hope that's more clear.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
c9cb3e425b backend-drm: use view internal_name in debug
The scene-graph debug already uses these names, and they are much more
human-friendly to read than memory addresses.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
f87b1afbc4 libweston: do not pass NULL role_name to fprintf
Makes the print-out a little bit tidier. Passing NULL for "%s" is
handled by glibc gracefully, but I'm not sure what standard requires it
if any.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
9c2ea5c11f libweston: use view internal_name in scene-graph prints
We have a consistent and more human-friendly name for views. Use it
instead of pointer values, view_idx, and protocol object ID. This makes
the scene-graph print more readable.

I presume the view_idx was just an ad hoc human-readable addressing for
views. It was stable only as long as the scene-graph didn't change. The
view internal_name is always stable and unique.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
cfecdce2f5 libweston: give weston_views a simple name
Views did not have any identification of their own, except the memory
address "%p" (not human-readable) and very likely assumption that a
surface would have only one view (but we support multiple views).

For trace and debug print purposes, give views nice names like we just
added for surfaces. The owning surface is apparent from the view name.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
a209e13526 libweston: give weston_surfaces a simple name
So far we have had two ways of identifying a weston_surface: by its
memory address "%p", and by its get_label function. The memory address
is not human-friendly and can get recycled. get_label() is not unique,
and in some cases it is client-controllable.

Oh, we also have the protocol object ID, but that does not exist for
internally created weston_surfaces.

We also have weston_surface::s_id, damage_track_id and flow_id. These
are used by some Perfetto instrumentation. s_id comes from a
compositor-wide counter rather than per-client counter, the others are
probably not what I'm looking for.

None of these are really nice for trace and debug prints for identifying
surfaces for human reading. Therefore, let's add one more ID, and with
it, a nice name for each surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
ef12578938 frontend: give Xwayland client an internal name
This will make Xwayland client's internal object names pop in
scene-graph etc.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:21:19 +02:00
Pekka Paalanen
df622cbb20 libweston: track clients
This adds the framework to track clients with custom data. The first use
is to associate an ID with each client. The ID is much better suited for
debug printing than a pointer value.

The string representation is stored so that it can be overridden if
desired for compositor forked clients like Xwayland or shell helpers.

Change to a struct in the public header forces a major version bump for
this development cycle.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 16:20:39 +02:00
Pekka Paalanen
e1c8b819cf color-lcms: implement parametric-to-icc transforms
This is a basic implementation. First the input parametric profile's
transfer function is decoded, and a HDR-aware luminance mapping into a
[0, 1] relative SDR luminance expected by the ICC workflow is done.
Then, a shaper+matrix ICC profile is crafted with the primaries, white
point and black point of the input profile. That is connected with the
output ICC profile similar to init_icc_to_icc_chain(). LittleCMS handles
the rendering intents.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
7edf984426 color-lcms: implement icc-to-parametric transforms
This is a basic implementation. The input ICC profile is connected to a
shaper+matrix profile that uses the output primaries, white point, and
black point. This way LittleCMS applies the rendering intent. Then, we
manually add HDR-aware luminance mapping and the output electrical
encoding when necessary.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
4f93196ee1 color-lcms: debug print the color transformer
To see what is outside of the ICC-to-ICC pipeline, when falling back to
3D LUT for example. This will be particularly useful with
parametric<->icc color transformations.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
f4ed075d9e color-lcms: always set up transformer
Set up the color transformer even when steps_valid.

There will be cases where the color transformation needs to be applied
on the CPU: solid color surfaces, renderer debug drawings, and
DRM-backend 3D LUT when it cannot realize the steps for some reason.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
53c405bad7 color-lcms: extend color transformer
When parametric<->ICC color transformations are created in the future,
they need more than the icc_chain. Add the needed elements.

This path is used for the 3D LUT fallback when the steps in struct
weston_color_transform cannot be used.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
02c371312a color-lcms: add cmlcms_color_transformer
When parametric<->ICC color transformations are implemented, a single
cmsHTRANSFORM will not be enough for evaluating a color transformation.
At least one more curve and a matrix will be needed. This introduces the
structure to encapsulate them all. For now, we just wrap the existing
cmsHTRANSFORM.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
35a6ba540e color: const and export weston_color_curve_sample()
Color-lcms plugin will need this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
492b2de5af color-lcms: detect identity matrix in color mapping
Check that we never store an identity matrix as an arbitrary matrix.
This can make processing of weston_color_mapping more efficient.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Pekka Paalanen
f02fc8009b color-lcms: translate ext-linear as identity curve
When we have the ext-linear transfer function, normalize that into the
identity curve. Then it's easier to avoid adding unnecessary identity
elements when translating a weston_color_curve to something else.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-19 14:38:10 +02:00
Marius Vlad
3caa81aa91 meson.build: reopen main for regular development
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-19 10:06:12 +02:00
Marius Vlad
c9c305121c build: bump to version 15.0.0 for the official release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-19 09:22:18 +02:00
Marius Vlad
d0864d6a02 build: bump to version 14.0.97 for the RC5 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-13 19:21:59 +02:00
Loïc Molinari
ba0cb38d0a gl-renderer: Disable texture validity checks by default
Texture storage formats and parameters validity checks are done using
glGet*() functions which can be pretty slow depending on the OpenGL
implementation. Wrap these checks around a define disabled by default
in order to get the best OpenGL renderer performance in release
builds.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2026-02-13 17:04:05 +00:00
Loïc Molinari
927386fa84 gl-renderer: Check texture storage parameters (GL <= 3.0)
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2026-02-13 17:04:05 +00:00
Pekka Paalanen
1a903e6aa0 drm: debug page flip timestamps
This helps to see if the driver returned garbage that triggers an
assertion failure, or if the assertion failure in
weston_output_finish_frame() is more subtle.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-13 16:53:34 +00:00
Pekka Paalanen
1c8af90ca3 drm: fix presentation flags for tearing
If we might tear, we cannot claim we don't tear.

If we read the software clock, we don't use measurements from the KMS
hardware.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-02-13 16:53:34 +00:00
Michael Tretter
9cb9a823d2 backend-drm: fix comment about initial underlay zpos
The comment seems to be garbled. Fix it.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2026-02-13 16:41:16 +00:00
Michael Tretter
9653528885 backend-drm: rewrap log message
Remove the explicit newline in the log message. Since the log may be wrapped by
the viewer, having the newline in there is not helpful.

While at it, rewrap the string to have shorter lines in the source code.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2026-02-13 16:41:16 +00:00
Derek Foreman
a43dc1c9ce frontend: Fix incorrect error messages
One's a copy and paste error, the other wasn't updated when some other
text changed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-13 16:26:51 +00:00
Marius Vlad
c648ac680c build: bump to version 14.0.96 for the RC4 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-13 17:55:04 +02:00
Robert Mader
26f3df0344 drm/state-propose: Centralize check for primary plane
In order to make the code easier to follow. No change in behavior
intended.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-13 11:41:45 +01:00
Robert Mader
45359b7913 drm/state-propose: Tighten check for primare plane candidates
Check that the view and region completely cover the whole output.
If the view is (partly) semi-transparent, the background region should
cover the area below it - after the changes in the previous commits.

This allows us to remove the now redundant check in the plane selection.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-13 11:40:39 +01:00
Robert Mader
0a7ee49d92 drm/state-propose: Only use background region with last visible pnode
In the following commits we want to allow semi-transparent views to go
to the primary plane in more cases, e.g when two (or more) instances of
weston-simple-egl are visible on top of a black background.

In that scenario both/all instances would qualify, resulting in the
first candidate to be picked, accidentally making us use underlay
planes. While the visual result would still be correct wherever
supported by the HW (e.g. on the AMD system I mainly test on), it may
break if only overlay planes are supported. Generally it's an unexpected
and unintended change of the plane selection algorithm.

Thus let's be conservative and only consider the background region for
the last visible pnode (the one with the lowes zpos).

This leaves room for further optimizations in the future.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-13 11:40:11 +01:00
Robert Mader
8114e410d3 drm/state-propose: Calculate obscured region from overlay planes
The background region only contains visible parts of the region, excluding
any regions obscured by pnodes on top of it. If such (partly) opaque pnodes
have been assigned to overlay planes, we should consider them when checking
whether a view can go to the primary/scanout plane.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-13 10:52:51 +01:00
Robert Mader
35f23903cd compositor: Add helper to get the opaque region from a pnode
To make use of recent optimizations for the is_fully_opaque
calculation, not only relying on the opaque region any more.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-13 10:50:32 +01:00
Robert Mader
6afa223d1c drm/state-propose: Pass background_region as const
To make it obvious that the region doesn't change.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-02-12 14:13:12 +01:00
Derek Foreman
d16955a873 compositor: Fix deferred repaints
When we switch to the deferred state, we want to complete all outstanding
repaints first - even ones started from the idle handler immediately
after we called weston_backend_set_deferred().

Fixes #1090
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-09 15:10:21 -06:00
lxylxy123456
874bf36c51 clients/window: Fix segfault when dragging with touchscreen
Signed-off-by: lxylxy123456 <lixiaoyi13691419520@gmail.com>
2026-02-09 00:32:42 -08:00
Marius Vlad
db4f7080f6 doc/perfetto: Add a simple perfetto out-of-tree trace config
Which is required when capturing a trace.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-06 16:51:21 +02:00