Move to a const struct weston_pointer_axis_event, add the base_event
struct that contains the timespec and use the initialization functions.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Similar to "input: Introduce weston_key_event struct", this adds a way
to store all required information with a common struct event to be able
to pass it down and to allow also pass additonal information like
Perfetto's flow IDs.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This adapts weston_pointer_motion_event struct to align in with
weston_key_event and includes the following changes:
- include base struct
- remove the const struct timespec from calls and use the base struct
- pass by a const pointer motion event in all the callers
- add init helper
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than passing a time stamp, key, key state and key event state
use a weston_key_event struct to pass by all that using it.
This would allow in further patches to attach additional information
like a flow id used by Perfetto debug annotations for input events.
This patch has no functional change as it is now.
All the callees will just will extract the required information out of
struct weston_key_event.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We currently leak resources and hit asserts if dmabuf is unavailable.
Move the check to before we initialize anything.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since the commit "color-lcms: extract HDR static metadata from profile"
this was all dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Extract the HDR static metadata type 1 from the output color profile
directly, instead of relying on a separate weston.ini section to provide
the metadata separately.
Weston should tell the monitor what target color volume it is rendering
for. I don't see a reason to be able to control the metadata separately,
and it would add complexity.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The point of buffer_transform_split is to ensure that committing only
transform and scale changes gets reflected on screen, without explicit
damage. There is no need to go through the big set of parameter
combinations, it only needs to test that changing each triggers the
damage.
Test setting only scale and only transform separately, so that one
cannot mask bugs with the other.
This brings the screenshot count for buffer_transform_split from 12 down
to 2, which is good for CI running time.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This test was originally written to ensure Weston does not repaint too
much, but it does also test that renderers transform the damage
correctly into the framebuffer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
TF_SRGB will be deprecated, best to never advertise it. The test can
simply use gamma22 instead.
TF_EXT_LINEAR has an implementation and should be usable nowadays.
TF_ST2084_PQ, GAMMA22 and GAMMA28 likewise.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Weston does not support the saturation rendering intent for parametric
image descriptions yet. Not really, Weston would just do the same as
media-relative with BPC does.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
If the compositor fails to initialise in such a way that we want to
skip, don't leak the idle source.
This fixes the ASan failure, but still results in a TAP-parsing failure.
Signed-off-by: Daniel Stone <daniels@collabora.com>
This ensures that both blending implementations will be tested. The AUTO
mode, which was the only mode before this patch, would not test the
fixed-function blending a.k.a GL-renderer shadow framebuffer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This tests our dma-buf buffer support for GL screenshots. We use two
backends that have outputs with different y origin in order to exercise
the implementation.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This ensures that output capture implementation is behaving accordingly,
but not that the screenshot result is correct. In the next commit we
add tests for checking that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The client-buffer test was setting the desired output refresh rate to
the highest possible, posting a new buffer to the screen, waiting for
the frame callback, then requesting a screenshot be taken.
This was not necessary (we already have a mode for tests which only want
screenshots and not a free-running refresh), and also harmful in that it
setting up a potential race.
When gl-renderer gets asked to repaint with nothing to show, it tries to
read back the GL fence status after the dmabuf has signalled. On drivers
with the threaded context enabled, the GL fence would not be readable,
even if the attached dmabuf was.
The easy fix to this is to just not free-run refresh.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Otherwise we would end up checking the output of the GL renderer, not
verifying that we set the DRM properties correctly.
Coincidentally this also seems to work around CI flakiness of the test.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
I was doing
$ mseon setup --wipe
$ meson test
and hit
../../git/weston/tests/constraints-test.c:31:10:
fatal error: pointer-constraints-unstable-v1-client-protocol.h:
No such file or directory
31 | #include "pointer-constraints-unstable-v1-client-protocol.h"
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
In function ‘encode_PAM_comment_line’,
inlined from ‘write_PAM_image_rgba’ at ../../git/weston/tests/surface-screenshot-test.c:85:9,
inlined from ‘trigger_binding’ at ../../git/weston/tests/surface-screenshot-test.c:202:8:
../../git/weston/tests/surface-screenshot-test.c:44:22: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized]
44 | size_t len = strlen(comment);
Fixes: d40af215a3
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We may break out of the loop if wl_display_dispatch(client->wl_display)
fails and returns -1. So we need to assert that info->done is true after
the loop.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We've just added support for grayscale output color effect. This adds
test cases for that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
struct weston_curtain_params is changed to match the new
weston_surface_set_label() API. For now, I did not bother hooking up the
static label flavor.
Part of migration away from get_label().
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
On the quest to delete the get_label() vfunc completely, a temporary
default get_label implementation needs to be plugged in. This would
affect all the code that checks whether the get_label vfunc is NULL.
Let's make get_label vfunc non-NULL always intentionally first. We can
delete all the code that checked for NULL, and the bespoke label
replacements in that case. Now all those different "no label" cases are
unified.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Just for completeness sake, let's commit the image description. This
should poke at the surface state machinery with the image description.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Enhancing the color-manager machinery in the client library to suffice
for color-management-test.c as well, we can remove a copy of the
boilerplate code.
The changes include renaming things, moving parameters from
image_description to image_description_info, deleting the list of image
descriptions and cleaning them up explicitly, and creating the
color-management surface and output objects on-demand.
image_description_get_information() explicitly waits for the done event
instead of relying on a ropund-trip.
Bit operations got helper functions. Gamut parameter printing was
re-written.
In spite of the massive changes, the tests themselves still work exactly
the same.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Turns out that the fail-case code does everything the good-case code
does and more, so we can reduce the code duplication.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There are two partial implementations of the color-manager
protocol boilerplate, in color-management-test.c and
color-management-parametric-test.c. This patch moves the implementation
from the latter into the client library, and uses the helper bit().
This paves way for moving the other partial implementation as well,
de-duplicating the overlapping code, and allowing new test programs to
poke at color-manager.
The color-manager is initialized on-demand, because mosts tests in the
suite do not need it. This avoids a little of unnecessary work.
In anticipation of wp_color_management_v1 version 2, the interface
version is explicit and ensured.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
weston-test-client-helper.h includes all these generated header files. I
could not figure out what might guarantee that these headers are
generated before compiling anything that includes
weston-test-client-helper.h, maybe we are simply lucky. I could not make
the build fail by building a single test program from a clean builddir.
Yet, this seems like the right thing to do.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There is no need to special-case this generated header in foreach-tests
if we list it as an order-only dependency implied by dep_test_client.
The viewporter header is already there.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
xdg-client-helper is already built into the dep_test_client library,
there is no need to add the sources again.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
A minor simplification to tests/meson.build. The disabler object
prevents the test from being built or run.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
It was getting difficult to see which files were part of the test
harness and which were actual tests. Moving the harness sources into a
subdirectory helps to see at a glance what is what, and will allow using
shorter file names in the future.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Since commit "xdg-shell: handle xdg_wm_base being destroyed before its
children", we raise a protocol error DEFUNCT_SURFACES for misbehaved
clients.
This adds a test to ensure that DEFUNCT_SURFACES is being posted for
such clients.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
There's no need to use the desktop-shell if the purpose of these tests
is to test our xdg-shell implementation.
In the next commits it will be important to have a simpler shell to
work with, as we'll introduce additional tests for xdg-shell that
trigger leaks that are hard to fix with the desktop-shell.
So let's change this test file to use SHELL_TEST_DESKTOP.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>