Commit graph

10295 commits

Author SHA1 Message Date
Robert Mader
e187420e38 output-capture: Fix protocol event order
The new formats_done event has to be at the end, triggering warnings
like the following otherwise:

warning: since version not increasing

Fixes: 00902a592 (output-capture: Allow multiple formats and add formats_done event)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 17:53:59 +02:00
Robert Mader
b6c1bc872e output-capture: Fix assertions in pull_capture_task()
Fixes: 9ea205e00 (output-capture: Support writeback connector formats)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 17:51:22 +02:00
Pekka Paalanen
be71b5a094 color-lcms: compare parameters with tolerance
Comparing floating-point values for identity is fragile. Comparaing with
a small tolerance allows for matches that differ only due to numerical
precision of computations.

The tolerance is taken from
weston_color_tf_info_from_parametric_curve().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Pekka Paalanen
d7030571c5 frontend,color: print details of the set color profile
It is nice to see the numbers of a parametric color profile when created
from CTA or EDID or just to cross-check with weston.ini.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Pekka Paalanen
daec4a0994 color: print name of unsupported TF
Helps debugging when you have the name rather than a number.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Pekka Paalanen
f3badf2c2d color: introduce struct weston_color_tf
At first I wanted to wrap

	float tf_params[MAX_PARAMS_TF]

into a struct, so that it would become type-safe to pass into functions,
and it could be copied with a simple assignment. Then I noticed that for
tf_params to be operable, it must always be accompanied by struct
weston_color_tf_info. Hence, struct weston_color_tf was born.

The need for #define MAX_PARAMS_TF got eliminated.

Because struct weston_color_tf is a member of struct
weston_color_profile_params, now both need to not contain implicit
padding.

This patch makes the internal enumerated TF structures follow the
current protocol requests: all color channels use the same curve.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Pekka Paalanen
7b5053f7fa color: drop weston_color_curve_from_tf_info()
This was never used, and I happened to write a slightly different
version of it in color-lcms.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Pekka Paalanen
bcfa2724d2 color-lcms: fix TF_POWER from type 1 inverse
Forgotten early return. Without it, the code continues to set up LINPOW
instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-09-25 18:03:31 +03:00
Marius Vlad
bcb7676ed7 backend-drm: Add some further debug message for hot-plug events
And also for connector changes. This would allow tracking hot-plug
events from the udev/kernel and figure out that connector properties
changed.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-25 14:07:48 +01:00
Marius Vlad
fdb43447a2 backend-drm: Explicitly set an invalid state
A infinitesimal short-flip in HDMI HDP in-out (hot-plug event) would
cause a discrepancy between kernel's connector's state and Weston
connector state resulting in kernel and Weston disagreeing on the final
connector state.

This has the undesired effect where the output would never turn on when
this short burst of HDP events come through.

To avoid that, just set the device invalid_state as true to go through a
modeset.  Also, schedule a repaint when that happens to go through a
repaint.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-25 14:07:48 +01:00
Marius Vlad
794c1eb490 backend-drm: Allow to pass connector ID
This way we can differentiate when we get a HOTPLUG event that gave us a
CONNECTOR ID to work with.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-25 14:07:48 +01:00
Marius Vlad
aa04d9d4ad backend-drm: Refactor drm_backend_update_connectors
This splits drm_backend_update_connectors into
drm_backend_update_connector and a post destroy phase/function.

