Commit Graph

9691 Commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig) 0e451e8dc3
libweston/noop-renderer: Check shm_buffer for NULL
Copy the check from the pixman renderer.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/953
Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2024-09-14 06:38:47 +02:00
Derek Foreman 2e51def212 libdisplay-info: Bump wrap version
We need libdisplay-info 0.2.0 for some features, but our wrapper
currently builds 0.1.1, leading to some surprising errors when
trying to use those features.

Bump the wrap version so if we're pulling this in from a wrap
we get the latest features.

We leave the hard dependency alone for now, as it's still not
widely deployed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-09-13 09:43:04 -05:00
Joan Torres a266c5fff5 clients: Add color
Add a client that creates a surface with one color using single pixel buffer.

Set to that surface an image_description created with the parametric creator of
the color management protocol.

This client can get as params:
  1. Width and height
  2. Color channels R, G, B, A
  3. The name of primaries
  4. The name of a transfer function
  5. The min, max, ref luminance levels

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Joan Torres 53419eb991 clients/window: Allow rendering frame wihout shadow
Rendering the shadow currently renders some dark color near the border inside
the inner content.

Altough the content is on top of it, if the content has some transparency,
that dark color appears and this might be unwanted.

Add an option to not render the shadow to avoid that problem.

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Marius Vlad e026fd6540 meson.build: reopen main for regular development
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 12:12:34 +03:00
Marius Vlad 60981998b2 build: bump to version 14.0.0 for the official release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 11:53:50 +03:00
Marius Vlad 186937dc95 build: bump to version 13.0.95 for the RC3 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-02 10:56:26 +03:00
Derek Foreman 50d92f9d6f libweston: Fix crash with mirror-of
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 c4eb15d453
Fixes #949

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-30 08:16:45 -05:00
Marius Vlad f81c0358c5 build: bump to version 13.0.94 for the RC2 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-30 09:43:45 +03:00
Marius Vlad 3dc28308e6 libweston/color-management: Add fallback for static_assert
Attempt to fix the following with clang-18:

