Commit graph

10585 commits

Author SHA1 Message Date
Marius Vlad
a4939fd123 build: bump to version 15.0.1 for the point release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-04-24 11:06:05 +03:00
Derek Foreman
5eba5ca43c 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>
(cherry picked from commit fcb0d75d44)
2026-04-24 10:34:28 +03:00
Derek Foreman
71191cd127 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>
(cherry picked from commit af736168f7)
2026-04-23 21:30:26 +03:00
Derek Foreman
f0fa8b9b18 compositor: Fix rotated opaque surfaces
When a paint node is drawing rotated content, it's treated like its axis
aligned bounding box. Even if it only contains fully opaque content,
the parts of the axis aligned bounding box outside of that content
are not opaque.

We need to ensure we don't claim a paint node that isn't axis aligned
is fully opaque, or we'll improperly update regions outside of the
really opaque content.

Fixes 485e1796af

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit 1f7bdea5c4)
2026-04-23 21:30:26 +03:00
Leandro Ribeiro
f8d466fefa drm: use output capture task destroy listener for writeback
No behavior changes; this is a follow-up of "drm: handle client buffer
destroyed while writeback scheduled".

That commit protects against clients disconnecting while a writeback job
is scheduled, which could otherwise lead to crashes if the buffer is
destroyed before the wb job completes. However, output capture provides
the same functionality: it listens to the client buffer destroy event to
retire the capture task.

Instead of listening to the wl_buffer destroy event, simply listen to
the capture task destroy event. GL renderer already follows this
pattern, and now DRM aligns with it.

See also:
weston_capture_task_buffer_destroy_handler()
weston_capture_task_add_destroy_listener()

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit 04a85ab71c)
2026-04-23 21:30:26 +03:00
Leandro Ribeiro
655eec74e8 drm: assert writeback state is freed after capture task retirement
No behavior change, just a refactor to make it more clear that the state
is freed after the capture task is retired.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit 7444c29fd2)
2026-04-23 21:28:37 +03:00
Leandro Ribeiro
59c945c300 drm: handle client buffer destroyed while writeback scheduled
Currently when a client buffer gets destroyed, the output capture task
gets destroyed with weston_capture_task_buffer_destroy_handler().

The problem is that we may have a writeback task scheduled, so
wb_state->ct would be pointing to a ct that has already been retired
and destroyed.

In this commit we start handling this case.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit 1152c53e58)
2026-04-23 14:45:09 +03:00
Marius Vlad
f97943ca67 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>
(cherry picked from commit 02aa53eb4b)
2026-04-23 14:44:47 +03:00
Erico Nunes
78619ca63e 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>
(cherry picked from commit ba10e6d814)
2026-04-23 14:44:36 +03:00
Robert Mader
82d6297416 gl-shaders: Remove asserts relying on shader compiler behavior
yuv_coefficients and yuv_offsets should get optimized away by shader
compilers as the related code paths can never be reached. This seems to
work well on Mesa but not necessarily with other drivers.

While on it, assert that the uniforms *are* present, unless the
yuv-to-rgb conversion is handled by the driver.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit 5c49563ef4)
2026-04-23 14:44:22 +03: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
Marius Vlad
8186697416 man: Update weston man page and ini page
This follows-up with README.md file. Brought in two paragraphs into man
page from README.md.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-06 11:44:48 +02:00
Wang Ruitang
c23ea4ba8d libweston: check focus surface before enabling pointer constraint
Check if surface matches before enabling pointer constraint. If not
match, no constraint enabled. Otherwise, assertion would failed in
confined_pointer_grab_pointer_motion() and weston would crash.

This fixes crashes reported in GitLab issues #185 and #670.

Closes: https://gitlab.freedesktop.org/wayland/weston/-/issues/185
Closes: https://gitlab.freedesktop.org/wayland/weston/-/issues/670
Signed-off-by: Ruitang Wang <Ruitang.Wang@amd.com>
2026-02-05 13:28:52 +08:00
Marius Vlad
df40e3b93a build: bump to version 14.0.95 for the RC3 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-02-03 11:22:08 +02:00
Derek Foreman
a52893f585 drm: Synchronize invalid state recovery operations
When we end up with invalid state, we'll be rebuilding the entire state from
scratch. This new rebuilt state would conflict with any outstanding flips,
so we need to wait until all flips are complete to begin the rebuild.

