Commit Graph

8825 Commits

Author SHA1 Message Date
Michael Olbrich
c30da2aa32 tests: ivi-shell: prepare for API simplification
The return values for most of the API functions will be removed and replaced by
asserts. So checking return values will no longer work and passing invalid
arguments will trigger asserts. Modify and remove the tests accordingly.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-04-19 09:38:09 +03:00
Bram Stolk
26de6e35a9 simple-dmabuf-v4l: Add support to NV12 devices that combine planes
There are V4L2 devices that will output NV12 but will do so using one dma
buffer. To support this, we need to add the same dma buffer twice but with
a different offset for the chrominance plane.
Also supports situations of 3 planes (e.g. YU12) inside a single dma buffer.

Fixes: #712
Signed-off-by: Bram Stolk (b.stolk@gmail.com)
2023-04-18 10:57:55 +00:00
Philipp Zabel
fe69b9f52e doc, man: document PipeWire backend
Add documentation for the PipeWire backend.

Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-04-18 10:48:50 +00:00
Philipp Zabel
ebc3a22b09 backend-pipewire: add PipeWire backend
Add a separate PipeWire backend based on the PipeWire plugin. The backend
requires PipeWire 0.3.x.

The PipeWire backend can be used as a standalone-backend backend for streaming
and composing Wayland clients to PipeWire.

The backend supports the on-demand creation of heads via the
weston_pipewire_output_api_v1. It also supports per-output pixel format
configuration via a gbm-format option.

Multiple PipeWire outputs can be created by setting the num-outputs option in
the [pipewire] section.

Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-04-18 10:48:50 +00:00
Michael Tretter
bcacd9ec5a backend-drm: schedule connector disable for detached head
Currently, if a head is detached, the entire state of the device is invalidated
to make sure that the connector is disabled on the next atomic commit. Side
effect of the invalid state is that all planes are disabled on the next commit.
This includes planes that are used with a different head that is not part of the
next atomic commit. Disabling the planes of unrelated outputs causes a blanking
of these outputs until output is repainted and the plane is reenabled.

Store the detached heads in a list on the output and disable the connectors for
all heads in this list in the next atomic commit.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-04-18 11:11:21 +02:00
Philipp Zabel
78818c6d24 backend-vnc: pass vnc_backend to vnc_head_create()
Pass the VNC backend to vnc_head_create().

That way the already known backend will not have to be found from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.

Also remove the now unused to_vnc_backend() helper.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-04-17 09:40:52 +02:00
Philipp Zabel
0a1d77a728 backend-rdp: pass rdp_backend to rdp_head_create()
Pass the RDP backend to rdp_head_create().

That way the already known backend will not have to be found from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.

Also remove the now unused to_rdp_backend() helper.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-04-17 09:40:52 +02:00
Philipp Zabel
7d2112c713 libweston: pass backend to weston_windowed_output_api::create_head()
Pass the backend instead of the compositor to the windowed output API
create_head() method and increment the API version.

That way the backend will not have to find the backend pointer from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-04-17 09:38:50 +02:00
Philipp Zabel
5dd796e447 backend-vnc: remove output move listener leftovers
The output move listener removal was incomplete. Remove the remaining
bits to fix a segfault on shutdown.

Fixes: 40f5eaf401 ("backend-vnc: use output power_state to disable repainting while disconnected")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-04-15 09:13:21 +02:00
Pekka Paalanen
eb2a12a92c xwayland: comment on cleanup_after_cairo()
I tried this, and it causes a crash. Leave a note for the future when we
happen to use some other backend with xwayland and find a "leak".

The reason this is a comment and not a Gitlab issue is that you probably
would not go looking for a Gitlab issue saying an idea is a bad one.
This comment is more likely to be found.

It's not really a leak either, it only needs to be fixed if you want a
clean ASan leak report.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-12 12:34:58 +00:00
Pekka Paalanen
741c9e6a99 backend-wayland: fully release pango and fontconfig
This was not found in the test suite, but if you run wayland-backend
manually with ASan, you see the same leaks as in

  backend-headless: fully release pango and fontconfig

