Replace TEST() and TEST_P() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() and TEST_P() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST_P() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST_P() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace TEST() macros with explicit static functions and
DECLARE_TEST_LIST() registration for better type safety and to
prepare for removing the custom ELF section.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is a step towards getting rid of the __start_test_section and
__stop_test_section usage. The old macros assumed that all individual
variables assigned to the test section would be packed there as if in an
array. Mostly this seemed to work, too, with some magical alignment
fixes in the past. It was not guaranteed to work.
With the new test listing macros, we collect an actual array. The
drawback is that we need to mention all the test entry points explicitly
and they look like normal functions in the code - which they now are.
Their argument typing is safe, and their arguments are explicitly
visible. We rely on the compiler to complain about unused functions if
any entry point is forgotten from the array.
The array is still put into the test section, because this seems to be
the only feasible way of letting the harness code support both the old
and new test listing macros at the same time. This allows converting
each test program individually.
TESTFN_ARG() needs an explicit cast on the function pointer type,
because the data argument pointer type will not match const void*.
As an example of using the new macros, linalg-test.c is converted.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
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>