Everywhere else where use this trick, we also have 'used' in the
attributes, except here. Make this consistent.
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/517
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 5ba7ae2937)
It doesn't need to be using desktop-shell; trying to use it is not
sensible as it will try to bind to all the devices we're repeatedly
creating and destroying, sometimes lose the race, and fail the test
because desktop-shell has died too early.
Signed-off-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit ed97387a4e)
Test different scenarios where child subsurfaces of unmapped
subsurfaces would get mapped. This test will fail in various
ways without the commit
"libweston/compositor: Do not map subsurfaces without buffer"
Also try to test potential regressions of that patch.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit c83f0a1539)
Changing `wl_surface_damage()` to `wl_surface_damage_buffer()`
should not have an effect on the existing tests.
The new test will fail without the commit
"libweston/compositor: Cache buffer damage for synced subsurfaces"
Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit dc3b349325)
Give a role and a label for the test desktop shell background surface.
This makes it easier reading scenegraph dumps and other surface related
debug messages in tests when you don't have to guess what this
mysterious "PID 0, surface ID 0" surface is.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Leak found running drm-smoke-test with ASan.
Do not forget to destroy the SHM buffer by the end of the test.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This fixes a leak found running drm-smoke-test with ASan. Do not forget
to call prog_args_fini() when:
- skipping DRM-backend tests because we don't have
WESTON_TEST_SUITE_DRM_DEVICE set.
- we fail to acquire the lock needed to run DRM-backend tests.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We need to unlink this before freeing it since it's being called from
weston_signal_emit_mutable.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This simulates an output removal which should trigger a crash when
the compositor is shutdown abruptly by having a view with a listener installed
on its output_destroy signal.
This patch assumes that weston_compositor_remove_output() has already
been amended to use the more safer version for triggering signal
emission.
As both shells use this construct it should catch any potential signal
corruption.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
One of the best things about a real test framework is that they handle
timeouts for you.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Simon Ser <contact@emersion.fr>
drm-smoke-test can't run at the same time as anything else which touches
DRM devices. This includes any test which would use the GL renderer or
GL/GBM on the client side, since they will open DRM devices to probe
them at init time.
Signed-off-by: Daniel Stone <daniels@collabora.com>
It simply returns the number of format/modifier pairs in the array. This
will be useful for the next commits, in which we add support for dma-buf
feedback.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
No functional change. Moved color processing
functions into shared files which can be used
between different tests.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
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>
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>
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>
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>
This fixes all ASan reported leaks in this test.
This test program has several tests named *_multiple that just run
another test function 30 times. Previously without cleanup all the
created clients would be left lingering, but now they are torn down. Ths
might cause a change in test behaviour, although that was never the
intention:
> It is intentional to run it so many times, but it is not intentional
> to run a hundred clients at a time. The problem is that currently we
> have no destroy function for client. However, the clients do not run
> simultaneously but serially, so the effect should be the same as if
> we'd destroy them (after the client finishes its body, it just 'is'
> and does nothing until the process exits)
- the original review discussion in
https://lists.freedesktop.org/archives/wayland-devel/2015-March/020957.html
The intention for the repeat testing is that as the Weston instance
remains from test to another, each test needs to undo its changes to the
devices. Failing to correcntly undo would accumulate devices.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes all ASan reported leaks.
The manual touch release is slightly awkward as we need to open-code a
part of input_destroy() to avoid double-freeing pointer->wl_touch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Not printing these will drop 7980 lines or roughly 350 kB from the test
logs. Now I don't have scroll through them all, and I don't have to
watch them if I run this test manually.
These prints were useful when developing the test, but we don't need
them printed in CI all the time. Printing the final count should be
enough.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Now that GL-renderer and color manager implement linear light blending
for sRGB EOTF, add a test case to verify the result is expected.
As noted in test comments, this new tests is quite powerful in ensuring
the whole linear light pipeline is working correctly with 1D LUTs in
GL-renderer. This test will even catch smashing source_lut.scale = 1.0f
and source_lut.offset = 0.0f which would result in wrong texture sample
positions for LUT data.
As the assumption is that by default content and outputs are in sRGB
color space, this test should not need fix-ups or become stale when more
color management features are implemented.
The sRGB EOTF can be found in:
http://www.color.org/sRGB.pdf (beware, typos)
https://www.w3.org/Graphics/Color/srgbhttps://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#TRANSFER_SRGB
Note on AMD Polaris 11 error threshold: this is quite likely due to
using fp16 format shadow framebuffer and GCN fp32 to fp16 conversion
instruction rounding mode. When using fp32 shadow framebuffer, the error
glitch is not present and the threshold could be significantly lower.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Instead of checking just the monotonicity of the blending results, this
changes the alpha-blending test to compute the reference blend result
itself and then comparing to the compositor result. This way we can be
sure that the compositor implements the exact correct formula and not
something that just looks nice, as verifying the reference images are
actually correct is hard.
The reference image is renamed to follow the fact that this is not
primarily a monotonicity test anymore. The reference image is also
redundant, but I think it has documentary value.
The #if 0'd block of code was very useful in figuring out blending
errors in a future test case, so it is included here. I have a feeling
we are going to need it again.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Refactor the alpha-blending test to allow using all three images
foreground, background, and screenshot in a future new verification
function.
This is a pure refactoring, no change in behavior.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Found by ASan, several leaks like:
Direct leak of 48 byte(s) in 2 object(s) allocated from:
#0 0x7f35fdc9c518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
#1 0x55a77d6a4c6a in zalloc ../../git/weston/include/libweston/zalloc.h:38
#2 0x55a77d6a748e in create_shm_buffer ../../git/weston/tests/weston-test-client-helper.c:459
#3 0x55a77d6a78cd in create_shm_buffer_a8r8g8b8 ../../git/weston/tests/weston-test-client-helper.c:499
#4 0x55a77d6a4145 in surface_commit_color ../../git/weston/tests/pointer-shot-test.c:89
#5 0x55a77d6a4542 in pointer_cursor_retains_committed_buffer_after_reenter ../../git/weston/tests/pointer-shot-test.c:135
#6 0x55a77d6a4207 in wrappointer_cursor_retains_committed_buffer_after_reenter ../../git/weston/tests/pointer-shot-test.c:98
#7 0x55a77d6b15c2 in run_test ../../git/weston/tests/weston-test-runner.c:162
#8 0x55a77d6b1c63 in run_case ../../git/weston/tests/weston-test-runner.c:277
#9 0x55a77d6b1a09 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
#10 0x55a77d6b1eeb in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
#11 0x7f35f9510b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
#12 0x7f35fd7a4fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
#13 0x7f35fd8c64ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
Now this test has no more leaks.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes all the leaks reported by ASan in this test.
The manual pointer release in
pointer_timestamps_stop_after_client_releases_wl_pointer is slightly
awkward as we need to open-code a part of input_destroy() to avoid
double-freeing pointer->wl_pointer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes all the leaks reported by ASan in this test.
The manual keyboard release in
keyboard_timestamps_stop_after_client_releases_wl_keyboard is slightly
awkward as we need to open-code a part of input_destroy() to avoid
double-freeing keyboard->wl_keyboard.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fixes ASan reported leak:
Direct leak of 136 byte(s) in 1 object(s) allocated from:
#0 0x7ff60173c518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
#1 0x7ff5fcfed3fa in zalloc ../../git/weston/include/libweston/zalloc.h:38
#2 0x7ff5fcfed8bf in wet_module_init ../../git/weston/tests/ivi-layout-test-plugin.c:196
#3 0x7ff60161bd81 in wet_load_module ../../git/weston/compositor/main.c:941
#4 0x7ff60161c165 in load_modules ../../git/weston/compositor/main.c:1012
#5 0x7ff60162ced9 in wet_main ../../git/weston/compositor/main.c:3441
#6 0x559a98fd7d4c in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
#7 0x559a98fdb780 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
#8 0x559a98fcbc48 in fixture_setup ../../git/weston/tests/ivi-layout-test-client.c:48
#9 0x559a98fcbcca in fixture_setup_run_ ../../git/weston/tests/ivi-layout-test-client.c:50
#10 0x559a98fdbd35 in main ../../git/weston/tests/weston-test-runner.c:661
#11 0x7ff60129109a in __libc_start_main ../csu/libc-start.c:308
#12 0x559a98fcb769 in _start (/home/pq/build/weston-meson/tests/test-ivi-layout-client+0xd769)
This also plugs the leak on wl_global_create() error path, though it
cannot really be tested.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Everything here was systematically leaking client and iviapp.
Discovered by ASan on ./tests/test-ivi-layout-client
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Leak found running drm-formats-test with ASan:
==59454==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f5302ff2459 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x7f5302e75e3a in zalloc ../include/libweston/zalloc.h:38
#2 0x7f5302e75e4e in weston_drm_format_array_create ../libweston/drm-formats.c:44
#3 0x7f5302e76e33 in weston_drm_format_array_intersect ../libweston/drm-formats.c:340
#4 0x559dc2d3c69f in intersect_arrays_same_content ../tests/drm-formats-test.c:391
#5 0x559dc2d3c317 in wrapintersect_arrays_same_content ../tests/drm-formats-test.c:376
#6 0x559dc2d409ec in run_test ../tests/weston-test-runner.c:162
#7 0x559dc2d410f2 in run_case ../tests/weston-test-runner.c:277
#8 0x559dc2d40e8b in for_each_test_case ../tests/weston-test-runner.c:235
#9 0x559dc2d4139b in testsuite_run ../tests/weston-test-runner.c:311
#10 0x559dc2d423c4 in weston_test_harness_execute_standalone ../tests/weston-test-runner.c:572
#11 0x559dc2d423f4 in fixture_setup_run_ ../tests/weston-test-runner.c:610
#12 0x559dc2d42887 in main ../tests/weston-test-runner.c:661
#13 0x7f5302c5eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
#14 0x559dc2d3642d in _start (/home/lele/weston/build/tests/test-drm-formats+0x642d)
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f5302ff2459 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x7f5302e75e3a in zalloc ../include/libweston/zalloc.h:38
#2 0x7f5302e75e4e in weston_drm_format_array_create ../libweston/drm-formats.c:44
#3 0x559dc2d3bc7b in intersect_arrays ../tests/drm-formats-test.c:352
#4 0x559dc2d3b678 in wrapintersect_arrays ../tests/drm-formats-test.c:339
#5 0x559dc2d409ec in run_test ../tests/weston-test-runner.c:162
#6 0x559dc2d410f2 in run_case ../tests/weston-test-runner.c:277
#7 0x559dc2d40e8b in for_each_test_case ../tests/weston-test-runner.c:235
#8 0x559dc2d4139b in testsuite_run ../tests/weston-test-runner.c:311
#9 0x559dc2d423c4 in weston_test_harness_execute_standalone ../tests/weston-test-runner.c:572
#10 0x559dc2d423f4 in fixture_setup_run_ ../tests/weston-test-runner.c:610
#11 0x559dc2d42887 in main ../tests/weston-test-runner.c:661
#12 0x7f5302c5eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
#13 0x559dc2d3642d in _start (/home/lele/weston/build/tests/test-drm-formats+0x642d)
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Fixes all ASan reported leaks for this test.
If frame_callback_wait_nofail() returns before the callback is handled,
the callback is not destroyed automatically. This happens on a protocol
error. This test intentionally triggers a protocol error.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reported by ASan.
Direct leak of 1468 byte(s) in 48 object(s) allocated from:
#0 0x7f20d7ae0330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
#1 0x7f20d76894b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
#2 0x7f20d7a66827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
#3 0x7f20d7a66f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
#4 0x5598e3fbcdfc in buffer_transform ../../git/weston/tests/buffer-transforms-test.c:122
#5 0x5598e3fc9add in run_test ../../git/weston/tests/weston-test-runner.c:162
#6 0x5598e3fca17e in run_case ../../git/weston/tests/weston-test-runner.c:277
#7 0x5598e3fc9f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
#8 0x5598e3fca406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
#9 0x7f20d3523b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
#10 0x7f20d75e8fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
#11 0x7f20d770a4ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
Direct leak of 978 byte(s) in 42 object(s) allocated from:
#0 0x7f26fed07330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
#1 0x7f26fe8b04b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
#2 0x7f26fec8d827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
#3 0x7f26fec8df76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
#4 0x55989ba8c2bc in output_damage ../../git/weston/tests/output-damage-test.c:201
#5 0x55989ba8c0cb in wrapoutput_damage ../../git/weston/tests/output-damage-test.c:176
#6 0x55989ba99131 in run_test ../../git/weston/tests/weston-test-runner.c:162
#7 0x55989ba997d2 in run_case ../../git/weston/tests/weston-test-runner.c:277
#8 0x55989ba99578 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
#9 0x55989ba99a5a in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
#10 0x7f26fa57ab6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
#11 0x7f26fe80ffa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
#12 0x7f26fe9314ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
Direct leak of 1696 byte(s) in 56 object(s) allocated from:
#0 0x7f077107f330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
#1 0x7f0770c284b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
#2 0x7f0771005827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
#3 0x7f0771005f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
#4 0x563e6ae36dfc in output_transform ../../git/weston/tests/output-transforms-test.c:122
#5 0x563e6ae43add in run_test ../../git/weston/tests/weston-test-runner.c:162
#6 0x563e6ae4417e in run_case ../../git/weston/tests/weston-test-runner.c:277
#7 0x563e6ae43f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
#8 0x563e6ae44406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
#9 0x7f076ca26b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
#10 0x7f0770b87fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
#11 0x7f0770ca94ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This reverts commit 81ef6d0ab3.
This also removes a bit from "tests: ensure color-lcms plugin loads".
Use of the shadow buffer is determined automatically based on
color transformations by the previous commit
"gl-renderer: use shadow framebuffer automatically".
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This creates the FP16 shadow framebuffer automatically if the color
transformation from blending space to output space is not identity and
the backend does not claim to implement it on the renderer's behalf.
That makes the weston_output_set_renderer_shadow_buffer() API and
use-renderer-shadow weston.ini option obsolete.
To still cater for the one test that needs to enable the shadow
framebuffer in spite of not needing it for color correct blending, the
quirk it uses now also forces the shadow.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>