There's no functional change, but this allows to pass
drm_backend_update_connector() on its own as we'll need that.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-25 14:07:48 +01:00
Robert Mader
b6f890d249 clients: screenshot: Allow selecting format and capture source
Add support for using writeback connectors as source. Those potentially
support more than one format, thus allow selecting those as well.
While on it, add a verbose flag for useful debug output.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 12:39:26 +02:00
Robert Mader
9ea205e007 output-capture: Support writeback connector formats
Writeback connectors often support multiple formats, fully independent
of the input framebuffer. Wire up support for querying formats and send
them to clients.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 12:39:23 +02:00
Robert Mader
07a5ec8157 output-capture: Add output_get_writeback_formats helper
And implement it in the DRM backend. This will be used by the next
commit.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 11:26:21 +02:00
Robert Mader
00902a5921 output-capture: Allow multiple formats and add formats_done event
The writeback output capture source may allow clients to select from
multiple possible formats. Update the protocol and its users
accordingly, and add formats_done event, making the implementation
easier and following common protocol practice.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-25 11:26:16 +02:00
Robert Mader
967537d525 backend-drm: Populate writeback formats with modifier
The writeback connector UAPI does not mention modifiers explicitly,
however implicitly we assume and use a linear modifier when using
dumb buffers.

Adding that to the format thus makes the assumption more obvious and
allows us to use the weston_drm_format_array as intended.
For example we can now use weston_drm_format_array_count_pairs() to
log the number of supported formats - previously it always returned 0.

See
https://www.kernel.org/doc/html/v6.16/gpu/drm-kms.html#writeback-connectors

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-22 12:25:31 +02:00
Robert Mader
3706d860f1 backend-drm/kms: Log writeback connector format
So it becomes easy to check in test output or when running
`weston-debug drm-backend`.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-22 12:25:31 +02:00
Erico Nunes
042aa06b28 vulkan-renderer: fix gbm_bo destroy in drm backend
Create a linux_dmabuf_memory subclass so that it holds the associated
gbm_bo and it can be properly destroyed with the dmabuf object.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-22 10:12:33 +02:00
Erico Nunes
b0c99998ef vulkan-renderer: drop fb get from create_renderbuffers
This is not required and creates a refcount imbalance,
causing a memory leak at drm-backend teardown.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-22 10:12:33 +02:00
Erico Nunes
41823d237b vulkan-renderer: remove unused allocation in renderbuffer dmabuf
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-22 10:12:33 +02:00
Leandro Ribeiro
3026c44897 test: add color-effects test
Follow-up of "color: introduce output color effects". This adds a few
sanity tests for color effects.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-18 12:32:15 -03:00
Leandro Ribeiro
6fe0cfc2b8 color: introduce output color effects
Output color effects are applied to the whole output scenegraph. It
depends on color-management being disabled, as the color effects are
applied in sRGB content.

For now we added only a few accessibility options: color inversion,
deuteranopia, protanopia and tritanopia CVD correction.

Note that surfaces presented on outputs that contains a color effect
can't be used for direct scanout (i.e. bypass composition and offloading
to KMS overlay planes). The color effect is applied in our GL-renderer.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-18 12:32:13 -03:00
Derek Foreman
1a9cf3bfb6 compositor: Fix output reflowing when mirroring is in use
When we have a mirror, it will be at the same x,y position as the output
it's mirroring. On hot unplug, the current logic results in the mirroring
output being moved to the left by the width of its target output. The
mirror will then be destroyed, and the views can be left dangling outside
of usable space when a hot plug restores the outputs.

Subtly change the reflow logic to only reflow outputs to the right of the
removed output by testing co-ordinates, instead of assuming that every
output in the list is to the right of the previous.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-09-17 11:39:03 +00:00
Derek Foreman
a38cc9982b drm: Add more failure reasons that we can't use the scanout tranche for
Now that FAILURE_REASONS_FORCE_RENDERER isn't set for all not-scanout
capable failures, add some other reasons to the test in
dma_feedback_maybe_update.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-09-16 12:25:15 -05:00
Erico Nunes
6f1d9cdffd backend-drm: fix vulkan output init format
The default output format setting to the backend format was removed and
renderer-specific format picking functions were introduced, but one was
not included for vulkan-renderer.
Vulkan-renderer doesn't yet implement color management features which
would benefit from a full featured format selection here, so for now
just have a base implementation which restores the previous behavior.
This fixes the introduced segfault with vulkan-renderer and drm-backend.

Fixes: 56c27ea2 ("backend-drm: improve code that chooses output->format")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-16 07:39:20 +00:00
Leandro Ribeiro
39108501b3 libweston: make use of some of the new weston assert
We didn't have many Weston assert macros in place, but now we do.

