Commit graph

10110 commits

Author SHA1 Message Date
Taehyeon Jeong
0add10986d input: improve keyboard keys array traversal in notify_key()
The loop in notify_key() that traverses the keyboard keys array has been
improved by adding a break statement after removing a key and simplifying
the loop structure. This eliminates unnecessary iterations and removes
ambiguity in the code flow, making it both more efficient and clearer.

Signed-off-by: Taehyeon Jeong wxogus25@gmail.com
2025-06-20 20:17:37 +00:00
Derek Foreman
37bf61c68c drm: Fix pageflip counter crash when using multiple backends
We need to skip non-drm backends in the output list to avoid a NULL pointer
dereference.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-20 14:05:08 -05:00
Robert Mader
3dce9e8c24 pixel-formats: Add Sx1x software decoder formats
Expected to land in Linux 6.17 and already pulled into a
libdrm release (2.4.125).

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-06-17 15:07:01 +02:00
Pekka Paalanen
275155812c color: fine-tune pipeline printing
Separate the parts a bit better.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
6b051ce76b color: print details of the color pipeline
Give a little more insight to the values in a pipeline.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
c533be60d6 color: fix count_parameters type
It's a count, so it's not a bool. Luckily the only counts ever assigned
to it so far were 0 and 1.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
4d6e690fd0 color: de-dup curve printing
Less repetition, easier to modify the format later.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
2fc5e8b2e9 color-lcms: fix lcms matrix printing
If the offset was negative, there would be no space between the columns:

    Matrix
       1.0025  0.0000  0.0000-0.0012

Add the space.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
fec6a3c51e color: print CIE xy with 4 decimals
Usually even three is enough, but D65 tends to be given with four.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
5f22ba7e2e color: refactor to weston_color_gamut_fprint()
Removes repetition and makes weston_color_profile_params_to_str() a
little more concise. Eases changing the xy number formatting next.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
acd3e557af color: shorten the named of primaries
These can be much more terse and still remain completely readable,
improving debug prints' readability.

Only one place needs to explicitly mention it's about primaries, the
rest are already evident.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-17 10:40:03 +03:00
Pekka Paalanen
16e958607a color-lcms: clarify ICC-to-ICC pipeline prints
In the future parametric<->ICC color transformations will be a thing.
Clarify that the printed pipeline is just the ICC-to-ICC part of it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-16 17:01:17 +03:00
Pekka Paalanen
ddd03a3606 color: drop "transfer function" from TF descriptions
Several places that print this string already include "transfer
function", so there is no need to say it twice. The one place where it
is needed is fixed accordingly. Other places already imply it enough.

This shortens the prints without losing anything.

A few descriptions are improved to help understanding.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-16 17:01:17 +03:00
Marius Vlad
a4494f2ea3 backend-drm: Use a local variable to store output frame rate data
As otherwise we might trip because the output might be not available.

Fixes: cda8de1089 ("backend-drm: Count and display KMS page flips")

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-10 12:00:07 +00:00
Pablo Saavedra
c0dfeaf156 frontend: Assign output before registry shared output init
Set the shared output's Weston output reference before obtaining
the registry from the parent display. Ensures proper access to
output context during registry event handling.

Also prevent weston_seat_init when shared output lacks a compositor,
avoiding crashes on invalid initialization.

Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
2025-06-09 12:18:03 +00:00
zhou liang
fc3e3cf653 compositor: prevent weston_surface references a destroyed output
weston_surface retains a pointer to its associated output, but if the
output is destroyed, the pointer becomes invalid. In set_fullscreen(),
weston_shell_utils_get_focused_output may return this stale output via
weston_keyboard, leading to a use-after-free crash.

This change ensures the output reference is cleared when the output is
destroyed, preventing potential crashes.

Signed-off-by: zhou liang <liang.zhou@gehealthcare.com>
2025-06-09 11:23:37 +00:00
zhou liang
0286b37d76 xdg-shell: Reset configure_idle to NULL at first
To prevent configure_idle from being called again by wl_event_source_remove,
now set configure_idle to NULL inside its handler function. This ensures
the idle source won't be removed multiple times if the handler is called
again.

Signed-off-by: zhou liang <liang.zhou@gehealthcare.com>
2025-06-07 15:08:08 +08:00
Joshua Goins
dc33a296b8 doc: Update to the new --no-resizable RDP flag
This was changed in 75280d2e40 but only
updated in the weston CLI help. But there's still documentation leftover
in .ini files and manpages that refer to the older flag.

Signed-off-by: Joshua Goins <joshua.goins@kdab.com>
2025-06-04 15:38:05 -04:00
Marius Vlad
0600265c64 frontend: Make use of the advertised debug scopes
This patch introduces a new cmd line option, namely `--debug-scopes`
(or shorthand `-d`) to limit which debug scopes are being advertised
over the westond-debug protocol.