../weston-9999/libweston/color-management.c:890:2: error: call to
undeclared function 'static_assert'; ISO C99 and later do not support
implicit function declarations [-Wimplicit-function-declaration] 890 |
static_assert(UINT32_MAX <= SIZE_MAX, |         ^

Fixes: #948

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-29 16:20:47 +03:00
Marius Vlad 6bcf9ca6ba build: bump to version 13.0.93 for the RC1 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-28 10:40:07 +03:00
Marius Vlad fe2ea233b1 libweston/drm-virtual: Point output base backend the DRM backend
This would allow output_repaint_timer_handler() to find a backend
as well for the DRM virtual outputs created by DRM virtual API and
with it to trigger a repaint for the outputs created by
plug-ins (remoting and pipewre).

Fixes 1f8c49d5bdd20, 'compositor: repaint backends separately'

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-08-27 17:32:30 +03:00
Marius Vlad b4726ef024 libweston/drm-virtual: Add prepare_repaint to perform a repaint
With commit a1f8c49d5b, 'compositor: repaint backends
separately' a prepare repaint was introduced. Use it for DRM virtual API
to allow repainting the remoting/pipewire output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-27 17:19:11 +03:00
Marius Vlad aa3fe6a27a build: bump to version 13.0.92 for the beta release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-21 12:01:02 +03:00
Derek Foreman 60d777803d drm: Remove unnecessary parameter from drm_output_state_alloc()
We never pass this anything but NULL.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-19 10:25:25 -05:00
Marius Vlad 49278973c0 build: bump to version 13.0.91 for the alpha release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-14 11:23:07 +03:00
Lukasz Czechowski 2fe23ad389 man: Update documentation of weston-vnc
Document the possibility to enable VNC backend with password-only
authentication.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00
Lukasz Czechowski 3ecdd0486c vnc: Enable password authentication in non-TLS mode
If VNC is enabled without specifying server certificate and key,
TLS won't be activated. Use regular passsword authentication
instead.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00
Lukasz Czechowski 58a0abcb58 vnc: Allow to disable Transport Layer Security
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>
2024-08-14 07:48:09 +00:00
Benjamin Herrenschmidt 89f3a8a71e Add support for FreeRDP 3.x
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>
2024-08-14 12:29:28 +10:00
Marius Vlad e7ed5d201a weston.ini: Document the 'mirror-of' key
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 75280d2e40 frontend: Disable client resize for RDP remote outputs
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>
2024-08-12 15:50:13 +00:00
Marius Vlad f43342cf78 frontend: Disable client resize for VNC remote outputs
As we're mirroring other outputs we shouldn't allow clients to resize
the output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 197c5e0084 frontend: Add support for tracking parent/mirror changes
If the DRM native output is changed propagate the changes
to the mirror as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad bd39f7edc1 frontend: Teach remote backends to use the scale from config
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>
2024-08-12 15:50:13 +00:00
Marius Vlad d553333da8 frontend: Share a native output using 'mirror-of' keyword
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>
2024-08-12 15:50:13 +00:00
Marius Vlad c4eb15d453 libweston: Keep a local copy of native_mode
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>
2024-08-12 15:50:13 +00:00
Marius Vlad 3842c1c737 frontend: Expand simple head function
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>
2024-08-12 15:50:13 +00:00
Marius Vlad 14cfb97949 libweston: Add a helper for retrieving backend type
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad d88782bf41 frontend/man: Use 'clone-of' instead of 'same-as'
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>
2024-08-12 15:50:13 +00:00
Loïc Molinari bb6abf3c33 gl-renderer: Clean up comments
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-08-12 10:44:55 +00:00
Loïc Molinari 0078a20f17 gl-renderer: Fix debug clear on shadow buffers
The shadow buffer must be blitted entirely when debug clear is on.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-08-12 10:44:55 +00:00
Loïc Molinari c65284bf9d gl-renderer: Fix debug clear region
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>
2024-08-12 10:44:55 +00:00
Loïc Molinari 215d552ce1 gl-renderer: Don't use eglSetDamageRegion() on surfaceless outputs
eglSetDamageRegion() requires a postable surface and shouldn't be
called with EGL_NO_SURFACE.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-08-12 10:44:55 +00:00
Derek Foreman 003e529d46 compositor: Unmap views moved to layers outside of the scene graph
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 5fe02dc68e

Fixes #937

Fixes #366

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-08 08:08:10 -05:00
Derek Foreman 30fd16dae7 desktop-shell: check view mappedness in desktop_surface_removed
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>
2024-08-08 08:02:09 -05:00
Michael Olbrich a7e8bd4bea subsurface: don't forget to repaint after the first sub-surface commit
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>
2024-08-07 15:10:49 +00:00
Joan Torres 1b793b7acd color: update color-management protocol to xx-v4
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>
2024-08-07 13:36:49 +00:00
Derek Foreman 5fe02dc68e compositor: Destroy paint nodes in weston_view_move_to_layer()
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 f2486c8b96

Fixes #937

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-06 07:41:26 -05:00
Philipp Zabel 4b4cedfc66 backend-pipewire: add fence to synchronize on finish of render
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>
2024-08-05 09:09:51 +00:00
Leandro Ribeiro f271dd34b6 compositor: delete cms-static and cms-colord plugins
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>
2024-08-05 11:47:30 +03:00
Marius Vlad 6449ee9dae gitlab-ci: Use virtme-ng for running our tests
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>
2024-08-02 20:06:25 +03:00
Marius Vlad e667a16752 tests/drm-*: Log drm-backend by default
This could be useful in investigating drm-* test hang-ups.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-02 20:03:41 +03:00
Loïc Molinari 2d8c1af8b7 gl-renderer: Add pixel storage modes section to best practices
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-07-29 14:20:43 +00:00
Loïc Molinari fb4cccc290 gl-renderer: Assume default GL texture unit
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>
2024-07-29 14:20:43 +00:00
Loïc Molinari b755345a46 gl-renderer: Assume fixed wireframe tex unit
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>
2024-07-29 14:20:43 +00:00
Loïc Molinari 69d4f66fab gl-renderer: Use fixed tex units
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>
2024-07-29 14:20:43 +00:00
Loïc Molinari 16390dbae1 gl-renderer: Avoid GL_ as a prefix for constants
Avoid prefixing constants with GL_ as it could be confused with OpenGL
constants.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-07-29 14:20:43 +00:00
Loïc Molinari 8a9fba9827 gl-renderer: Merge duplicated functions
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>
2024-07-29 14:20:43 +00:00
Robert Mader 9a754434f1 gl-renderer: Fix limited range quantization
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>
2024-07-25 19:03:01 +02:00