This simplifies our test declaration macros a little bit. The aim is to
modify struct weston_test_entry to be more suitable for a future where
__attribute__((section)) is no longer used. The test functions will be
plain functions and not something baked with macros, so wrappers have
to go.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
When I make the test harness more type-safe, this would fail to build.
Add the missing const.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
When I make the test harness more type-safe, this would fail to build.
Add the missing const.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
gl_fbo_image_init() allocates and returns a renderbuffer through its rb
argument.
If it is not set in the dmabuf.rb field, gl_fbo_fini() will not be able to
release it and DMA buffers can start leaking.
This is usually not an issue because the DMA buffers are released when
Weston closes, but in the case of the pipewire output, the buffers are
allocated when a pipewire client connects and freed when the client
disconnects.
In that situation, dangling DMA buffers can be observed because of the
unfreed render buffer (rb).
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
We need to be able to test cases where a client tries to use a not-ready
image description. Turns out passing an fd for a directory fails just
the right way without triggering protocol errors.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Move all the parametric_cases definitions just above the TEST_P() using
them, to be close to the code that needs them.
While the diff might look odd, this is really just moving the one big
block of code verbatim.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
There may or may not be more case arrays, so rename these to hint
towards which test is using this.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is the program's new scope.
Also drop unnecessary dependencies, these were consolidated when color
management protocol helpers moved into the harness.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is the program's new scope.
Also drop unnecessary dependencies, these were consolidated when color
management protocol helpers moved into the harness.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
color-management-test will turn into image-description-query test, which
runs with an array of fixtures setting up different output image
descriptions, and checks the preferred and output image
description information.
The param test will test everything else non-screenshots that does not
need to iterate over different output image descriptions.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add the set_output function to weston_touch_device to allow touch binding
interfaces to re-assign the touch-to-output mapping.
Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
Add a signal for touch device creation to allow plugins to detect and
respond to touch device changes.
Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
When create_renderbuffer_dmabuf() fails and returns NULL, the previously
allocated linux_dmabuf_memory was leaked because pipewire_output_setup_dmabuf()
had already been called with no cleanup path.
Reorder the calls so that create_renderbuffer_dmabuf() is invoked first.
If it fails, explicitly destroy linux_dmabuf_memory and return early to
avoid the leak.
Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
The only legal way to destroy a cm_image_desc is to go through the
wl_resource destruction. Calling the function otherwise would have left
a dangling pointer in the resource. Let's not have the temptation to
"fix" that dangling pointer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Since "color: refactor cm_image_desc_create()" if cm_image_desc exists
then the cprof exists as well.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Previously, cm_image_desc_create() created the wl_resource, the
compositor object, and linked them together. Call sites that do not have
a ready-made color profile to use for it, had to call
cm_image_desc_create() with a NULL cprof. Then they would attempt to
create the cprof, and:
- if it succeeded, patch it into struct cm_image_desc;
- if it failed, release the cm_image desc and reset resource user data
to NULL.
Let's make this more straightforward by refactoring.
create_image_description_resource() creates the wl_resource and sets up
the implementation, but user data remains NULL. This is a common
operation done at all cm_image_desc_create() call sites.
link_image_description_resource() creates struct cm_image_desc and links
it to the resource via user data. This can only be called with a valid
cprof.
If anything fails, there is no need to back things out like before. The
sending of errors and 'ready' events is consolidated.
cm_image_desc->cprof is guaranteed to be non-NULL.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Convert the pointer surface coordinates to doubles so we can more readily
see what they mean.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Annotations give us a more generic way to incorporate flows into our
perfetto traces.
This will eventually let us remove some _FLOW() variants of our trace
macros.
It also lets us have multiple flows through the same function/annotation.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This should be variadic. Nothing uses it, so it hasn't broken yet,
but we're about to use it, so clean it up.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This hopefully isn't ridiculously heavy. The heavy part is committing the
flow array later, which is already gated by perfetto internally, so we
don't have to protect anything here ourselves.
This makes it easier to put flows in annotation arrays, because flows need
to be kept up to date even when not tracing.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This was supposed to early return after logging the NULL buffer, not
foolishly carry on and attempt to dereference it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This can turn into a NULL pointer dereference, and the values
aren't meaningful in this state anyway.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This includes an additional _double variant for _Generics and a bool
one.
Similarly, _WESTON_TRACE_ANNOTATE_FUNC_FLOW gets a _Generics macro variant
to handle the case were we have a integer flow ID, rather than an a
pointer.
Finally we always have a flow ID set when weston_input_event gets
initalized.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This basically starts tracking input event. From here on we can start
flow tracking the event until it exits and is being delivered to the
client.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
And with it include a dedicated track in Perfetto to display the event
timestamp on that a weston_seat. This includes support for timeline and
for timeline Perfetto.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Ever since 160394b2c3 we can have
perfetto flow ids in const structs.
We need to preserve the perfetto flow even when tracing is disabled -
a flow will start in a function that has non-const access to a struct,
but other functions further along the flow may only have const access.
Fix up "instant annotations" to preserve flows when not tracing, and to
reset the annotation count on commit when not tracing.
I suppose this also fixes a potential race where annotations aren't
properly reset if tracing is started and stopped multiple times during
the execution of a single function - but I can't imagine that being possible
to hit.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Update to Neat VNC 1.0.0 and aml 1.0.0, which promise stable API.
Adapt to API changes:
- authentication API now wraps username/password into
credentials and can be asynchronous
- userdata get/setters are now type specific
- fbs have been renamed to frames, storing dimensions and damage
- nvnc_open() is split into nvnc_new() and nvnc_listen_tcp()
- nvnc_close() is now nvnc_del()
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Probably copy-pasta. Noticed by gcc 15
../../git/weston/libweston/backend-x11/x11.c: In function ‘x11_backend_handle_event’:
../../git/weston/libweston/backend-x11/x11.c:1687:58: error: ‘key_release’ may be used uninitialized [-Werror=maybe-uninitialized]
1687 | key_release->detail - 8,
Fixes: 99527e6b92
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Similar to "input: Introduce weston_key_event struct" this struct is for
touch events. With this we add the initialization helpers, pass the
weston_touch_event as a const and remove the timespec argument.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
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>