Commit graph

10831 commits

Author SHA1 Message Date
Derek Foreman
e17a219885 renderers/clients: Bump gbm version requirement to 21.3
Drop support for libgbm versions without gbm_bo_create_with_modifiers

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-05-04 12:00:10 -05:00
Marius Vlad
689f6bd9ba renderer-gl: Improve accurancy when printing elapsed time
This avoids truncation to zero, by using an explicit cast to float and
print out properly the last 2 digits.

43 / 1000 = 0.00
43 / 1000.0 = 0.04

Fixes: 2d70cbf037

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-01 15:39:21 +03:00
Marius Vlad
4e596fca83 renderer-gl: Fix duplicated begin/end timestamps
Fix trivial typo when printing out GPU timeline timestamps.

Fixes: 2d70cbf037

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-01 15:29:08 +03:00
Derek Foreman
54a25720c6 compositor: Give paint nodes their own flow id
Since a paint node is a combination of surface, view, and output, using
the surface flow in paint node functions can make a confusing twisty mess.

Perfetto flows have in/out degree of one, so we can't properly express the
1 surface to multiple paint nodes relationship with flows.

So for now let's break up the surface and paint node flows, but in the
future we'll have better ways to map multiple flow starts to the same
function via INSTANT events, and we'll be able to better link surface
content update to paint node render.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 10:10:08 -05:00
Derek Foreman
8a8cc8486a perfetto: Put the damage event in the flow instead of the clean event.
The Damaged event is the result of a content update application on a
surface. So it makes sense to put this in the flow for the surface.

The Clean event comes from a render completion that could be driven by any
surface, so it doesn't really make sense to consider it part of surface
flow.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 10:06:06 -05:00
Derek Foreman
ae2fbb9f9a fifo: Remove unused flow_id
This was never used, and never will be.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 09:06:59 -05:00
Leandro Ribeiro
e0c5b8a26b compositor: emit sleep signal
A few custom shells want to know when the compositor is going to sleep.
This adds a new sleep signal and emits it when DPMS is going off.

To showcase the feature, this adds a sleep signal listener to
desktop-shell whose handler logs a message.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-22 17:44:29 +03:00
Derek Foreman
fcb0d75d44 vulkan: Support non-axis aligned rotations
We really just need to set the clipper up with the existing function
to get this to work.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-21 17:24:51 +03:00
Derek Foreman
af736168f7 clients: Fix dmabuf feedback stall in simple-vulkan
When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.

However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.

Instead, we should reset the fence right before we know we're submitting
work.

Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-20 13:11:10 -05:00
Derek Foreman
fc7bb13bbb tests: Skip udmabuf tests before initializing client
We currently leak resources and hit asserts if dmabuf is unavailable.

Move the check to before we initialize anything.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-16 21:17:10 -05:00
Pekka Paalanen
35527e6eed 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-04-16 13:46:22 +00:00
Pekka Paalanen
dbdb5f92f2 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-04-16 13:46:22 +00:00
Derek Foreman
8872d5ee14 frontend: Fix superficial bug in VRR handling
We should just return 0 on success, not return some enum with
a value that happens to be initialized to something that resolves
to 0.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-15 15:50:39 -05:00
Derek Foreman
978052f9ed drm: Use weston_log_scope_puts when we don't have a format string
We can use __VA_OPT__ to make a macro that automatically selects between
the puts and printf log scope variants.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-14 17:12:05 +03:00
Derek Foreman
ec5a7ee8fe log: Add weston_log_scoped_puts()
In case we want to write an entire string without formatting.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-14 17:12:05 +03:00
Pekka Paalanen
2a7288e70e tests/buffer-transforms: reduce split cases
The point of buffer_transform_split is to ensure that committing only
transform and scale changes gets reflected on screen, without explicit
damage. There is no need to go through the big set of parameter
combinations, it only needs to test that changing each triggers the
damage.

Test setting only scale and only transform separately, so that one
cannot mask bugs with the other.

