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>
With this, Weston can build against either FreeRDP 3.x or 2.x depending
on what has been detected by meson (3.x takes priority).
The main source of changes is the settings are now opaque and require the
use of accessors. That was pretty mechanical and seems to work on 2.x as
well.
There are a few changes around constants getting a WINPR_ prefix, the UTF
conversion functions we used are obsolete, so use the proper "new" ones,
and other fairly minor things.
The key & cert management changed rather completely, libfreerdp won't load
files for us, we have to use the helpers to do so, and I *think* the RDP RSA
key and SSL key use the same setting location. Seems to work with SSL at
least.
There was also a minor glitch with keyboard input, KBD_FLAGS_DOWN is basically
never set. It appears to be an upstream FreeRDP change in 3.x, it was being
set incorrectly (always on any key down) while it should only be set on
repeats. However the fastpath input code has no way to set it from what I
can tell, so it's just loss. We instead ignore it.
Note that the screen size is odd (and different between freerdp client and
remmina), it also won't adjust dynamically when the window is resized. I
don't think this relates to my port though, I observe the same behaviour
with the packaged FreeRDP 2 based Weston, but I can try to look into it
later
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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>
This avoids dereferencing a possible stale pointer, and allows
retrieving the modeline/refresh later on when one needs to retrieve
those values. This is a temporary band-aid.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
In order to allow passing additional pre/post callbacks. This allows
further re-use of the simple_head_enable() function instead of
creating a similar dedicated function. We can then re-use the same
function for enabling remote outputs.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than using the same key entry for the DRM backend to cloned
outputs, rename to 'clone-of'. This means that ini configuration files
will break after this change, but this should be documented with the
next Weston release.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The debug clear region must be generated out of the current render
buffer's damage region, not out of the current damage region, unless
shadow 16F is enabled.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
eglSetDamageRegion() requires a postable surface and shouldn't be
called with EGL_NO_SURFACE.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
commit 5fe02dc68e partially resolved the issue in #937 by bringing back
the old band-aid solution for layer moves. However, since the events of
commit bf228370ff and following commits we have a problem with
subsurfaces leaving garbage behind when minimized - see #366 which was
probably fixed for a while then became broken again.
When we minimize a view that has subsurfaces, by moving it to a layer
outside of the scene graph, we need to be sure to handle the subsurface
views - which follow their parent's layer instead of having
weston_view_move_to_layer() explicitly called.
Do this by assuming layers with an empty link are not part of the scene
graph and unmapping views when they're moved to these layers. This will
recursively unmap the subsurface views.
We can now remove the band-aid paint node destroy, as the unmap process
will destroy paint nodes as appropriate.
Fixes 5fe02dc68eFixes#937Fixes#366
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
A "mapped" surface need not have a primary output assigned, or
be in a state such that it needs a fade out animation. The view
being mapped is what we should be testing here.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
For the following sequence, weston will not trigger a repaint:
1. create the main surface
2. create another surface and attach it as a sub-surface to the main surface
3. set the sub-surface to desync
4. attach a buffer to the main surface and commit it
5. attach a buffer to the sub-surface and commit it
Step 5 should cause the sub-surface to become mapped. However, Weston fails to
schedule a repaint in that case, so the sub-surface will not appear until
something else causes a repaint on that output, e.g. the main window.
And sub-surfaces are special when it comes to mapping because
weston_surface_is_mapped() will not return true until the parent surface is
mapped as well. So right now, weston_surface_map() may be called multiple times
and it will send the map_signal each time.
So to fix all this and make it clearer:
1. define a separate weston_surface_start_mapping() function to make it clearer
that the (sub-)surface may not be fully mapped at the end
2. check surface->is_mapped explicitly to ensure that the sub-surface is only
mapped once.
3. call weston_view_update_transform() for all views of the sub-surface when the
parent surface is already mapped to ensure that a repaint for all relevant
outputs is triggered.
The new test checks this by waiting for a frame event for the first subsurface
commit. Without these changes, the test will block until it is killed by the
timeout.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
The main differences is the split of cm_surface functionality with
cm_surface and cm_feedback_surface.
There can only be one cm_surface to set, unset image descriptions. When
cm_surface is destroyed, the image description is automatically unset.
There can be multiple feedback_surfaces for one surface though.
Now the "preferred_changed" signal can be an initial event.
Creator params now have a new request: set_luminances.
Signed-off-by: Joan Torres <joan.torres@suse.com>
Commit f2486c8b96 removed some helper functions for layer changes, but
the loop to delete stale paint nodes was elided.
We need to delete paint nodes on a layer change to ensure damage is tracked
properly.
Fixes f2486c8b96Fixes#937
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If the PipeWire-backend renders to a DmaBuf, try to use a fence to synchronize
the submit of the next PipeWire buffer to the completion of the current render
process.
This ensures that the GPU rendering is finished before the buffer is passed to
PipeWire.
If fences are not available, the buffer is submitted without explicit
synchronization as before.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Plugins cms-static and cms-colord were deprecated with "compositor:
deprecate cms-static and cms-colord plugins", and the promise was that
we'd delete them if no one complained.
They were deprecated 2 years ago, and no one bothered. So it's about
time to delete them.
See https://gitlab.freedesktop.org/wayland/weston/-/issues/634.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
virtme-ng is the an update version of virtme, and this patch uses
that instead of the one we had partially modified.
Besides that this partially reverts ad039cdfd2, 'backend-drm: Enable
atomic async flip support' and makes our CI happier. Specifically
ad039cdfd2 updated our kernel version from 6.3 to 6.9 but did not do
a FDO bum,p and with that, no container images were rebuilt. Effectively
we were still using 6.3.
Now, with the FDO bump, in this patch, we noticed that the drm-writeback
test is failing with linux kernel version 6.9.
So far, only 6.3 and 6.4 kernel versions seems to be working, that is,
without that drm writeback test timing out. The safest bet for the
time being, would be to keep our CI just use 6.3 kernel, until we
have proper version to update to.
Signed-off-by: Daniel Stone <daniel.stone@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Revert active unit to default value right after use so that other
functions can assume the default state. A best practices section is
added to the internal header for reference.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The wireframe unit can only be used by the wireframe texture so
there's no need to bind it anymore before use.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Provide a fixed allocation to each texture unit in order to prevent
conflicts. This fixes a conflict between colour transforms and the
wireframe debug mode.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Merge duplicated gl_renderer_attach_dmabuf() and
gl_renderer_attach_egl() functions into a single
gl_renderer_attach_buffer() one.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The highest possible value is 255, not 256, like in previous part of the
calculation. While on it, use the values directly, making the code more
readable.
Fix suggested by Pekka Paalanen and Loïc Molinari.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Update the field returned by weston_head_get_display_info(). This makes
EDID di_info available to frontends.
Since EDID data has changed, then head device_changed must be true as
well, because di_info may expose all EDID information and not just what
we track in the backend.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This new public API is intended to deliver EDID etc. information to the
frontend. The use case here is display colorimetry, to help the frontend
craft output image descriptions (color profiles).
The frontend will need to link to and use libdisplay-info to make use of
this. This avoids having to replicate in libweston the high-level API
that libdisplay-info already has. The libdisplay-info API is also likely
to be extended, and it is not nice to play catch-up with it.
As a di_info can only be destroyed by calling into libdisplay-info,
libweston core can only ensure it has already been freed. There is not
enough reason to make libweston core depend on libdisplay-info, only the
DRM-backend is.
It will be up to DRM-backend to ensure display_info is updated and
device_changed is set only when necessary.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Use libdisplay-info to parse the supported EOTF modes for the
sink/monitor. No more guessing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Instead of initializing dhi in update_head_from_connector(), let
drm_head_info_from_edid() always init that, even when it fails to parse
EDID data.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Revert pixel store's GL_UNPACK_* changes to default values right after
use so that other part of the code can assume the default state.
Fixes: #928
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Revert pixel store's GL_PACK_REVERSE_ROW_ORDER_ANGLE changes to default
value right after use so that other part of the code can assume the
default state.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Revert pixel store's GL_PACK_REVERSE_ROW_ORDER_ANGLE changes to
default value right after use so that other part of the code can
assume the default state.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Prepare gl_renderer_do_read_pixels() so that the default pixel storage
states can be more easily reverted to default before return.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Peer context creation's error handling labels must be swapped to avoid
an invalid free when nsc context creation fails and a leak of the rfx
context when encode stream creation fails.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The #ifndef doesn't work with the built-in static_assert from C++11, so
it ends up getting redefined. It seems that there are other versions of
static_assert internally in some C++ standard library implementations
that have additional arguments, and these also get overwritten by the
two-argument version here.
Detect if we're using a suitably-recent version of C++ and avoid the
redefintion in that case.
Signed-off-by: Ray Smith <rsmith@brightsign.biz>
This function in FreeRDP expects to be able to read groups of bytes, so
move the left edge of our damage region so the wide reads never read
outside of our framebuffer.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
These were only necessary to allow surface_copy_content to return contents
that included recently attached (but not yet rendered) buffers.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Instead of attaching and flushing damage when performing
weston_surface_copy_content, just return the contents as the renderer
currently knows them.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The GL renderer allows the PipeWire backend to allocate DMABUFs that can be used
as renderbuffers and passed to PipeWire. This allows to avoid a copy of the
rendered output when using PipeWire.
PipeWire negotiates DmaBuf buffers using the SPA_FORMAT_VIDEO_modifier property.
Currently, the PipeWire-backend only announces and handles
DRM_FORMAT_MOD_LINEAR, which allows to share DmaBufs with consumers that have
modifier support for linear buffers. Consumers which could consume DmaBufs but
don't support modifiers (DRM_FORMAT_MOD_INVALID) are not supported. Moreover,
consumers that would benefit from other formats with modifiers, for example
tiled or compressed, aren't not supported, too.
Modifier negotiation can be added by extending the list of announced modifiers
and selecting and checking the proposed modifiers in param_changed.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Instead of letting PipeWire allocate the buffers, allocate them in the PipeWire
backend. This allows the PipeWire backend to define the type of the allocated
buffers, which will ultimately allow to allocate buffers that can be rendered
to.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Add a helper function for building the pod for the format.
This simplifies the creation of the EnumFormat params and to provide multiple
EnumFormats. Furthermore, it allows to optionally set add a Modifier to enable
DmaBuf negotiation.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>