Commit Graph

7629 Commits

Author SHA1 Message Date
Marius Vlad eb53d7c156 multi-resource: Convert to xdg-shell
Convert remaining wl_shell client to xdg-shell.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-14 09:28:04 +00:00
Marius Vlad 539c5a6c95 simple-touch: Convert to xdg-shell
wl_shell is officially deprecated so remove support for it and
instead add support for xdg-shell.  With it, we've further:

- moved out the buffer handling into its own a distinct structure in
  case we might want to do multi-buffer rendering
- perform a redraw after we have receiving the initial configure event,
  as to draw to working area where to user can use it for receving touch
  events

Additionally we are setting an appid in case one might want to use it in
tandem with kiosk-shell as to be able to place it on a
distinct/different output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-14 09:28:04 +00:00
Marius Vlad 4a0f94cefa simple-egl: Bail out if xdg-shell was not found
We only support xdg-shell in simple-egl, so make it obvious.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-14 09:28:04 +00:00
Marius Vlad a7392c855d desktop-shell: Clear out missing listeners
The keyboard focus listener, caps changed and pointer focus listener
were missing when destroying the seat. These are necessary to avoid
using weston_desktop object even if it was destroyed, which happens due
to a focus out event and ultimately handled by the keyboard focus notify
callback.

Once the seats are destroyed (and implictly the focus handlers) we're
safe to destroy weston_desktop object as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-14 09:06:44 +00:00
Marius Vlad c114fd6ef6 desktop-shell: Keep track of seats
This properly tracks the seats and with it, destroys them before
destroying weston_desktop object.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-14 09:06:44 +00:00
Derek Foreman 60ab03640a compositor: Allow disabling default flight recorders
Add a command line option to disable the default flight recorders
so we can save a little bit of CPU and memory on systems where
this isn't necessary.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-10-05 12:19:19 +03:00
Jonas Ådahl 56958aa6e9 desktop-shell: Damage subsurfaces when minimizing
Fixes an issue where subsurface extending outside of the main surface
wasn't damaged when minimized resulting in left-over content.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2021-10-01 12:03:11 +02:00
Derek Foreman 0b51b02c5e gl-renderer: Don't re-import dmabufs
My reading of the GL spec is that a dmabuf becomes a sibling to the
EGLImage created from it, and that all updates to the dmabuf will be
propagated to the EGLImage.

A rebind is still required every time the dmabuf content changes,
but this should be satisfied by gl_renderer_attach(), which does
a rebind when the buffer is commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-09-29 15:20:30 +00:00
Derek Foreman b47e2cc902 gl-renderer: Add EGL_IMAGE_PRESERVED_KHR to our attributes
So, turns out the GL implementation is allowed to destroy EGLImage
sources if this isn't set. Apparently none we've ever been tested on do
this, but it looks like we should be setting this anyway.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-09-29 15:20:30 +00:00
Derek Foreman b6c891774e launcher-logind: Try the user's primary session if not in a session
If we're not in a session we can fall back to sd_uid_get_display() to
find the user's primary session.

This allows launching weston from an ssh session or as a systemd
user service if a viable session is available.

It also more closely follows how libseat finds the session. The libseat
launcher can already do these things, so this change makes these
features common to both launchers.

Based on a patch by Sjoerd Simons <sjoerd.simons@collabora.com>

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-09-29 14:30:50 +00:00
nerdopolis d2a320d53e Fix TTY switching after failed failed repaint with legacy mode set.
Reported in !179 adding weston_output_repaint_failed resets the output

Co-authored-by: Daniel Stone
Co-authored-by: Julius Krah
Signed-off-by: n3rdopolis <bluescreen_avenger@verizon.net>
2021-09-29 12:17:58 +00:00
Derek Foreman a822afaaef input: fix keyboard focus crash
If two or more clients were running and the one that was focused when
weston itself lost keyboard focus was killed, weston would crash.

This is because commit 85d55540cb changed the way we handle saved keyboard
focus when we lose focus, and did so in such a way that the saved keyboard
focus listener could be removed from the surface destroy signal list
during the emit of the surface destroy signal. This corrupted the list
and led to a NULL pointer dereference.

Fix this by using a boolean flag to determine whether we should obey the
saved keyboard focus. We can set this safely in cases where
removing the listener would cause a crash.

Fixes #138

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-09-28 11:42:04 +03:00
Pekka Paalanen 645df9556d ci: bump test timeouts
This is prompted by the spurious CI failure
https://gitlab.freedesktop.org/wayland/weston/-/jobs/13891809
saying:

31/36 output-damage                          TIMEOUT        122.52s   8 subtests passed
32/36 output-transforms                      TIMEOUT        122.52s   16 subtests passed
33/36 subsurface                             TIMEOUT        122.52s
34/36 xwayland                               TIMEOUT        122.51s
35/36 ivi-shell-app                          TIMEOUT        122.51s
ERROR: Job failed: execution took longer than 5m0s seconds