To avoid tedious work to make this work in the same time as `--debug`, a
boolean type of option which doesn't accept any other entries, I've
decided to have a dedicated string cmd line argument.

If passing `--debug` all debug scopes are advertised by default
(keep the same behaviour). If you'd like to limit which of those scopes are
advertised, use the -d and only that one those scopes be advertised.
Pass these as a command-separated list.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:43:47 +03:00
Marius Vlad
2dd870adac weston-log: Add a advertised list of debug scopes
This introduces a new list that is being checked up when advertising
or when the client attempts to bind a debug scope.

This would allow for a way in which the frontend can determine which
debug scopes the weston-debug protocol can advertise or the client
using the protocol can bind to.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:43:33 +03:00
Marius Vlad
762e286a44 cp: Correctly format debug scope for content protection
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
a3ab74028a launcher-libseat: Don't hard-stop on libseat-debug
If not libseat-debug scope is not set we would hit an assert, and
we might have a legitimate case where we don't want to have it enabled.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
1181d638ac timeline: Check for timelog scope being enabled
As further weston_log_subscription_iterate implicitly assumes we can
create one, and that might not be always the case.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Marius Vlad
413e471fb1 gl-renderer: Don't hard-stop if debugging scopes aren't enabled
We might not want to enable these scopes always so don't limit
the GL-renderer availability based if these are enabled or not.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-04 17:38:16 +03:00
Derek Foreman
e91eccd709 lua-shell: Add lua-shell
lua-shell is a new meta-shell for Weston. It does nothing in and of
itself, but is defined to be user-scriptable and configurable. A
supplied Lua script will be interpreted and executed by Weston, allowing
full control over window management in response to events.

This includes a shell.lua example script which behaves as a tiling WM.

Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Co-authored-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-04 15:47:06 +03:00
Derek Foreman
cf44b691c6 compositor: Add weston_view_move_before_layer_entry
Add a function to move a view in front of a layer entry, so we can easily
add this functionality to lua-shell in a future commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-06-04 15:39:03 +03:00
Pekka Paalanen
c24685d14b tests/color-icc-output: reduce tolerance on BT2020 MAT
I don't know when this was improved, I just noticed that we can reduce
the tolerance here.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
556272bae9 color-lcms: change stock sRGB to true power-2.2
The sRGB expected display behavior uses the pure power-law with exponent
2.2, not the two-piece sRGB transfer function.
cmsCreate_sRGBProfileTHR() used the two-piece TF, now we use the proper
display TF.

This is particularly meaningful when implicit sRGB content is converted
to HDR formats, in order to maintain the stimuli reproduction near zero.

cmlcms_send_image_desc_info() is already sending this, it doesn't need
fixing.

Changing the curve also changes the error tolerances. The change is
theoretically a no-op, but the curve and its inverse and temporary
rounding add error. The new curve is more prone to error, so it is not
surprising we need to raise the tolerance. The color transformation does
end up as power-2.2 analytical form and I do not think it is ever
lowered to a LUT in alpha-blending test, so there is no obvious fix
improving the accuracy. The worst case point in alpha-blending still
occurs at the very same point as before.

The test reference images are updated for the same reason, they would
fail otherwise.

Both alpha-blending and color-icc-output contain the same sRGB-optical
sub-test, hence the same error tolerance.

It is surprising to have to increase the ICC roundtrip error tolerance
in color-icc-output test, given that the curves are passed as parametric
to LittleCMS, and adobeRGB case works with the old tolerance even. I did
not investigate further.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
718f7f56df tests/color_util: add power-2.2 transfer function
This is needed by the next commit.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
8468289fa3 tests/color_util: move lcms2 data into struct tone_curve_info
Refactoring data about a thing into one place to simplify code.

Also this function is never expected to fail, so no need for the boolean
return.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
015533bac5 tests/color_util: convert 4 switches into a table
Collect all information of an item into a table entry in one place. Will
be easier to add new items this way.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
338d727d99 tests: drop EOTF from TRANSFER_FN_SRGB_EOTF
The sRGB display uses a power-2.2 transfer characteristic. These enum
values refer to the two-piece sRGB transfer function instead, so they
should not be named "EOTF".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
b2bc30034b color-lcms: do not smooth monotonic shapers
When I was changing the stock sRGB profile from the two-piece TF to the
power-2.2 TF, all CLUT tests in color-icc-output started failing. It
appeared that cmsSmoothToneCurve() caused an already monotonic curve to
become non-monotonic, and then failing its own monotonicity test. I can
only guess that it might have something to do with the power-2.2 curve
having nearly zero derivative near zero.

As a workaround, check if the curve is already monotonic and don't
bother smoothing in that case. This allows the tests to pass in the
future where the sRGB profile has been changed.

