Commit Graph

7278 Commits

Author SHA1 Message Date
Maxime Roussin-Bélanger 35e34505ce backend-drm: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:01:07 -05:00
Maxime Roussin-Bélanger 3ae4a467e6 protocol: fix "assigne" typo
Signed-off-by: Maxime Roussin-Bélanger
<maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:45 -05:00
Maxime Roussin-Bélanger 5d10fe0264 shared: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:32 -05:00
Maxime Roussin-Bélanger 4e8ea1f9d5 tests: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:21 -05:00
Pekka Paalanen 9dc1f26818 CONTRIBUTING: make S-o-b mandatory but pseudonym ok
This was prompted by a recent discussion on #dri-devel IRC channel,
where the use of pseudonyms to maintain anonymity was said to be a
normal and accepted practice. See:
https://people.freedesktop.org/~cbrill/dri-log/index.php?channel=dri-devel&highlight_names=&date=2021-02-09
and look for the discussion around pq and Lyude.
Until then, I was hesitant to accept Signed-off-by's with names that
looked very much not a real name.

Clarify our documentation that pseudonyms are ok.

Note, that is not what the Linux kernel documentation says today in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst
which says that pseudonyms are not ok. According to the discussion, this
should probably be fixed in the kernel too.

Since we are now ok with pseudonyms in Signed-off-by, there is no reason
left to accept any patches without a Signed-off-by. This clarifies our
policy and takes the burden of case-by-case consideration away from
maintainers.

The wording about needing to use a personal email address is my
addition. The intention is to ensure a globally unique handle for a
person while that person remains anonymous, so that the Signed-off-by
cannot be mistaken for someone elses.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-22 10:52:28 +00:00
Pekka Paalanen abfe9c0f4d CONTRIBUTING: no more emailed patches
We haven't received any emailed patches in years I think, and they would
be inconvenient to process. Make it clear that emailed patches are
unwanted.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-22 10:52:28 +00:00
Pekka Paalanen 946b933f9e tests: clarify --help
Use consistent terminology with the code: index starts from zero,
numbering starts from one. Fixture 0 runs all fixtures.

Suggested-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen 3ee1f27278 tests: --list lists individual fixture setups
When there is a fixture setup array, list all fixture setups with their
numbers and names. This should help people picking a single fixture to
run and makes the --list output more interesting.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen d91e63dea0 tests: use fixture names in reports
Instead of "fixture %d", use the proper fixture name if it exists or
nothing. Some places still show the fixture index because it is used on
the command line.

This makes the reports more readable.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen 345d7da606 tests: refactor into fixture_setup_array_get_arg()
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>
2021-02-17 12:52:33 +00:00
Pekka Paalanen ef81388466 tests: introduce struct fixture_metadata
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>
2021-02-17 12:52:33 +00:00
Pekka Paalanen eb5a95bfc9 libweston: move TYPEVERIFY macro into shared
This will be useful in the test harness macros.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Kenny Levinsen 69039ceb43 libweston-desktop: Disable xdg_shell_v6
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>
2021-02-16 12:30:10 +01:00
Pekka Paalanen 5580cb13c9 tests: switch to TAP
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>
2021-02-15 11:17:17 +02:00
Pekka Paalanen c0565b61d3 build: bump Meson requirement to 0.52.1
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>
2021-02-15 11:17:17 +02:00
Pekka Paalanen bcf37c937a CI: expose test results as junit
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>
2021-02-15 11:16:15 +02:00
Emmanuel Gil Peyrot 5b5decb99b compositor: Add suggestion when colord is enabled but not LCMS
Most other errors caused by missing dependencies offer this helpful
suggestion.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-02-12 12:13:28 +00:00
Emmanuel Gil Peyrot 0b48e6b5ca backend-wayland: Abort early when wl_shm isn’t advertised
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>
2021-02-12 12:31:26 +01:00
Veeresh Kadasani 557dea5660 weston.ini.man :remove tablet shell related things
Remove info about tablet-shell related things
which are not used.