Fix them the same way.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-12 12:34:58 +00:00
Pekka Paalanen
823580e070 backend-headless: fully release pango and fontconfig
In the color-icc-output test, this fixes the following ASan reports:

Direct leak of 6912 byte(s) in 27 object(s) allocated from:
    #0 0x7f36bf0a9e8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7f36bd9c2704  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20704)
    #2 0x7f36bd9c2dc8  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20dc8)
    #3 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #4 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #5 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #6 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #7 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #8 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #9 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #10 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #11 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #12 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #13 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #14 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #15 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #16 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #17 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #18 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #19 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #20 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #21 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #22 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #23 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #24 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #25 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #26 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #27 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #28 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #29 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #30 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #31 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #32 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #33 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #34 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #35 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #36 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #37 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #38 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #39 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #40 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #41 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #42 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #43 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #44 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #45 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #46 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #47 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #48 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #49 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

Indirect leak of 1696 byte(s) in 53 object(s) allocated from:
    #0 0x7f36bf0aa037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f36bd9c2d48  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d48)
    #2 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #3 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #4 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #5 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #6 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #7 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #8 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #9 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #10 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #11 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #12 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #13 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #14 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #15 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #16 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #17 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #18 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #19 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #20 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #21 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #22 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #23 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #24 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #25 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #26 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #27 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #28 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #29 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #30 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #31 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #32 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #33 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #34 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #35 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #36 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #37 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #38 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #39 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #40 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #41 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #42 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #43 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #44 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #45 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #46 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #47 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #48 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

Indirect leak of 537 byte(s) in 52 object(s) allocated from:
    #0 0x7f36bf057817 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:452
    #1 0x7f36bd9c1fa4 in FcValueSave (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1ffa4)
    #2 0x7f36bd9c2d5d  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d5d)
    #3 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #4 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #5 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #6 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #7 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #8 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #9 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #10 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #11 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #12 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #13 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #14 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #15 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #16 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #17 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #18 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #19 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #20 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #21 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #22 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #23 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #24 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #25 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #26 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #27 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #28 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #29 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #30 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #31 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #32 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #33 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #34 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #35 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #36 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #37 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #38 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #39 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #40 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #41 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #42 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #43 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #44 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #45 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #46 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #47 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #48 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #49 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

SUMMARY: AddressSanitizer: 9145 byte(s) leaked in 132 allocation(s).

We do the clean-up unconditionally because xwayland plugin may also need
it, but cannot easily do it itself. This reduces reported leaks in
xwayland test too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-12 12:34:58 +00:00
Philipp Zabel
40f5eaf401 backend-vnc: use output power_state to disable repainting while disconnected
With weston_output_power_on/off() we can use power_state to disable
repainting completely while no VNC client is connected. This allows
to remove the initial repaint and per-output damage tracking.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-04-12 14:44:13 +03:00
marius vlad
1446d9cb3c client-shm: Add basic keyboard support
And use it to exit with using the KEY_ESC, similar to simple-egl.
This was ripped from simple-egl ad litteram.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-12 14:40:38 +03:00
marius vlad
2e0b67e5be simple-shm: Add maximized/fullscreen support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-12 14:40:38 +03:00
marius vlad
cd634c34ed simple-shm: Use buffers as a list
Rather than having them as an array. This would simplify handling of
maximized and fullscreen and make things easier to reason with.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-12 14:40:38 +03:00
Marius Vlad
76f689e370 simple-touch: Add maximized/fullscreen states
Helpful to have other states like maximized or fullscreen for
the simple-touch client.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-12 14:40:38 +03:00
Daniel Stone
c7a29b5196 tests: Allow DRM fixture setup to cleanly skip
Move our DRM test fixture setup later, where we already have a bunch of
per-backend splits, so we can choose to skip our tests at the right
time.