Make use of a few of the newer macros where they make sense. No big
difference, but just to exercise using the correct ones now that they
exist.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-15 19:16:17 -03:00
Leandro Ribeiro
6d8a15839d shared: add many weston assert that were missing
This adds a ton of weston assert macros that were missing, as well as
tests for all of that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-15 19:14:00 -03:00
Leandro Ribeiro
81d68a561e shared: few cosmetic changes to weston assert file
Rename parameter "compositor" to "comp", allowing us to have one-line
macros that makes the file easier to read. Also moves a few macros
to other parts of the file.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-15 19:13:50 -03:00
Leandro Ribeiro
a4cefa69a2 shared: rename a few weston assert
Currently weston-test-assert.h has a better naming style than
weston-assert.h: more concise and standardized.

So let's copy the same style to weston-assert.h

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-09-15 19:13:04 -03:00
Elliot Chen
b268b3827c backend-pipewire: support frame rate configuration
Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
2025-09-15 08:20:52 +00:00
Erico Nunes
1a68480421 backend-drm: use dmabuf renderbuffer for Vulkan
The initial drm backend implementation for Vulkan passes display device
allocated gbm bos directly to the renderer. This is a bit awkward since
it requires the renderer to maintain a custom output creation interface
and another code path for importing specifically gbm bos.
Since then, vulkan-renderer received support to use dmabuf renderbuffers
to support e.g. pipewire dmabuf, in an interface which is also common
with gl-renderer.
The dmabuf renderbuffer code path is similar to what the drm backend
implementation intended to do, so we can unify it to a single interface.
This has the advantages of requiring one less custom output creation
interface, as well as the renderer being able to handle the drm backend
through a single shared dmabuf renderbuffer path.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-12 18:04:57 +01:00
Erico Nunes
aff309fa9f vulkan-renderer: rename output options to surface/surfaceless
The fbo naming inherited from gl-renderer is confusing, and now it
is used in many places.
Rename the two options for output creation to surface and surfaceless
to hopefully make them more meaningful.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-12 18:04:57 +01:00
Erico Nunes
dfad00e8c4 backend-drm: Refactor drm_fb_get_from_dmabuf_attributes
So that it can be used with other dmabuf objects other than
linux_dmabuf_buffer.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-12 18:04:57 +01:00
Marius Vlad
d2cf5a7ba5 frontend: Explicitly add a check for printing warning
Fixes a minor issue with 28bdcb46be ("frontend: Log when exiting due to
insufficient active outputs") to only print that we have
no outputs enabled but we're allowed to continue when we actually get to
that scenario.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 15:06:22 +01:00
Marius Vlad
208157f2e4 weston-test: Handle missing layer fini on shutdown path
BUG: layer_list is not empty after shutdown. Calls to
weston_layer_fini() are missing somwhere

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 14:46:43 +01:00
Marius Vlad
41bef3caaa weston-test: Fix another mem leak on shutdown path
Fixes the following mem leak:

=================================================================
==191==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7f6b843f6610 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f6b8302f499 in output_created_listener ../tests/weston-test.c:145
    #2 0x7f6b83032dcd in wet_module_init ../tests/weston-test.c:857
    #3 0x7f6b842b8425 in wet_load_module ../frontend/main.c:989
    #4 0x7f6b842b89eb in load_modules ../frontend/main.c:1069
    #5 0x7f6b842d2711 in wet_main ../frontend/main.c:4865
    #6 0x562862e934d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #7 0x562862e9756b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #8 0x562862e81e1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #9 0x562862e81e9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #10 0x562862e97bb6 in main ../tests/weston-test-runner.c:726
    #11 0x7f6b83d33ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 14:46:43 +01:00
Marius Vlad
02a6e45ce5 weston-test: Fix mem leak on shutdown path
Fixes the following memory leak:

=================================================================
==191==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7f18bfa83610 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f18bf890191 in zalloc ../include/libweston/zalloc.h:38
    #2 0x7f18bf89184c in weston_log_ctx_add_log_scope ../libweston/weston-log.c:631
    #3 0x7f18bf891c2c in weston_compositor_add_log_scope ../libweston/weston-log.c:696
    #4 0x7f18be524ef6 in wet_module_init ../tests/weston-test.c:864
    #5 0x7f18bf945425 in wet_load_module ../frontend/main.c:989
    #6 0x7f18bf9459eb in load_modules ../frontend/main.c:1069
    #7 0x7f18bf95f711 in wet_main ../frontend/main.c:4865
    #8 0x557b36c114d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #9 0x557b36c1556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #10 0x557b36bffe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #11 0x557b36bffe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #12 0x557b36c15bb6 in main ../tests/weston-test-runner.c:726
    #13 0x7f18bf3c0ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7f18bfa83610 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f18be521499 in output_created_listener ../tests/weston-test.c:145
    #2 0x7f18be524dcd in wet_module_init ../tests/weston-test.c:857
    #3 0x7f18bf945425 in wet_load_module ../frontend/main.c:989
    #4 0x7f18bf9459eb in load_modules ../frontend/main.c:1069
    #5 0x7f18bf95f711 in wet_main ../frontend/main.c:4865
    #6 0x557b36c114d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #7 0x557b36c1556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #8 0x557b36bffe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #9 0x557b36bffe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #10 0x557b36c15bb6 in main ../tests/weston-test-runner.c:726
    #11 0x7f18bf3c0ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 33 byte(s) in 1 object(s) allocated from:
    #0 0x7f18bfa7dd60 in strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f18bf8918ed in weston_log_ctx_add_log_scope ../libweston/weston-log.c:639
    #2 0x7f18bf891c2c in weston_compositor_add_log_scope ../libweston/weston-log.c:696
    #3 0x7f18be524ef6 in wet_module_init ../tests/weston-test.c:864
    #4 0x7f18bf945425 in wet_load_module ../frontend/main.c:989
    #5 0x7f18bf9459eb in load_modules ../frontend/main.c:1069
    #6 0x7f18bf95f711 in wet_main ../frontend/main.c:4865
    #7 0x557b36c114d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #8 0x557b36c1556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #9 0x557b36bffe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #10 0x557b36bffe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #11 0x557b36c15bb6 in main ../tests/weston-test-runner.c:726
    #12 0x7f18bf3c0ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 14:46:43 +01:00
Marius Vlad
7722b9f443 weston-test: Remove output_destroyed_listener listener on shutdown path
Fixes the following UAF:

==191==ERROR: AddressSanitizer: heap-use-after-free on address 0x518000000360 at pc 0x7f1ee142f5df bp 0x7ffe60aaf010 sp 0x7ffe60aaf008
READ of size 8 at 0x518000000360 thread T0
    #0 0x7f1ee142f5de in output_destroyed_listener ../tests/weston-test.c:166
    #1 0x7f1ee25f08eb in wl_signal_emit_mutable ../src/wayland-server.c:2401
    #2 0x7f1ee274c7f8 in weston_compositor_remove_output ../libweston/compositor.c:7877
    #3 0x7f1ee274fa92 in weston_output_release ../libweston/compositor.c:8641
    #4 0x7f1ee146e5f8 in drm_output_destroy ../libweston/backend-drm/drm.c:2626
    #5 0x7f1ee27552df in weston_compositor_shutdown ../libweston/compositor.c:9941
    #6 0x7f1ee2756a89 in weston_compositor_destroy ../libweston/compositor.c:10369
    #7 0x7f1ee286bed8 in wet_main ../frontend/main.c:4934
    #8 0x56113c4244d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #9 0x56113c42856b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #10 0x56113c412e1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #11 0x56113c412e9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #12 0x56113c428bb6 in main ../tests/weston-test-runner.c:726
    #13 0x7f1ee22ccca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #14 0x7f1ee22ccd64 in __libc_start_main_impl ../csu/libc-start.c:360
    #15 0x56113c412860 in _start (/home/mvlad/vkms/weston/b/tests/test-drm-writeback-screenshot+0xe860) (BuildId: 9f9e2ed12b9317dd859498374500f2406c32e5d3)

0x518000000360 is located 736 bytes inside of 792-byte region [0x518000000080,0x518000000398)
freed by thread T0 here:
    #0 0x7f1ee298e8f8 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x7f1ee1433002 in wet_module_init ../tests/weston-test.c:882
    #2 0x7f1ee2851425 in wet_load_module ../frontend/main.c:989
    #3 0x7f1ee28519eb in load_modules ../frontend/main.c:1069
    #4 0x7f1ee286b711 in wet_main ../frontend/main.c:4865
    #5 0x56113c4244d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #6 0x56113c42856b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #7 0x56113c412e1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #8 0x56113c412e9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #9 0x56113c428bb6 in main ../tests/weston-test-runner.c:726
    #10 0x7f1ee22ccca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

previously allocated by thread T0 here:
    #0 0x7f1ee298f610 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f1ee142edc5 in zalloc ../include/libweston/zalloc.h:38
    #2 0x7f1ee1432cba in wet_module_init ../tests/weston-test.c:840
    #3 0x7f1ee2851425 in wet_load_module ../frontend/main.c:989
    #4 0x7f1ee28519eb in load_modules ../frontend/main.c:1069
    #5 0x7f1ee286b711 in wet_main ../frontend/main.c:4865
    #6 0x56113c4244d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #7 0x56113c42856b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #8 0x56113c412e1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #9 0x56113c412e9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #10 0x56113c428bb6 in main ../tests/weston-test-runner.c:726
    #11 0x7f1ee22ccca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 14:46:43 +01:00
Marius Vlad
5af8340a00 weston-test: Proper release pointer/seat on shutdown path
For fixing the following UAF.

==191==ERROR: AddressSanitizer: heap-use-after-free on address 0x518000000168 at pc 0x7f7aac77493e bp 0x7ffdd9dddc00 sp 0x7ffdd9dddbf8
READ of size 8 at 0x518000000168 thread T0
    #0 0x7f7aac77493d in udev_input_destroy ../libweston/libinput-seat.c:388
    #1 0x7f7aac73e632 in drm_shutdown ../libweston/backend-drm/drm.c:3623
    #2 0x7f7aad9208b8 in weston_compositor_shutdown_backends ../libweston/compositor.c:10337
    #3 0x7f7aad920a7d in weston_compositor_destroy ../libweston/compositor.c:10367
    #4 0x7f7aada35ed8 in wet_main ../frontend/main.c:4934
    #5 0x561e808014d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #6 0x561e8080556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #7 0x561e807efe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #8 0x561e807efe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #9 0x561e80805bb6 in main ../tests/weston-test-runner.c:726
    #10 0x7f7aad496ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #11 0x7f7aad496d64 in __libc_start_main_impl ../csu/libc-start.c:360
    #12 0x561e807ef860 in _start (/home/mvlad/vkms/weston/b/tests/test-drm-writeback-screenshot+0xe860) (BuildId: 9f9e2ed12b9317dd859498374500f2406c32e5d3)

0x518000000168 is located 232 bytes inside of 792-byte region [0x518000000080,0x518000000398)
freed by thread T0 here:
    #0 0x7f7aadb588f8 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x7f7aac3f2f9d in wet_module_init ../tests/weston-test.c:878
    #2 0x7f7aada1b425 in wet_load_module ../frontend/main.c:989
    #3 0x7f7aada1b9eb in load_modules ../frontend/main.c:1069
    #4 0x7f7aada35711 in wet_main ../frontend/main.c:4865
    #5 0x561e808014d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #6 0x561e8080556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #7 0x561e807efe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #8 0x561e807efe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #9 0x561e80805bb6 in main ../tests/weston-test-runner.c:726
    #10 0x7f7aad496ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

previously allocated by thread T0 here:
    #0 0x7f7aadb59610 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f7aac3eedc5 in zalloc ../include/libweston/zalloc.h:38
    #2 0x7f7aac3f2c55 in wet_module_init ../tests/weston-test.c:836
    #3 0x7f7aada1b425 in wet_load_module ../frontend/main.c:989
    #4 0x7f7aada1b9eb in load_modules ../frontend/main.c:1069
    #5 0x7f7aada35711 in wet_main ../frontend/main.c:4865
    #6 0x561e808014d6 in execute_compositor ../tests/weston-test-fixture-compositor.c:431
    #7 0x561e8080556b in weston_test_harness_execute_as_client ../tests/weston-test-runner.c:570
    #8 0x561e807efe1d in fixture_setup ../tests/drm-writeback-screenshot-test.c:48
    #9 0x561e807efe9e in fixture_setup_run_ ../tests/drm-writeback-screenshot-test.c:50
    #10 0x561e80805bb6 in main ../tests/weston-test-runner.c:726
    #11 0x7f7aad496ca7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

This would be caused by not being able to compile keymaps.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-09-12 14:46:43 +01:00
Derek Foreman
658f66216a drm: Fix crash on hardware without cursor planes
In a2a6030902 I introduced a crash when no
cursor plane exists. Fix this by pulling the cursor plane tests into their
own function and doing an early return when we have a conclusive no-cursor
failure state.

Fixes a2a6030902
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-09-10 13:26:12 -05:00
Robert Mader
67de2a1967 tests: drm-smoke: Stop hardcoding output name to Virtual-1
On certain setups - notably virtual machines - the output name can
be already taken (by e.g. virtio).
Given that we only use a single output for the test, do what other
tests do and don't assume any name.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-09 14:03:26 +02:00
Robert Mader
516e86222f gitlab-ci: Bump Mesa to 25.2.2
Notably including
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35915
which is needed for some upcoming MRs.
Returning to a proper release also makes it easier to understand
what we are testing against.

Mesa 25.2 requires Meson >= 1.4 and libX11 >= 1.8. The later requires
autoconf >= 2.70.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-09 11:14:41 +02:00
Robert Mader
68d036e2b1 gitlab-ci: Collapse Vulkan-Headers installation
Fixes: 7bc103e5a (gitlab-ci: Build Vulkan-Headers for CI)

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-09 11:14:41 +02:00
Erico Nunes
811edc0a8c tests/client-buffer: Update Vulkan format mustpass list for CI
Now that new formats are supported by the Vulkan renderer, update
this list to match our driver in CI for a more reasonable coverage.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Erico Nunes
f42ccf2140 vulkan-renderer: Add query to populate shm formats
Remove the limited shm formats hardcoded list and add a query to
populate them according to the device.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Erico Nunes
9341192f51 vulkan-renderer: Drop dmabuf format print
These are fairly noisy now especially with more formats being added.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Erico Nunes
6d20e480a0 pixel-formats: Update Vulkan formats
Update list of Vulkan equivalent of the DRM formats.
Fix some format information to account for endianness according
to the "DRM pixel format guide".

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Erico Nunes
fef0de7d72 pixel-formats: Use a single __BYTE_ORDER macro name
This file used both __BYTE_ORDER and __BYTE_ORDER__ which could become
confusing to inspect.
Both appear to be valid, since it is being compared to __LITTLE_ENDIAN
stick to __BYTE_ORDER for all uses.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Erico Nunes
8c9f395c6c vulkan-renderer: refactor extensions to extension table
Define extension tables for all extensions that are potentially used,
and use that to enumerate and request extensions which will be used.
This allows for a bitset to hold supported extensions and makes it
less cumbersome to define new ones to use later, as well as requiring
less traversing of the extension string list to decide which extensions
to request.
This also fixes some missing dependency issues which could trigger
validation errors on some drivers with limited extension support.
It also allows some code paths that didn't require some specific
extensions that were in the default list before, by checking for
those in the code path that actually uses them at runtime.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00