Signed-off-by: Veeresh Kadasani <veeresh.kadasani@huawei.com>
2021-01-29 13:25:53 +05:30
xndcn ffe422116d screen-share: fix possible memory leak for `out_pixman_error` case
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>
2021-01-27 14:59:26 +00:00
Veeresh Kadasani ed4a0e9275 desktop-shell:change expiration of minute and sec
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>
2021-01-21 16:04:34 +05:30
nerdopolis 9cb96f8353 launcher-logind: handle any seat without VTs
Instead of assuming that seat0 has TTYs, use logind to check if
the seat has TTYs
2021-01-21 09:02:26 +00:00
nerdopolis 72db3ac694 launcher-direct: handle seat0 without VTs
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
2021-01-21 09:02:26 +00:00
Marius Vlad fbc065fdc5 doc: Add running-weston.rst file
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>
2021-01-19 22:40:46 +02:00
Ambareesh Balaji a67393c353 pipewire: fix null deref in 0.3 API
Signed-off-by: Ambareesh Balaji <ambareeshbalaji@gmail.com>
2021-01-12 16:02:19 +00:00
Pekka Paalanen ae12b9596d tests: add yuv-buffer test
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>
2020-12-17 09:34:09 +00:00
Anurup M aa7de33e03 launcher: Add more error logging to launcher backends
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>
2020-12-16 07:23:02 +00:00
Pekka Paalanen 593d5af43a gl-renderer: require GL_EXT_unpack_subimage
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>
2020-12-15 14:42:46 +00:00
Pekka Paalanen 2d738b856d launcher-direct: warn when opening devices non-root
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>
2020-12-11 10:18:19 +00:00
Pekka Paalanen 4e9f4d0474 launcher-direct: allow non-root on non-seat0
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>
2020-12-11 10:18:19 +00:00
Anurup M 6aa46844a6 compositor: Fix possible memory leak when wl_display_create() fails
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>
2020-12-10 09:19:09 +00:00
Anurup M 09a7dfb12c doc: Avoid weston install useless documentation files
Avoid .doctrees (~3.5 MB) and .buildinfo to be installed

Signed-off-by: Anurup M <anurup.m@huawei.com>
2020-12-09 14:53:00 +00:00
Pekka Paalanen 26258817fc tests: add alpha-blending test
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>
2020-12-09 14:06:43 +02:00
Pekka Paalanen f8d170c4e7 tests: factor out verify_image()
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>
2020-12-09 14:06:43 +02:00
Pekka Paalanen ee60752ebd tests: constify fill_image_with_color()
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>
2020-12-09 14:06:43 +02:00
Pekka Paalanen a3bfa1b27d tests: re-order drm-smoke in test list
To keep the list in alphabetical order so it's easy to search.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-12-09 14:06:43 +02:00
Marius Vlad e825fe389e libweston/libinput-device: Enable/Set pointer capabilities only on pointer movement
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>
2020-12-08 17:54:55 +02:00
Anurup M c640cb600d desktop-shell: Add missing weston_config_destroy() for desktop.config
desktop.config sections could be freed after it's use. This will avoid
memory leak.

Signed-off-by: Anurup M <anurup.mokkil@gmail.com>
2020-12-08 09:15:20 +00:00
Marius Vlad a86b590fea backend-drm: Fix ignoring config 'require-input' option
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>
2020-12-07 12:49:38 +02:00
Marius Vlad e630d2d0d0 gitlab-ci.yml: Have a doc job
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>
2020-12-04 14:23:46 +02:00
Pekka Paalanen 49399806a0 config-parser: use zalloc()
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>
2020-11-27 14:44:10 +02:00
Pekka Paalanen 94bf0a6463 tests: do not save PNG on success
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>
2020-11-18 16:14:33 +02:00
Pekka Paalanen d73b10916d CI: store test images in artifacts
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>
2020-11-18 16:14:33 +02:00
Veeresh Kadasani 9490a9893f pipewire/meson: fix option in user_hint
Signed-off-by: Veeresh Kadasani <veereshkadasani88@gmail.com>
2020-11-17 09:48:59 -05:00
Leandro Ribeiro cdb7218daf compositor: move tests quirks initialization to weston_compositor_create()
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>
2020-11-17 12:38:42 +00:00
Marius Vlad bb7ed37a89 remoting,pipewire: Use the connector and the output name for the head name
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>
2020-11-09 11:36:12 +02:00
bnlrnz cf83b48be4 backend-headless: NULL check after wl_event_loop_add_timer
Running weston with headless backend will segfault if wl_event_loop_add_timer fails
   Closes #102

   Signed-off-by: Ben Lorenz <bnlrnz@gmail.com>
2020-11-06 16:13:24 +00:00
Pekka Paalanen a79c917466 CI: expose built docs preview
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>
2020-11-05 16:09:32 +02:00
Marius Vlad 092130c4bf kiosk-shell: Keep track of seats created and destroy them at end
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>
2020-11-04 14:34:30 +02:00
Leandro Ribeiro 79491b41f5 tests: drop test suite screenshooter implementation and protocol extension
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>
2020-10-27 12:19:39 +00:00