Commit graph

10834 commits

Author SHA1 Message Date
Leandro Ribeiro
ea28be0cf8 backend-drm: add quantization to drm_colorop_3x1d_lut_blob
We may have DRM LUT's for u32 and u16. This allow us to create both
types. Should be useful in the next commit.

u16 is used for legacy GAMMA_LUT, and u32 will be used for the newer
colorops in the next commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 15:23:54 -03:00
Leandro Ribeiro
371c3921fa backend-drm: add curve_step to struct drm_colorop_3x1d_lut_blob
No behavior change, this should be helpful in the next commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 15:23:54 -03:00
Leandro Ribeiro
e060a434a5 backend-drm: move drm_colorop_3x1d_lut_blob functions to colorop.c
Follow-up of "backend-drm: offload post-blend only if libdrm >=
2.4.130". This moves code related to offloading post-blend color xform
to colorops.c, which is built only if libdrm >= 2.4.130 is available.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 15:23:54 -03:00
Leandro Ribeiro
a62be1d582 backend-drm: allow offloading post-blend xform only if libdrm >= 2.4.130
In commit "backend-drm: introduce color pipelines" we've started adding
support for KMS plane color pipelines, which require libdrm >= 2.4.130.
The final goal is using color pipelines to offload pre-blend color
transformations.

Currently we support offloading post-blend color transformations even
with older libdrm versions, but that is not very useful by itself.

This patch makes offloading post-blend color transformations dependent
on the libdrm version as well. This allows keeping the code to offload
pipelines in a single file (which is built only if libdrm >= 2.4.130),
avoiding lots of #ifdefs and making the code easier to follow.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 15:23:47 -03:00
Leandro Ribeiro
c186e17cb2 backend-drm: introduce color pipelines
This adds support to the kernel proposal that introduces per-plane color
pipelines. For now it only manages the lifetime of the kernel objects
related to that.

In the next commits we start using all that to offload Weston pre-blend
color transformations to KMS.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 14:40:28 -03:00
Leandro Ribeiro
afc70eda78 backend-drm: rename drm_colorop_3x1d_lut to drm_colorop_3x1d_lut_blob
We use this struct to cache and avoid creating multiple blobs for the
same 3x1D LUT. So let's rename to better reflect that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 14:05:08 -03:00
Leandro Ribeiro
f960fdccf7 backend-drm: few cosmetic changes related to struct drm_colorop_3x1d_lut
Move struct to another part of the header, change a few variable/param
names and replace an useless u64 by u32.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 14:04:37 -03:00
Leandro Ribeiro
b75f8ce2ae shared: add wl_list asserts
We were missing that, so let's include them.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 14:04:37 -03:00
Leandro Ribeiro
711ae922a8 shared: rename ec to wc_ for assert macros
We usually use the variable name 'ec' for struct weston_compositor. We
currently use the same in our assert macros, bringing issues.

Rename 'ec' to 'wc_' in our assert macros, avoiding this kind of issue.

Also, this fixes a weston_assert_ macro call in which we forgot to
declare 'ec' before calling it.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-25 14:04:37 -03: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