Make it more explicit that the return value is NULL when there is no
arrray.
This patch makes the following patch smaller.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This allows tests to give a meaningful name for their fixture setups
when they use more than one of them.
If a test uses DECLARE_FIXTURE_SETUP_WITH_ARG(), it must now pass a
third argument naming the field which is struct fixture_metadata. This
also means that the fixture setup data must now be a struct, it cannot
be a plain type anymore. A compiler error is generated if the field type
is not the expected one.
All tests using DECLARE_FIXTURE_SETUP_WITH_ARG() and converted to the
new form and given names for their fixture setups.
The fixture setup names not actually used yet, that will be another
patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
xdg_shell stable has been available for a long time, so xdg_shell_v6 should no
longer be needed. However, to play it safe, we just disable it for now. We can
then remove the implementation entirely later.
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
This makes sub-tests visible in the junit output, making Gitlab test
reports more detailed.
This does not apply to zuc tests, which look like they could produce
junit XML directly. And maybe TAP? Left for another time.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/296
The conclusion (quite a while ago, too) was that requiring Meson 0.52 is
fine. Mesa does that too. Bump the requirement to 0.52.1 which is the
last release of the 0.52 series.
This allows all issues listed in #296 to be worked on. It also allows
switching to TAP in the test suite for more detailed reports.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This allows Gitlab to show a detailed test report in a human friendly
manner on a merge request page.
The junit output depends on Meson 0.55, but Meson in CI is bumped to the
latest release on Feb 15th. It is beneficial to use the newest
possible Meson in CI even if we do not require it, so that we benefit
from fixes, e.g. new warnings about accidentally using more recent
Meson features than our minimum Meson version supports.
Meson 0.57 is required for proper test names in the Gitlab report after
switching the tests to TAP. See:
https://github.com/mesonbuild/meson/issues/8316
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This prevents a segfault in libwayland-cursor when the parent compositor
doesn’t have any of the needed protocols implemented.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
shm buffer should be freed in case of `out_pixman_error`, and should
be inserted into shared_output just before the success return.
Signed-off-by: xndcn <xndchn@gmail.com>
Fixes: #400
the clock on upper right corner of screen for
desktop shell is behind one minute when compared
to output of date command, so change initial expiration
it_value for minute and sec to remove the delay.
Signed-off-by: Veeresh Kadasani <veeresh.kadasani@huawei.com>
This allows launcher-direct to run when seat0 has no TTYs
This checks for a proper /dev/tty0 device as /dev/tty0
does not get created by kernels compiled with CONFIG_VT=n
Documentation file for explaning in more detail how to run weston, using
launcher direct and specifying a non-default seat. This explains how to
create a udev file and assign a particular GPU card to it, and
potentially, other input devices. It also describes a bit additional
arguments that can be passed on, as an introduction to using the DRM
node for that particular seat.
Fixes#460
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This adds a test to ensure that the wl_shm formats YUV420, NV12 and YUYV
are decoded and converted to RGB correctly in GL-renderer.
The test deliberately uses a 256 x 256 test image so that effects from
width vs. pitch vs. stride cannot be observed, and row padding is zero.
Also padding between planes is zero. Attempting to use a test image with
less "round" dimensions lead to stride mismatch in GL-renderer, likely
due to GL_UNPACK_ALIGNMENT being left at value 4. It is unclear if YUV
wl_shm buffers' row stride needs to be aligned to 4 bytes or not, so I
did not pursue fixing it. GL-renderer seems to be confusing width, pitch
and stride even further, and not e.g. allow padding with ARGB buffers.
See also: https://gitlab.freedesktop.org/wayland/weston/-/issues/354
Furthermore, the test arranges so that each 2x2 pixel block has the same
color. This avoids having to consider chroma siting when sub-sampling.
This way all the test cases can use the same reference image.
The source image chocolate-cake.png is taken and copyright by Pekka
Paalanen, hereby licensed as
http://creativecommons.org/licenses/by-sa/4.0/ .
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add error logging in three different launcher backends:
launcher-logind, launcher-weston-launch, and launcher-direct
to indicate failures for easier debug
Signed-off-by: Anurup M <anurup.m@huawei.com>
Require GL_EXT_unpack_subimage unconditionally in GL-renderer. Without
this extension, it would take considerable effort in GL-renderer to
handle correctly images that contain row padding, either as a temporary
copy to remove padding or doing SubImage updates row by row.
I would guess that this path has gone long completely untested, and if
it was exercised, the rows never had padding thanks to 32-bit pixel
formats. Instead of writing tests to poke the corner cases and fixing
it, remove it.
This will make it easier to fix other problems in GL-renderer in this
area in the future - one less path to consider and many restrictions in
GL API gone.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Warn the user that this is not supposed to work. Developers who know
what they are doing know to ignore this message, others should think
twice.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
If the launcher is told to use a non-default seat (not seat0), there
will not be a VT or tty to set up. VT/tty setup requires privileges.
This patch allows a non-root user to use launcher-direct, provided that
the seat is not the default. There is still the problem of opening DRM
and input devices, which is left for the user to solve.
This mode of operation is useful for developers who can set up a
secondary seat on their machine. You can run Weston/DRM from a terminal
window by pointing it to a non-default seat. You have to arrange a
DRM device by having an extra unused graphics card in the machine. You
also need dedicated input devices. Both the DRM device and the input
devices must be assigned to the secondary seat and device file
permissions adjusted so that they can be opened.
Doing so is an obvious security risk, as input could easily be
eavesdropped.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The buffer created for flight recorder, the allocations done in 'logger' and
'flight_rec' subscribers were not freed when wl_display_create() fails. So
move them to out_display
Signed-off-by: Anurup M <anurup.mokkil@gmail.com>
In anticipation of invasive future work on color management, add an
alpha blending test to make sure we don't break alpha blending.
The idea for doing a monotonicity test came from glennk on #dri-devel in
Freenode IRC.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This refactors a new function verify_image() out of
verify_screen_content().
verify_image() will be useful with a test that verifies a screenshot
against a reference image but also wants to do additional testing on the
screenshot.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Const has documentary value saying the code will not modify the
parameter contents. Everything that can be const, should be const.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Some panels advertise both pointer/touch capabilities but without having
real capability of driving a cursor (they're basically touch panels) and
use USB as a communication tunnel to transfer/send out input events.
As we can't really tell if they're fake or not, only advertise to
clients pointer capabilities if we detect movement on the cursor/pointer.
We handle it at lower level as that allows to handle the case where
removal of a real pointer should also remove the cursor from being
displayed on the screen.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Without this patch, the DRM-backend would rewrite the 'require-input',
core section option given by the user.
This removes 'continue_without_input' DRM-backend option and takes into
consideration the cmd line option only if that was passed (Pekka Paalanen).
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This helps identify if we have actually have a build issue or if we have
a documentation build failure. Notifications sent out are specifying the
name of the build, making things much easier to figure out what actually
failed.
Uses another job w/o the need to run the tests (again).
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
While the code looks fine, clang 7 memory sanitizer complains about
things like:
==26052==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7f4f4d003327 in weston_config_get_section /home/pq/build/weston-clang/../../git/weston/shared/config-parser.c:141:2
#1 0x7f4f4cfce11a in wet_main /home/pq/build/weston-clang/../../git/weston/compositor/main.c:3266:12
==26683==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7f09ebd638e2 in config_section_get_entry /home/pq/build/weston-clang/../../git/weston/shared/config-parser.c:125:2
#1 0x7f09ebd661c4 in weston_config_section_get_bool /home/pq/build/weston-clang/../../git/weston/shared/config-parser.c:310:10
#2 0x7f09ebd2e1e5 in wet_main /home/pq/build/weston-clang/../../git/weston/compositor/main.c:3269:3
In all cases, the errors point to wl_list_for_each().
Making these allocations use zalloc() avoids these errors. Since using
zalloc() is a good habit in any case, I didn't dig deeper.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Do not write out PNG files for successful screenshot tests. It clutters
the build directory, but the biggest reason is to keep the CI artifacts
smaller.
internal-screenshot test still writes a PNG, it's good to keep one PNG
written so that we exercise the PNG writing code always.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
If a screenshooting test fails, it quite likely writes not only the screenshot
but also a diff image highlighting the failed pixels. These would be good to
have in the CI artifacts for postmortem.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Until now we had the test quirks initialization in wet_main(),
just after calling weston_compositor_create(). But there are
some cases that require the quirks during struct weston_compositor
creation time.
Move test quirks initialization to weston_compositor_create()
in order to cover more use cases for the test quirks mechanism.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Makes the client's life much easier to identify between multiple remote
outputs. xdg_output is advertising (in later versions) the head name,
but in case we have different plug-ins or multiple remote
outputs created, it would only repeat/advertise the same name
for all (remoting) outputs.
This instead uses a string that uses both the connector and name to
derive a more easier identifier a client can choose from.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This adds a link in any MR to the documentation from the CI build, making it
easy to preview the documentation.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
kiosk_shell_destroy() will free up weston_desktop, but still keeping
listeners set-up (keyboard/seat/caps), which will fire
when the the compositor is stopped/shutdown by clients still connected.
This patch maintains a list of seats and uses it to remove any listeners
when calling kiosk_shell_destroy(). desktop-shell and ivi-shell do not
appear to be using weston_desktop_destroy() in their respective destroy
parts.
This avoids an illegal access happening when calling one of the
listeners, after weston_desktop has been free'ed, like the following:
==2002== at 0x10F3F8FD: weston_desktop_get_display (libweston-desktop.c:125)
==2002== by 0x10F450A7: weston_desktop_xdg_surface_schedule_configure (xdg-shell.c:1022)
==2002== by 0x10F44793: weston_desktop_xdg_toplevel_set_activated (xdg-shell.c:643)
==2002== by 0x10F41AA5: weston_desktop_surface_set_activated (surface.c:468)
==2002== by 0x10F32E7E: kiosk_shell_seat_handle_keyboard_focus (kiosk-shell.c:329)
==2002== by 0x4A726A7: wl_signal_emit (wayland-server-core.h:478)
==2002== by 0x4A75BD1: weston_keyboard_set_focus (input.c:1586)
==2002== by 0x4A776FE: notify_keyboard_focus_out (input.c:2314)
==2002== by 0x5902BC1: udev_seat_destroy (libinput-seat.c:469)
==2002== by 0x59028C5: udev_input_destroy (libinput-seat.c:375)
==2002== by 0x58F0449: drm_destroy (drm.c:2571)
==2002== by 0x4A6EE39: weston_compositor_destroy (compositor.c:7814)
==2002== Address 0x10bd1780 is 0 bytes inside a block of size 152 free'd
==2002== at 0x48399AB: free (vg_replace_malloc.c:538)
==2002== by 0x10F3F8DA: weston_desktop_destroy (libweston-desktop.c:112)
==2002== by 0x10F34357: kiosk_shell_destroy (kiosk-shell.c:1009)
==2002== by 0x4A5F618: wl_signal_emit (wayland-server-core.h:478)
==2002== by 0x4A6EE06: weston_compositor_destroy (compositor.c:7809)
==2002== by 0x4855548: wet_main (main.c:3420)
==2002== by 0x109154: main (executable.c:33)
==2002== Block was alloc'd at
==2002== at 0x483AB65: calloc (vg_replace_malloc.c:760)
==2002== by 0x10F3F681: zalloc (zalloc.h:38)
==2002== by 0x10F3F724: weston_desktop_create (libweston-desktop.c:65)
==2002== by 0x10F34458: wet_shell_init (kiosk-shell.c:1045)
==2002== by 0x484F83D: wet_load_shell (main.c:924)
==2002== by 0x48552D3: wet_main (main.c:3361)
==2002== by 0x109154: main (executable.c:33)
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This is a follow-up of commit "tests: start to use Weston's
default screenshooter in the test suite".
As we've started to use Weston's default screenshooter
implementation and protocol extension in the test suite,
we don't need what we've created specifically for the test
suite anymore.
Drop test suite screenshooter implementation and protocol
extension.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Until now we had two different protocol extensions: one for the
test suite screenshooter and other for the screenshooter client.
As they are identical and this won't change, make the test suite
use the same protocol that the screenshooter client uses.
Besides the cleanup, this change will also allow us to use the
DRM writeback screenshooter in the test suite, as the test suite
implementation is hardcoded to use a renderer based screenshooter.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We have two functions with the name weston_screenshooter_shoot():
1. screenshot protocol function that the screenshooter
client uses to request screenshots to the compositor
2. libweston function used by the compositor to take
screenshots as requested by the screenshooter client
Until now we had no problem with that, but in the next commits
we are going to use the screenshot protocol in the test suite,
which is also user of libweston. So rename screenshot protocol
function to weston_screenshooter_take_shot() to avoid the conflict.
For consistency, also rename screenshooter_shoot() to
screenshooter_take_shot() in compositor/weston-screenshooter.c
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The 'struct test' has a field 'int buffer_copy_done', but it
is in a fact a boolean. Change it to 'bool buffer_copy_done'.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The wl_drm protocol is not being used by the test client. So
remove 'bool has_wl_drm' from 'struct client' and also the
branch that initializes this variable in handle_global().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When destroying the shell we need to remove the listeners
as well. The test-desktop-shell was forgetting to do this.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Commit 32a5acde5b
"tests: add mechanism to change Weston's behavior when running certain
tests"
added a new field to struct weston_compositor. Since that struct is
still in the public header, this breaks ABI. Bump the library version
accordingly.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Until now we had struct wet_testsuite_data as an opaque
struct that should be defined by the testsuite of libweston
users. Instead, keep the data as a void * and document that
users are responsible for defining the data type.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
There are some specific cases in which we need Weston to
behave differently when running in the test suite. This
adds a new API to allow the tests to select these behaviors.
For instance, in the DRM backend we plan to add a writeback
connector screenshooter. In case it fails for some
reason, it should fallback to the renderer screenshooter
that all other backends use. But if we add a test to
ensure the correctness of the writeback screenshooter,
we don't want it to fallback to the renderer one, we
want it to fail. With this new API we can choose to
disable the fallback behavior specifically for this test.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>