Doing this allows us to skip DRM tests with no memory leaks.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-12 10:52:57 +00:00
Daniel Stone
3ae62c208c tests: Move prog_args_save() later
This allows us to append to the arguments later on.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-12 10:52:57 +00:00
Daniel Stone
03add7dce5 input: Destroy tablet-tool bindings on exit
Make sure we don't leak any tablet tool bindings.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-12 10:10:25 +00:00
Leandro Ribeiro
a62cb45b6e tests/color-icc-output: make use of color debug scopes
Now that we have color profile, transformation and optimizer debug
scopes, make use them in this test.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-04-12 10:03:32 +00:00
Leandro Ribeiro
84eb3158b4 color-lcms: add debug scope for pipeline optimizer
Whenever a color transformation is being created, this debug scope
prints its pipeline before and after being optimized. It should be used
with the color-lcms-transformations scope.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-04-12 10:03:32 +00:00
Leandro Ribeiro
a28e0c26e1 color-lcms: add debug scope for color profiles
It prints the existent color profiles for new subscribers. Also prints
any creation/destruction of color profiles.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-04-12 10:03:32 +00:00
Leandro Ribeiro
d827bdd5d4 color-lcms: add debug scope for color tranformations
It prints the existent color transformations for new subscribers. Also
prints any creation/destruction of color transformations.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-04-12 10:03:32 +00:00
Leandro Ribeiro
cb542dd56a color-lcms: save ICC profile version string with a single decimal value
We have a string describing the ICC profile. cmsGetProfileVersion()
returns a float value, and we are converting that to string with "%f"
and saving to this description. Instead, use "%.1f" to restrict it to a
single decimal value, which is enough. With this change we have e.g.
"version 4.4" instead of "version 4.4000000".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-04-12 10:03:32 +00:00
Pekka Paalanen
8a1f56310c compositor: free renderer string
Fixes a leak found by ASan.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-11 17:48:15 +03:00
Pekka Paalanen
21f2fb99d5 tests: do not leak renderer argument
Noticed by ASan. The strdup() is not necessary, str_printf() returns an
allocated string.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-11 17:43:14 +03:00
Vitaly Prosyak
712fd0f576 color-lcms: Fix memory leak in join_curvesets
LCMS API cmsStageAllocToneCurves uses cmsDupToneCurve which internally
re-allocates a new table of points. As a result, we have to free the old
table returned from lcmsJoinToneCurve.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2023-04-11 14:26:30 +00:00
Daniel Stone
052e63eecf input: Fix uint/enum declaration mismatch
We were declaring that the binding handler took an enum in the
declaration (good!), but then using a uint in the definition (oops).

cf. wayland/weston!1205

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-11 11:44:34 +00:00
Marius Vlad
a991691eee desktop-shell: Do not attempt to change the state
Upon connector reconnect/disconnect we seem to ignore any kind of window
state we might have previously to disconnect so this takes that into
account and avoids a change in the state in case we detect one set-up
previously.

Fixes: #731

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-11 11:26:24 +00:00
Daniel Stone
27617ec937 drm: Fix type confusion in writeback_state
wl_array_for_each() returns a pointer to each storage location; as we're
storing a pointer to drm_fb, this means that we have a drm_fb **, not a
drm_fb *.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-04 11:30:52 +00:00
marius vlad
82dbb606a2 libweston: Skip setting DPMS if output is not enabled
With the output not being enabled, there's no way we can actually
manipulate its DPMS state.

Signed-off-by: marius vlad <marius.vlad@collabora.com>
2023-04-04 08:13:58 +00:00
marius vlad
70004a7edc libweston: Set default power state at output initialization
Rather than setting the initial power state when adding
it (using weston_compositor_add_output), do that at the initilization
stage.

Reason being that the compositor can set up the output from the start as
FORCED_OFF, before enabling the output, rather than enabling the output
and then turning off the power of the output.

Signed-off-by: marius vlad <marius.vlad@collabora.com>
2023-04-04 08:13:58 +00:00
marius vlad
9b1b95ca76 libweston: Damage the output after the output has been added
Rather than damaging the output before the output has been added with
weston_compositor_add_output, do that afterwards as to avoid scheduling
a repaint for that output *before* actually adding the output.

This would avoid the awkward case where we attempt to set initial power
state to normal, but we can't apply it at that stage.

