Commit graph

7559 commits

Author SHA1 Message Date
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
Sebastian Krzyszkowiak ce2fa93a6e
xdg-shell: Rephrase the "geometry larger than fullscreen state" error
It's the geometry size that gets checked, not the buffer size.

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
2021-08-02 13:31:20 +02:00
Marius Vlad 2ab08d8698 libweston/data-device: Don't crash when doing dnd operations w/o a keyboard
pointer/touch drag-n-drop operations could happen if there's no keyboard
hooked up or when it is unplugged.

Fixes: #235

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-07-31 17:19:15 +00:00
Jonas Ådahl 10c072b3f5 ci: Use ci-fairy to check for Signed-off-by
[daniels: Only run on MRs.]

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2021-07-31 16:28:22 +00:00
Daniel Stone 0bef636b04 ci: Switch to using new rules syntax
The rules syntax is more clear and explicit than the previous
only/except. Switch to using that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-07-31 16:28:22 +00:00
Jonas Ådahl 4fc87f8316 ci: Update ci-templates to newer version
[daniels: Extracted from previous patch, updated to even-newer version.]

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2021-07-31 16:28:22 +00:00
Nicholas Niro a11bc63ddd clients/desktop-shell: Add 24H support to the clock format. 2021-07-31 15:53:56 +00:00
James Hilliard d6dcd9bcd9 Update gitlab-ci pipewire to version 0.3.31
Updating PipeWire to the latest version lets us check that everything
still works well, and shows users that they are able to use it.

[daniels: Updated to 0.3.31, use symbolic ref tags rather than SHAs.
          0.3.32 is released, but doesn't build in our Debian
          environment; this is fixed upstream but there is no release
	  for it yet.]

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-07-31 15:49:09 +00:00
Jonas Ådahl a76d2053d0 xdg-shell: Add support for popup repositioning
This adds support for xdg-shell v3, which adds support for repositioning
popups. This adds support for explicit popup repositioning, as weston
doesn't yet apply any constraining to popups, thus cannot implicitly
reposition.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-07-31 15:34:05 +00:00
Emmanuel Gil Peyrot eff793ab46 Fix indentation all through the project
Fixes a “regression” from 04918f3b0b, but
also other missed pieces.
2021-07-31 15:28:20 +00:00
Link Mauve 48cd15ed44 renderer-gl: Allocate buffer on the stack
This avoids an extra heap allocation for each view.
2021-07-31 17:08:59 +02:00
Erik Kurzinger 04918f3b0b desktop-shell: don't run fade animation if compositor is inactive
When a window is closed, Weston will, by default, run a fade out animation and
defer destroying the underlying surface until it completes. However, if the
compositor is sleeping, and therefore not rendering any frames, this animation
will *never* complete. Therefore, if windows are repeatedly created and
destroyed while in sleep mode, these surfaces will keep accumulating, and since
the buffers attached to them may be backed by an fd, eventually the ulimit will
be reached resulting in a potential crash or other errors.

This can be demonstrated repeatedly launching and killing an X11 application
with Xwayland running.

while true; do xterm & pid=$!; sleep 0.5; kill $pid; done

As soon as the compositor goes to sleep, one can observe a steadily growing
list of dmabufs in the output of lsof.

As a fix, desktop_surface_removed should check whether the compositor is active
before kicking off the fade animation. If it is not, it should instead drop the
extra reference taken in desktop_surface_committed and then destroy the surface
immediately.

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
2021-07-31 13:47:45 +00:00
Marius Vlad eb34f827dd input: Handle correctly failure to compile XKB keymaps
And ultimately, fail to start when there are no input devices on the
system. Patchs adds consistency to touch/pointer initialization to
return -1 in case same thing happens.

Further more, when the device is not created we can't assume to retrieve
a valid one from a libinput_device so guard against it. This takes care of
hot-plugging situations when we couldn't create the (keyboard) device,
or when removing it.

Fixes: #117, #402, #485

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2021-07-31 13:44:47 +00:00
Derek Foreman 74bdb35c85 drm: Ignore timestamp for monitor shut-off
Some graphics drivers (currently at least VMware and AMD) will give a 0
timestamp for the atomic mode flip completion event when turning off
the display. This causes us to trip an assertion in
weston_output_frame_finish() because the clock jumps backwards, which
isn't a condition the presentation feedback code should be dealing with.

This is a good assertion and we'd like to keep it. And there's some
expectation that this is buggy behaviour in the graphics drivers that will
be fixed at some point.

Pragmatically speaking though, there's nothing productive we can do with a
correct timestamp for the display shutdown.  So let's just flag the
event sent for DPMS off as invalid so presentation feedback doesn't have
to worry about it, and the assert doesn't fire.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-07-31 13:39:27 +00:00
Vlad Zahorodnii c2b9747812 libweston/compositor: Drop weston_frame_callback
weston_frame_callback is needed primarily to store the doubly-linked list link,
but it can be also retrieved by using the wl_resource_get_link() function.

This removes an extra heap allocation per every wl_callback object.

Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2021-07-29 15:33:19 +03:00
Marius Vlad 25296db20a gitlab-ci.yml: Use same container source as the docs
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-07-28 21:42:52 +03:00
Derek Foreman f09710bd25 ci: Fix pull rate limit errors
Pull the container from a source without a rate limit

Suggested by Daniel Stone <daniels@collabora.com>

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-07-28 10:55:48 -05:00
John Good f33ddd0839 Allow programmatically closing xwayland window 2021-07-23 19:40:00 +00:00
Simon Ser b46d0e3304 tests/roles: switch to xdg-shell
Stop using wl_shell for the roles tests, since it'll get disabled
and removed eventually.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-07-23 17:26:02 +01:00
Simon Ser 413d210422 libweston-desktop: introduce a deprecated-wl-shell option
This is the first step towards removing wl_shell support.

Add an option so that users can toggle support for the deprecated
wl_shell protocol. This lets users test their clients to make sure
they work fine without wl_shell.

The option is set to false by default.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-07-23 17:22:22 +01:00
Daniel Stone 80e9482292 xdg-shell: Fail xdg_surface creation when surface has role
If a given wl_surface already has a role (e.g. cursor or subsurface),
there is nothing you can do with an xdg_surface which won't raise an
error, apart from destroying it.

As of wayland/wayland-protocols@11fecf0808 this is now explicitly
specified to be illegal, so disallow it within libweston-desktop. This
avoids us tying ourselves in knots with surface-private ownership.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-07-23 17:17:16 +01:00