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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This already calls weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.
Signed-off-by: Daniel Stone <daniels@collabora.com>
This already calls weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.
Signed-off-by: Daniel Stone <daniels@collabora.com>
These already call weston_view_geometry_dirty_internal() and
weston_view_update_transform(), the combination of which will already
force a repaint for those views.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Add the Vulkan renderer in the pipewire backend renderer switches.
For now this goes over the pipewire memfd path.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>