Signed-off-by: marius vlad <marius.vlad@collabora.com>
2023-04-04 08:13:58 +00:00
Daniel Stone
6f9c27ac07 input: Consistently use enums for modifier/axis/state
For some reason we'd managed to have a mismatching header prototype and
implementation. Fix this up to consistently use enums everywhere.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-04-03 20:58:06 +03:00
Loïc Molinari
7c9c545b4e gl-renderer: Get rid of begin fence sync
Output repaint uses a pair of fence syncs to profile GPU execution by
retrieving their timestamps once signalled. While the end timestamp
can be rather inaccurate in some cases (drivers reusing sync objects
from previous command buffers), the begin timestamp is never correct
because fence syncs are signalled on command buffer completion.

Get rid of the begin fence sync and use the EXT_disjoint_timer_query
extension to measure the actual repaint duration and extrapolate the
begin timestamp from the end one.

Fixes #342

Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
2023-04-03 09:52:36 +02:00
Michael Olbrich
14fc87cc42 clients/window: dismiss window on tablet tool up events
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
6d3d98851e libweston-desktop: implement tablet tool grab
This is needed for correct focus handling when xdg popups are opened.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Lyude Paul
0b0c6e7ad7 clients: Add demo application for tablets
Note that this application does not follow best practices for handling tablet
events. The events are grouped by frame, all processing should be done in the
frame instead of the respective handler.

A good toolkit would accumulate the data in the events and provide them as one
event to the actual client once the frame is received. toytoolkit just hooks
up the handler one-by-one, so we're doing this here as well.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
9eab270de5 tablet: Add binding to activate surfaces using the tablet tool
Based on patches from:
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Bastian Farkas <bfarkas@de.adit-jv.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Lyude Paul
017eac1a6b clients/desktop-shell: Add tablet support to the top panel of the desktop shell
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Lyude Paul
6a06669b58 clients: Add support for tablet cursor motion to window frames in libtoytoolkit
When it comes to a window frame, a tablet tool and cursor act almost
identical; they click things, drag things, etc. The tool type and extra
axes don't serve any use in the context of a window frame, so tablet
pointers share the frame_pointer structures used for the mouse pointer.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Lyude Paul
0ced0c62ee clients/window: Add tablet cursor support into libtoytoolkit
Again, a lot of this is code that has been reused from the cursor code
for pointers.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
76ada6fe04 clients/window: add support for handling tablets
Based on a patch from:
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
818c1c275c libweston: handle tablet cursors in the compositor
The tablet is given a separate cursor. Most tablet interaction is an absolute
interaction and shouldn't need a cursor at all, but usually the cursor is used
to indicate the type of virtual tool currently assigned.

Based on patches from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Bastian Farkas <bfarkas@de.adit-jv.com>
Maniraj Devadoss <Maniraj.Devadoss@in.bosch.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
ce99b181a3 libinput: hook up tablet events
Based on a patches from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
578922797b input: add weston grab interfaces for tablet tools
Based on a patch from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
d24af43233 input: add tablet focus handling
Closely modelled after the pointer focus handling

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>

Based on a patch from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Michael Olbrich
03596a9d06 libweston: Add initial tablet support to weston
Introduces three new structs, weston_tablet and weston_tablet_tool for the
respective devices, with the respective information as it's used on the protocol.
And weston_tablet_tool_id to track the tools of a tablet.

Note that tools are independent of tablets, many tools can be used across
multiple tablets.

The nesting on the protocol level requires a global tablet manager, a tablet
seat nested into weston_seat. The list of tablets and tools are also part of
the weston_seat.

Most functions are stubs except for the actual tablet and tablet tool
creation and removal.

This is based on patches from Peter Hutterer <peter.hutterer@who-t.net> and
Bastian Farkas <bfarkas@de.adit-jv.com>.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2023-03-31 12:10:26 +00:00
Leandro Ribeiro
f95c2986dd drm: allow to skip composition if pending capture is writeback
We have an optimization to skip composition if there's no damage on the
primary plane and we already have a renderer buffer active. But we don't
allow this optimization if there's a pending capture task for the
output. For the renderer-based sources, that is really necessary, but
for the writeback source we should allow this optimization.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-03-31 10:36:31 +00:00