After we set the rebuilt state, we now have to be careful not to allow any
other outputs to attempt flips until the rebuilt state's flip completes,
or we could provoke an EBUSY from the drm device.

Add a recovery state machine to the drm backend to synchronize all of this.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-03 09:12:07 +00:00
Derek Foreman
87515a6874 compositor: Add REPAINT_DEFERRED repaint_status
Backends can end up in indeterminate/invalid state and be unable to
process updates.

Add a way for the backend to tell the core to stop scheduling repaints,
and a way for the backend to schedule all the repaints that should have
taken place during the invalid state period.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-03 09:12:07 +00:00
Derek Foreman
36f73f67c7 drm: Count outstanding atomic completions
This is preparation for synchronizing invalid state rebuilding in a
future commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-02-03 09:12:07 +00:00
Arnaud Vrac
b28e6f8836 compositor: recompute paint node properties when solid state changes
The paint node is_fully_opaque and is_fully_blended properties are overriden
when the paint node is censored or used to clear a hole for an underlay plane,
in which case the paint node is forced to be a solid color.

Those properties need to be recomputed when the paint node solid state changes,
that is:
- when the view becomes uncensored
- before assigning planes; if the paint node was overriden late in the repaint
  loop to clear a hole for an underlay plane, those properties need to be reset
  early in the next repaint loop to properly compute the visibility of
  underneath views.

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
2026-02-02 10:29:09 +01:00
Marius Vlad
0201d5762e renderer-gl: Check for valid CVD uniform
We seem to initialize the uniform with -1 so check against as the test
branch will actually try to use the supplied matrix (although it is
zero in this case).

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-28 07:48:28 +00:00
Marius Vlad
7a51bc85f4 backend-drm: Revert "drm-backend: Reuse prior state where possible"
This seems to cause some misuse of buffer handling especially for cases
where the views are being promoted into HW planes. Vulkan clients seem
to crash at start-up while EGL clients seem to avoid being promoted to a
HW plane after changing window state (fullscreen to non-fullscreen).
Revert the now the change to better understand what is going on.

This reverts commit 119ce40714.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-28 07:33:54 +00:00
Marius Vlad
3ff64f5e3d man: Clarify where we can load the Lua script
Some minor clarifications that the Lua script can searched in the
current working directory or passed in as an absoluate path.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-27 13:21:38 -06:00
Pekka Paalanen
d26f1789fd clients/window: fix single_pixel_buffer_manager leak
Caught by ASan on weston-desktop-shell.

Fixes: 6cc8f48cd8
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-01-27 13:46:20 +02:00
Marius Vlad
f72dfdae4c build: bump to version 14.0.94 for the RC2 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-26 10:59:59 +02:00
Leandro Ribeiro
3de7c52942 libweston: collapse CVD correction into single matrix multiplication
CVD correction is composed by a linear transformation, so we should be
able to collapse it into a single matrix multiplication:

Y = M * X

Where Y is the result, X is the original color, and M is the CVD
correction matrix.

As we need to perform CVD correction for every pixel, this can be
beneficial for limited hardware.

In this patch we do that, updating the libweston core code and also the
GL-renderer and its fragment shader.

Suggested-by: Christopher Healy <healych@amazon.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-01-22 18:24:29 +00:00
Leandro Ribeiro
10991a4c4a gl-renderer: do not compute straight alpha values for CVD correction
CVD correction have the following format. These are linear
transformations in which M is a 3x3 matrix and X is a RGB vector.

F(X) = M * X

It is well known that CVD simulation/correction is done using straight
alpha values. So when we have alpha premultiplied values, we compute
straight alpha values first, apply the correction and premultiply by
alpha again. But this is not necessary, as we can see mathematically:

a * F(X) = a * (M * X) = M * (a * X) = F(a * X)

So do not convert premultiplied alpha values to straight alpha values
before applying CVD correction. This saves a few operations per pixel.

Note that the same does not apply to color inversion:

F(X) = 1 - X
a * F(X) = a - a * X
F(a * X) = 1 - a * X
=>
a * F(X) != F(a * X)