This brings the screenshot count for buffer_transform_split from 12 down
to 2, which is good for CI running time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-10 12:03:43 +03:00
Pekka Paalanen
3ce5a2e774 tests/output-damage: doc renderer testing
This test was originally written to ensure Weston does not repaint too
much, but it does also test that renderers transform the damage
correctly into the framebuffer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-10 11:51:05 +03:00
Derek Foreman
0024857086 pixman-renderer: Remove weston_view from repaint_region
We now have the view alpha cached in the paint node, so we can get it
from there.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
7dcf887903 renderers: use pnode view_alpha everywhere
Don't look this up from the weston_view anymore.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
77eb13f499 drm,renderers: Remove some unnecessary indirection
pnode->view->surface is the same as pnode->surface, always.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
3ff456175a gl-renderer: Log paint node internal name instead of view
Continuing my quest to remove weston_view from backends and renderers,
drop gl-renderer's last use of weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
22bcfead57 compositor: Add a weston_coord_global_to_surface_for_paint_node and use it
Add compositor code to handle this so the gl-renderer can reference just
the paint_node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
f5fb552b57 drm: Fix stale comment that refers to weston_view
This is passed a weston_paint_node, not a weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
6a06562b77 drm: Rename find_plane_for_view
We're passing a paint node already, so let's just change the name.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
1ec218026a compositor: Store view alpha in the paint node
This is one of the few things backends and renderers still need to grab
from the view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
d85618a029 drm: rename node to pnode in drm_output_find_plane_for_view
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
a0f860ad70 drm: Stop using weston_view in drm_assign_planes
We can get all these things from surface through paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
501f6d31b1 drm: Stop using weston_view in try_paint_node_on_plane
We've removed all need for this now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
9042fd41d7 drm: Store paint node instead of view in plane state
The paint_node life cycle should match the output's, so we should be able
to store it in the state instead of a view.

This gets us closer to having the backends stop caring about views.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
6f09ba42bd compositor: Add cursor layer status to paint nodes
Store this in the paint node so we don't have to look it up in the view
in the backends.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
838d6d92be drm: Don't use weston_view in drm_output_find_plane_for_view
We can get what we need via the paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
c1fcfd288d drm/state-propose: remove output asserts in z_order_list walks
We already validate the paint node list in weston_output_repaint,
immediately after we conditionally rebuild the z_order_list.

These asserts are thus completely redundant, as we've already
performed them in the front end.

My reason for removing this now is to drop weston_view usage
from the backend.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
96676d114c drm: Don't use weston_view in drm_fb_get_from_paint_node
We have no need for a weston_view here.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
3c53883d78 drm: Use is_fully_opaque from paint node in drm_fb_get_from_paint_node
The paint node early update has already checked this value for us, we
should use that instead of interacting with the view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
9022976412 drm: Log paint node internal names instead of view internal names
Backends work on paint nodes, not views - and the paint node internal
name is a superset of the view internal name anyway, so it's not hard to
figure out which view a paint node belongs to when reading debug text.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
ef5164aa06 drm: Pass a paint node to dmabuf_feedback_maybe_update
The failure reason is already part of the paint node, so passing the view
here just makes things a little bit more complicated.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:04 -05:00
Derek Foreman
300c41858c drm: Use surface from paint node in drm_fb_get_from_paint_node
One fewer reasons to keep use the weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:04 -05:00
Derek Foreman
6169657e24 vnc: Don't use weston_view
We've got a pnode, use that instead.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:03 -05:00
Derek Foreman
b3d18455dd drm: Change node to pnode in drm_output_prepare_cursor_paint_node
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:03 -05:00
Derek Foreman
dd88c1fddd drm: rename node to pnode in drm_output_try_paint_node_on_plane
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:02 -05:00
Derek Foreman
febd93e4da compositor: Replace view_has_valid_buffer with paint_node_had_valid_buffer
Backends should be relying on paint nodes for their information, not
views.

Since we always have a paint node when we want to pass a buffer, we can
pass that instead of a view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:39:58 -05:00
Derek Foreman
f4a56f057f drm: Pass paint node to drm_fb_compatible_with_plane
The backends shouldn't care about views as much as they do,
so pass the paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:38:03 -05:00
Derek Foreman
69efa21e08 drm: Pass paint node to cursor_bo_update
This doesn't need anything view related, and we already have the node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:38:03 -05:00
Pekka Paalanen
22db719484 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-04-09 13:00:26 +00:00
Pekka Paalanen
a5ffb96d23 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-04-09 13:00:26 +00:00
Pekka Paalanen
e9c388b5a1 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-04-09 13:00:26 +00:00
Pekka Paalanen
63e58c47e4 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-04-09 13:00:26 +00:00
Pekka Paalanen
54b60ad51a 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-04-09 13:00:26 +00:00
Pekka Paalanen
0e474b763f 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-04-09 13:00:26 +00:00
Pekka Paalanen
df2c7bb370 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-04-09 13:00:26 +00:00