That is hitting both kinds of timeouts at the same time: the per-test
timeouts, and the CI job total timeout.

That run seems to have had a particularly ill fortune, as a simple retry
finished the same job in 2 minutes, and the longest running test took
only 24 seconds.

Nevertheless, by Daniel Stone's suggestion let's bump both timeouts:

- the per-test timeout to 120 seconds, which with the multiplier in CI
  goes up to 8 minutes

- the job timeout for all build related jobs to 15 minutes

The timeout for tests_standalone is not bumped as we are not adding
significant amounts of new tests there.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-09-22 16:29:05 +03:00
Manuel Stoeckl 8a7f1e2bc0 pixman-renderer: track Pixman formats in pixel format table
Adds a Pixman format field to the pixel format table, and
adjusts the shm format handling code in the Pixman renderer
to use this table.

Pixman formats have been registered only for specific 565, 8888,
and 2101010 layouts, as these have corresponding DRM format codes
and are commonly used.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2021-09-15 15:00:29 +03:00
Simon Ser 448f05e82d ci: use seatd-launch
Instead of manually waiting for the seatd socket to come up, use
seatd-launch.

Add /usr/local/bin to PATH to avoid having to specify the whole
path to seatd-launch.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-09-14 16:19:45 +02:00
Simon Ser 3e53a8d478 ci: export ASAN_OPTIONS
This allows splitting the `meson test` command on multiple lines.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-09-14 16:19:45 +02:00
Simon Ser eb347687e7 ci: upgrade seatd to 0.6
This upgrades seatd to the latest version.

Examples are disabled by default. Man pages are already disabled
by auto_features=disabled. Other build options have been renamed.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-09-14 16:19:44 +02:00
Dennis Tsiang a2a8d382e3 gl-renderer: Don't require buffer age when using partial update
EGL_KHR_partial_update can be implemented independently of
EGL_EXT_buffer_age so we handle each case seperately.

Signed-off-by: Ben Davis <ben.davis@arm.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-09-07 15:20:25 +00:00
Pekka Paalanen 2ec15ebf3f libweston: fix crash on never used output's tear-down
weston_output_enable() initializes the list, but weston_output_release()
maybe be called even if the output was never enabled, triggering the
assert due to uninitialized (actually NULL) list head.

This can be triggered with a bad weston.ini, for example using an
invalid output transform value.

Check in weston_output_disable() instead, but because it too may be
called for non-enabled output, only if it was actually enabled.

Fixes: 1a4f87dec5
	"libweston: introduce weston_paint_node"

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-09-07 16:42:34 +03:00
Leandro Ribeiro 0750ceae6c drm-formats: remove create() and destroy() from the API
Since commit "drm-formats: save result of intersection in the first
array", every block of code where weston_drm_format_array_create() and
destroy() are being called could use init() and fini() instead.

Remove these two functions from the API to make it leaner. This patch
also modifies the code that depends on these functions to use init() and
fini().

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2021-09-06 12:52:37 +00:00
Leandro Ribeiro c51d4ad9c8 drm-formats: save result of intersection in the first array
In the current API, we have some set operations: join, intersect and
subtract. Both join and subtract receives two DRM format arrays and save
the result in the first one.

For the intersection we have a slightly different approach, what makes
the API weird. We don't save the result in the arguments, instead we
return a new array with the result.

Modify weston_drm_format_array_intersect() in order to make it similar
to the other two set operations.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2021-09-06 12:52:37 +00:00
yj1231.heo ec0b717d77 fullscreen-shell : fullscreen-shell doesn't support the screenshooter
wet_shell_init() of fulscreen-shell has been missing to create a
screenshooter.

 . adding a screenshooter_create() on wel_shell_init() for
 fullscreen-shell.
 . adding a dep_libexe_weston to meson.build to use the screenshooter

Signed-off-by: yj1231.heo <yj1231.heo@samsung.com>
2021-08-17 03:59:18 +00:00
Leandro Ribeiro d259bbeccd ci: replace kvmconfig with kvm_guest.config
Remove the following warning:

WARNING: 'make kvmconfig' will be removed after Linux 5.10
Please use 'make kvm_guest.config' instead.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2021-08-13 10:53:26 -03:00
Daniel Stone ec1ce9fc26 ci: Add clang build jobs
Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone c91a34fb03 ci: Remove erroneous extension from .build-no-test
This shouldn't extend the base .build-env, since we have per-environment
extensions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone 7c8b15256f ci: Work around PipeWire build warning with Clang
When building with Clang, PipeWire throws a warning we should trivially
work around:
    https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/858

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone ccb64f301c tests: Bump alignment for test structures to 64 bytes
Our core test structure is 36 bytes wide. Declaring it with a 32-bit
alignment should thus stripe it to 64 bytes. For some reason, clang+lld
lays them out with a 96-byte stride within the section (does it want an
entire 32-bit word when building with ASan?), getting the code wildly
confused when it tries to step through the structures.

