For now limited to coefficients and ranges that are typically
supported by KMS drivers. We notably leave out alpha modes and
chroma locations for now.
The protocol initialization is guarded by the WESTON_CAP_COLOR_REP
backend capability and thus not enabled anywhere yet.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Validate repaint_msec so it's not longer than a refresh interval.
Negative repaint windows will cause problems for frame scheduling in the
future, so remove them.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
While exiting, on the shutdown compositor path, for instance if we don't have
permission access to create a lock file we will end up reporting some memory
leaks/use-after-free.
This patch addresses of all them:
- api->listen returns NULL and we do not property free wet_xwayland
struct
- we don't remove the signal handler causing a use-after-free (signal
handler gets called by the main object has been freed)
- we don't remove/destroy the debug scope causing a mem-leak
- on the same path check for valid event source to avoid deref invalid
pointers.
Add a simple wrapper which we can call in other call sites.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Recent versions of libwayland support absolute paths in display names,
and in that case do not require XDG_RUNTIME_DIR to be set. It's
therefore overly strict for Weston to exit due to XDG_RUNTIME_DIR being
unset when it would work perfectly fine without it. The messages
displayed for incorrectly set XDG_RUNTIME_DIR are useful though, so keep
them around, but only display them if wl_display_add_socket() fails
i.e. the lack of XDG_RUNTIME_DIR has actually caused a problem.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
When running headless, weston will not expose a wl_seat.
This was removed with commit a1046adc ("compositor-headless: do not
create a seat").
However, some applications, namely GTK3 based, will log a warning when
there is no wl_seat:
| gdk_seat_get_keyboard assertion GDK_IS_SEAT(seat) failed
While this is arguably a bug in GTK3 which should not complain with a
legit setup, that breaks the CI of those projects when using Weston,
while most of the other Wayland compositors will create a fake seat when
running headless, making weston the odd ball there.
This changes adds a new option "--fake-seat" that will instruct weston
to create a seat when running headless. The default remains not to
create a seat though, so backward compatibility is preserved.
This partially reverts commit a1046adc66.
See-also: https://gitlab.freedesktop.org/ofourdan/xwayland-run/-/issues/12
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
The following config allows to mirror the LVDS output to VNC:
|[output]
|name=LVDS-1
|transform=rotate-270
|
|[output]
|name=vnc
|mirror-of=LVDS-1
However, the current code only takes the scale into account, not the
relative transformation. In case of rotate 90 or 270 the width and height
have to be swapped. Add it.
Closes: https://gitlab.freedesktop.org/wayland/weston/-/issues/1076
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
For some cases such as remote control, need to disable the interaction
between input device and the weston. It will not affect the use of input
device by other modules or applications.
Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
Allow dictating which color format we'd like to use. This introduces the
front-end side and the core parts, leaving the EDID parsing and DRM
connector property for later patches.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This tests the [output] section key 'color-profile', which is meant for
setting up parametric color profiles. It tests the special names, and
fetching values from EDID. There are also tests for all accepted keys in
a [color-profile] section.
These tests are all positive. Error messages are tested in another
patch.
The test client helper changes are needed for loading the EDID file.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This allow users to specify a fully custom parametric color profile in
weston.ini for a certain output.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This introduces a new key for outputs in weston.ini, "color-profile".
For starters, implement a pre-defined sRGB profile and an automatic
profile.
Automatic color profiles are created based on the colorimetry-mode and
the eotf-mode of the output. EDID can also be taken into account, but it
is opt-in due to its potential unreliability.
This feature is documented as not fully implemented, because color-lcms
does not yet handle parametric color profiles together with ICC
profiles. Specifically, the stock sRGB profile is still an ICC profile,
and would not be able to be used together with a parametric output
profile.
Co-authored-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
It is nice to see the numbers of a parametric color profile when created
from CTA or EDID or just to cross-check with weston.ini.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Output color effects are applied to the whole output scenegraph. It
depends on color-management being disabled, as the color effects are
applied in sRGB content.
For now we added only a few accessibility options: color inversion,
deuteranopia, protanopia and tritanopia CVD correction.
Note that surfaces presented on outputs that contains a color effect
can't be used for direct scanout (i.e. bypass composition and offloading
to KMS overlay planes). The color effect is applied in our GL-renderer.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Fixes a minor issue with 28bdcb46be ("frontend: Log when exiting due to
insufficient active outputs") to only print that we have
no outputs enabled but we're allowed to continue when we actually get to
that scenario.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
In this patch we allow offloading the post-blend color transformation
to KMS.
As KMS currently only supports to offload the transformation in a LUT,
this may result in precision issues. So this introduces the config
option "offload-blend-to-output", which is disabled by default.
This option requires "color-management" to be enabled, otherwise it is
ignored.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We already get the core section a few lines above, and no other call
get_section() call are made in between.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Our window decor uses cairo-xcb. cairo-xcb stores xcb_connection_t
internally and uses them as kind of a hash key for internal bookkeeping.
This needs to be torn down with a cairo_device_finish, when the last
cairo surface is destroyed, and we are not properly handling that.
Because of this weston bug, if the Xwayland server dies, is restarted,
and the weston X window manager gets the same xcb_connection_t pointer
value for a new connection that it had for a previous connection,
cairo-xcb will use stale state and crash.
Weston is used in some places (like Mesa CI) where Xwayland crashes are
more common than one might usually expect, and weston needs to be robust
against these failures. It's ok to have no window frames in xwl in these
cases, because nobody is interacting with the windows.
The '--no-xwm-decorations' command line option will now remove
cairo-xcb from use entirely, so this crash can no longer happen.
We should still fix the bugs in our cairo usage, but I think long term
it's still ok to have a way to disable this and reduce complexity.
Ref #1042
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Entrench the use of weston_enum_map more, even though in this case it
doesn't buy much.
Make the array 'static const' which it should have been already.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is a trivial change to allow passing a user-defined color to
specify the color for the placeholder.
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>
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>
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>
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>
A Vulkan renderer for weston, based on the GL renderer.
The goal is to impose the least requirements as possible on Vulkan
implementations, as to allow even Vulkan 1.0 (or early development)
drivers to run a Wayland compositor. Any additional features or
extensions are made optional if possible.
Currently supports drm, wayland, x11 and headless backends.
As of this implementation, this is still considered an experimental
renderer.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
The output resized signal sends a struct weston_output as the data, not
a struct weston_head.
Fixes 197c5e0084
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We have the following error message in parse_color_characteristics():
name=%s: reserved name. Do not use ':' character in the name.
It gets confusing when "name" ends with ':'. So rephrase it to clarify
the error message in such case.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
As the flight recorder subscribed by default to the drm-backend will
implicily arm the KMS page flip counter. Just use the "log", log scope.
To make this more obvious, with this change we also print the
subscriptions, when we detect that the flight recorder is enabled.
Users can use the provided cmd line args (-f/--flight-rec-scopes) to
adjust those.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than having this timer always fire up & running, do it when we actually
enable debug, with the `--debug` cmd line argument.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This is problematic as we don't have namespacing for these and some of
the macros can interfere with other defines.
This reverts commit 8634c7e349.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.
With this change windowed-output-api.h also includes the helpers header.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Since c4eb15d453 we keep a copy of
native mode parameters, however we forgot to initialize the
native mode parameters in some situations, which breaks the
output mirroring code when it sees uninitialized data.
Fixes c4eb15d453Fixes#949
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Some VNC clients, i.e. noVNC, do not support TLS encryption.
Add new argument "--disable-transport-layer-security" to
explicitly disable activation of TLS.
This will allow to extend VNC clients compatibility.
Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Similar to the VNC backend do the same for the RDP backed, as this would
allow to get a matching output, in dimensions, to the one we are
mirroring.
This also re-works a bit the no-clients-resize to be more inline with
VNC one.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
PipeWire/RDP/VNC were using by default scale 1, so allow
configuration using the ini config file.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This would allow to screen-share a particular output like the
following:
[output]
name=vnc
same-as=DP-5
[output]
name=rdp-0
same-as=DP-4
[output]
name=pipewire
same-as=eDP-1
Both 'vnc', 'pipewire' 'rdp-0' remote outputs would then be a
screen-share 'DP-5', respectively, 'e-DP1', or the 'DP-4' DRM output.
Currently, this is intended only for VNC, RDP and PipeWire remote outputs.
This patch exports weston_output_set_position(), and uses that for
overlapping a remote output with a native DRM one, rather than using
weston_output_move() as that has a side-effect when reflowing outputs
from shells.
Further more creating this remote output is driven entirely by compositor
signal events such that enabling an DRM native output would enable the
remote output, while disabling the native would have the same outcome
for the remote one.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>