OTOH, increasing smoothing_param up to 10.0f still did not help.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Pekka Paalanen
bf1d8c458b color: check steps_valid in weston_color_transform_string()
Do not want to print the steps if they are not correct.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-06-03 15:47:20 +03:00
Marius Vlad
63264ae3f4 weston-drm-fourcc: Add fallback for P030
As DRM_FORMAT_P030 was introduced in some later libdrm (2.4.114)
version add a fallback for it to allow building on systems which do
not have that libdrm version.

Fixes 4f4011d79e ("pixel-formats: Add P030")

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-03 06:38:27 +01:00
Marius Vlad
b2c8f35c23 renderer-vulkan: Allow to compile without Vulkan renderer
As spotted in the wild, building without Vulkan still picks up
Vulkan headers. This drops the VkInstance alltogether as that's not
really used.

As this file appears to be pulling XCB headers guard them as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-06-02 14:37:59 +03:00
Pekka Paalanen
135b95808c shared: fix matrix type computations
When I changed the weston_matrix implementation to linalg-4.h, I broke
the type computations: they were getting reset instead of accumulated.
This manifested with the desktop-shell feature where one can arbitrarily
rotate the windows. A rotated window triggered an incorrect matrix type,
which then did not ignore the surface opaque region as it should have.
That caused rendering artifacts on all renderers.

Fixes: 3fefb5ba44
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/1031

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-30 11:45:08 +00:00
Derek Foreman
a124b19a01 compositor: Remove weston_view_damage_below()
It has no more callers, and hasn't done what its name implies for a very
long time.

Remove it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
cc0edfd13d compositor: Remove weston_view_damage_below from transform add/remove
weston_view_damage_below() does nothing but schedule a repaint, and a
repaint will be scheduled in weston_view_geometry_dirty_internal() anyway,
so remove the extra call.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
1683d7a9d2 compositor: Schedule a repaint directly in weston_view_unmap
Instead of calling weston_view_damage_below(), which only schedules a
repaint, call weston_view_schedule_repaint() instead.

The result is the same, but the code is less confusing.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
601a72dd8c compositor: Remove weston_view_damage_below calls from update_transform
Update transform only does something if we've called
weston_view_geometry_dirty_internal() previously to set the dirty flag.

weston_view_damage_below() just schedules a repaint, and
weston_view_geometry_dirty_internal() will already have done that.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Derek Foreman
7900235fee desktop-shell: Remove weston_view_damage_below from desktop_view_destroy
weston_view_damage_below() has done nothing but schedule a repaint for a
long time now.

weston_view_destroy() will trigger the repaint without forcing it here.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-05-30 11:38:47 +00:00
Marius Vlad
e70cfe319c fullscreen-shell: Deprecate fullscreen-shell and screenshare module
kiosk-shell/xdg-shell is the (more) modern approach, so let's inform
users that fullscreen-shell is going way.

This also adds an explicit dependency of shell-fullscreen for
screenshare. With this change, both screenshare and fullscreen-share
are disabled by default.

Fixes: #848

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-30 14:31:08 +03:00
Marius Vlad
b3480f5b30 backend-wayland: Remove zwp_fullscreen
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-05-30 14:31:07 +03:00
Daniel Stone
300d059044 libweston: Remove PAINT_NODE_CONTENT_DIRTY
This was only used by weston_surface_damage(), which we have just
gleefully deleted.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:46:05 +01:00
Daniel Stone
816e4180bc libweston: Remove weston_surface_damage()
There is no valid reason for anyone to call this.

True surface damage is already handled when surfaces are committed. View
damage is already handled through any per-view manipulation which would
generate damage. There is thus no reason for anyone to ever call this.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:43 +01:00
Daniel Stone
653182759f libweston: Damage outputs for content-protection changes
The content-protection state is a property of the output, as it affects
quite a bit of output state, as well as things like whether or not
recording is possible.

Instead of damaging surfaces for content-protection state changes,
damage each output for which the protected surface is relevant.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:31 +01:00
Daniel Stone
9a5b4087c8 libweston: Remove weston_surface_damage() from subsurface commit
When we change the subsurface order, the surface itself has not received
any damage: what's been damaged is the views. Place the damage where it
should be, as the act of moving the view within the view list is where
the damage originates from.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 16:45:10 +01:00
Daniel Stone
179aae34f7 desktop-shell: Remove damage for curtain
There is no need to damage a curtain. Adding or removing a view is what
causes the damage.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00
Daniel Stone
44c2c3ce72 desktop-shell: Remove weston_surface_damage() from rotate
This already calls either weston_view_add_transform() or
weston_view_remove_transform() followed by
weston_view_update_transform(), the combination of which will already
force a repaint for those views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-05-28 15:47:30 +01:00