Suggested-by: Christopher Healy <healych@amazon.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-01-22 18:24:29 +00:00
Marius Vlad
03686c9f89 libweston: Adjust order for tracking dirty paint nodes
Commit 008884f28 ("compositor: Move dirty buffer handling to paint node
early update") makes the dirty paint node bit being
cleared in the update early function which makes t too late to check in
the paint node update late where we used to accumulate painted frames.

Just move it before the early update to make we still have a way to
print painted frames counter.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-22 18:14:36 +00:00
Pekka Paalanen
88863cf7f1 tests: fix RUNNER_TEST UBSan error
GCC 14.2 UBSan complained:

../../git/weston/tests/ivi-layout-test-plugin.c:73:15: runtime error:
load of address 0x7fbfd8d70ec0 with insufficient space for an object of
type 'const struct runner_test'

By printing the addresses, I concluded that the mentioned address is the
second element in the plugin_test_section. I guess UBSan believes that
only the first element exists. Why not, what's to tell what data
actually is inside the section or where it actually ends.

Strangely though, we use the exact same section trick in
weston-test-runner.c to iterate through all tests, and that one is
apparently fine. One difference is that weston-test-runner is built as a
static_library() while ivi-layout-test-plugin.c is a shared_library().

Anyway, ivi-layout-test-plugin is unlikely to see any development, so
let's just fix the problem in an ugly way, and get rid of the section
trickery. If someone were to add a new RUNNER_TEST() instance and forget
to add the magic into the index, the compiler would greet them with a
defined-but-not-used error.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-01-22 16:51:31 +02:00
Pekka Paalanen
30e7575096 tests: fix "%s" argument is null warnings
../../git/weston/tests/iterate-debug-scopes-test.c: In function ‘wrapiterate_default_debug_scopes’:
../../git/weston/tests/iterate-debug-scopes-test.c:70:53: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   70 |                 weston_log("\tscope name: %s, desc: %s\n", scope_name, desc_name);
      |                                                     ^~
../../git/weston/tests/iterate-debug-scopes-test.c:70:43: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   70 |                 weston_log("\tscope name: %s, desc: %s\n", scope_name, desc_name);
      |                                           ^~
../../git/weston/tests/iterate-debug-scopes-test.c:70:53: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   70 |                 weston_log("\tscope name: %s, desc: %s\n", scope_name, desc_name);

test_assert_*() do not abort, so we cannot rely on them sanitizing
program state.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-01-22 15:56:56 +02:00
Pekka Paalanen
6a96841fee backend-drm: fix maybe uninitialized num_planes
In function ‘drm_fb_maybe_import’,
    inlined from ‘drm_fb_addfb’ at ../../git/weston/libweston/backend-drm/fb.c:236:8:
../../git/weston/libweston/backend-drm/fb.c:210:31: error: ‘num_planes’ may be used uninitialized [-Werror=maybe-uninitialized]
  210 |         for (plane = 0; plane < num_planes; plane++) {

Direct-display is mutually exclusive with having GBM BO, because the
point of direct-display is to not import to GBM. We can use this to make
the logic more provable to the compiler, and be more obvious about the
expectation to the human reader.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-01-22 15:56:56 +02:00
Michael Olbrich
063a9a0240 surface: correctly apply scale/tranform changes when committed without buffer
{width,height}_from_buffer include the transformations from set_buffer_transform
and set_buffer_scale.
Currently {width,height}_from_buffer are only updated when a commit contains a
new buffer but not for commits with only transformation changes.

If a transform/scale change is commited without new buffer, the old values
remain, which results in incorrect rendering or the client is disconnected
because weston_surface_is_pending_viewport_source_valid() fails.

Make sure to update {width,height}_from_buffer for transformation changes only
to avoid this.

Add a test to verify that the transformations are handled correctly. It is
identical to previous test, except that is spits the buffer attachment and
transformation changes into two commits. So it can reuse the existing images for
validation.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2026-01-22 10:12:33 +00:00
liang zhou
61e1b9c14a libweston: fix unexpect log when touch device has no output
In handle_touch_up, check whether the associated output is NULL before calling
notify_touch. This prevents unnecessary logging of "Unmatched touch up event
on seat" when a touch device is not bound to any output, as the absence of an
output is already handled gracefully in handle_touch_with_coords.

Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
2026-01-20 09:54:31 +08:00
Marius Vlad
07d9eb1f7e build: bump to version 14.0.93 for the RC1 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-01-19 09:39:03 +02:00