So we could fix all our tests to avoid the fragile section dance, or we
could just waste another 4 bytes per test definition by bumping the
alignment up to 64 bytes, which seems to do enough to magically accord
with what clang+lld+ASan expect.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone fa6ae44719 backend-headless: Fix pointer vs. int confusion with EGL
EGL's native display type is not particularly well defined; in
gl-renderer we get around this by always treating it as a void *, since
for all the platforms we care about it's a pointer - gbm_device,
wl_display, or Display *.

The surfaceless platform doesn't care what the native display is (since
it doesn't have one by definition), so just use NULL instead of what may
be either NULL or 0 depending on environmental factors.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone eeaaf6b9b0 gl-renderer: Fix sign confusion in format/modifier query
Signed and unsigned integers are not the same thing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 13:13:51 +01:00
Daniel Stone 348e3a9abd CI: Separate build types out into stages
Give ourselves a bit more separation between the different job types, so
it's easier to see what's running and/or failing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone c26fa7e462 CI: Add ARMv7 support
ARMv7 is still an important architecture for us to run on, and running
on ARMv7 also gives us 32-bit build coverage. As distros are deprecating
their non-64-bit-x86 support, this may be our only realistic chance of
ensuring that our build is also 32-bit-clean.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 3530c522f8 CI: Add full AArch64 KVM support
Build a kernel for AArch64 and run it under virtme just like we do for
x86-64.

This requires adding support for the AArch64 defconfig variant, and
accommodating for the fact that it builds DRM as a module by default
rather than built in. The virtme branch we are using has also been
rebased on top of newer virtme upstream which unbreaks AArch64.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone daaa518b0e CI: Add initial AArch64 support
This only runs a single build job, to build without GL and not run any
tests, as KVM support is not yet included.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 20bb260f7d CI: Parameterise kernel build a bit more
AArch64 needs different names and paths to x86-64, so let's allow for
that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 2de949f723 CI: Use 'needs' to make dependencies more clear
GitLab CI has two execution scheduling models. The original model is to
split jobs into stages; jobs within a single stage may execute in
parallel, but execution is serialised between stages.

As we move to supporting multiple OSes and architectures, there is no
need to serialise, e.g. the AArch64 Linux build against the x86-64
FreeBSD container preparation.

Declare our dependencies explicitly using `needs`.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone d28aa36563 CI: Use Meson to build Wayland
autotools has already been removed, so we should be doing this.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone ca08c495ad ci: Bump Meson to 0.57.1
0.57.0 has a bug where the whole test harness crashes when using TAP and
failing tests, cf. https://github.com/mesonbuild/meson/pull/8385

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 50c83bf6c8 CI: Split OS-independent section from debian-install.sh
When we build our base-OS container, we run debian-install.sh to install
packages and compile our build dependencies. Since the latter is mostly
OS-independent, split debian-install.sh into two scripts: one to install
and cleanup packages, and another just to compile stuff.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 2cf3730f4f CI: Consolidate kernel/Mesa dependency installation
This makes it easier to split our scripts into OS-independent and
OS-dependent sections.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 770746e089 CI: Start parameterising for OS/architecture
No functional change to the test runs, apart from changing the job
names. This will allow us to test along more axes without more
duplication.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone c2642eb21a CI: no-test jobs don't need KVM
We only need KVM for testing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 36ad69e65e CI: Deduplicate $PATH
No need to set it twice.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 3e6b6a4095 CI: Rename job names to keep parameters first
GitLab already groups our various stages (container, build, etc) into
separate UI elements. Within those stages, the important information is
the parameterisation (architecture, OS, toolchain). We don't want that
to get ellipsised, so put that first in the job names.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone ebca36da66 CI: Document the build and container process
Explain what we do within our CI and why, with links as required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 29c1087b7b CI: Don't rebuild when running tests
Just cosmetic for now, but tell Meson to just run our tests rather than
trying to rebuild them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone dd6e88dc5c CI: Build wayland-protocols in container
Keep this as part of our container image; there's no reason to pull it
for every single build.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone d98e3dadd4 CI: Use appropriate parallelism for container builds
The shared runners export ${FDO_CI_CONCURRENT} for the appropriate
number of CPUs we should use during our builds.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone e4d8899b58 Bump wayland-protocols dependency to 1.19
Because we weren't properly pinning the wayland-protocols version, and I
can't read, we missed updating this in !563.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone aed8aafdbf drm/vaapi: Fix pointer-size confusion
The API expects uintptr_t (good!), but we're passing an unsigned long
here. Make the conversion explicit.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Marius Vlad c30cb29248 desktop-shell: Use weston_surface_destroy() directly
Follow-up from commit 'desktop-shell: don't run fade animation if
compositor is inactive' where the reference was dropped directly,
instead of using weston_surface_destroy().

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-08-03 10:44:26 +03:00