summaryrefslogtreecommitdiff
path: root/libweston
Commit message (Collapse)AuthorAgeFilesLines
* libweston: consolidate 'Using GL/Pixman renderer' log messagePhilipp Zabel2023-05-045-5/+4
| | | | | | | | | | | | Consolidates the 'Using GL/Pixman renderer' message emitted by the PipeWire, RDP, VNC, and X11 backends by moving the weston_log() into weston_compositor_init_renderer(). Only print the message after initializing the renderer has succeeded. This effectively adds the message to the DRM, headless, and Wayland backends. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* backend-drm: drop HDR without libdisplay-infoPekka Paalanen2023-04-281-2/+2
| | | | | | | | | | | Hardcode the ad hoc EDID parser to always claim that only SDR is supported. Even though libdisplay-info is not yet asked for HDR capabilities, it shall be the only way to see them. To be nicer to experimenters, main.c adds a note that you really need libdisplay-info if you want to play with HDR. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* backend-drm: use libdisplay-infoPekka Paalanen2023-04-282-0/+48
| | | | | | | | | | | | Add libdisplay-info as a better alternative for parsing EDID. This way we do not need to extend Weston's ad hoc parser for new things that especially HDR support requires. Eventually the ad hoc parser will be deleted and libdisplay-info becomes a hard dependency for the drm-backend, reducing our maintenance burden. Unlike the ad hoc code, libdisplay-info has automated CI testing. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* backend-drm: add drm_head_info_from_edid()Pekka Paalanen2023-04-281-14/+24
| | | | | | | | | | Move the ad hoc filling code into a separate function. Then we can easily add an alternative implementation of the new function using libdisplay-info without messing up the code any more than necessary. Pure refactoring. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* backend-drm: move struct drm_edid definitionPekka Paalanen2023-04-282-7/+7
| | | | | | | Now that this is used only internally in modes.c, move it there. It will not be used with libdisplay-info. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* backend-drm: let EDID parser return malloc'd stringsPekka Paalanen2023-04-282-35/+46
| | | | | | | | | | | This will make adding libdisplay-info as another EDID parser easier, because libdisplay-info always returns malloc'd strings. To make things easier to extend as well, I introduce struct drm_head_info. The libdisplay-info case will likely return more information than this in the future. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* pipewire-[backend|plugin]: Add timestamps to buffersRobert Mader2023-04-201-1/+4
| | | | | | | | | | | | | In Pipewire and Gstreamer terminology Weston is a "live" source (as we do not explicitly set PW_KEY_STREAM_IS_LIVE to false). Such sources, be it compositors, cameras or microphones, usually set the current system time as timestamps on buffers in order to make life easier for consumers. Thus let's do so as well. This notably helps when recording using `gstpipewiresrc` with the `keepalive-time` property set. Signed-off-by: Robert Mader <robert.mader@collabora.com>
* backend-pipewire: remove linear modifier for nowPhilipp Zabel2023-04-191-1/+0
| | | | | | | | | | | | As of PipeWire version 0.3.69, the gstpipewiresrc element uses the existence of a modifier as a trigger to select dmabuf memory, failing caps negotiation as we don't send DMA buffers yet. Remove the linear modifier for now, to be added back when we add dmabuf support to the PipeWire backend. This allows testing the PipeWire backend with current GStreamer + PipeWire. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* backend-pipewire: pass backend to weston_pipewire_output_api::create_head()Philipp Zabel2023-04-191-8/+8
| | | | | | | | | | | Pass the backend instead of the compositor to the PipeWire 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 <p.zabel@pengutronix.de>
* backend-drm: obtain DRM backend from listener in session_notify()Philipp Zabel2023-04-191-1/+2
| | | | | | | | | | | The session_listener is embedded in the DRM backend structure. Use this to obtain the DRM backend with container_of(). That way the DRM 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. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
* backend-pipewire: add PipeWire backendPhilipp Zabel2023-04-184-0/+1038
| | | | | | | | | | | | | | | | | | | 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>
* backend-drm: schedule connector disable for detached headMichael Tretter2023-04-183-8/+26
| | | | | | | | | | | | | | 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>
* backend-vnc: pass vnc_backend to vnc_head_create()Philipp Zabel2023-04-171-10/+3
| | | | | | | | | | | | 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>
* backend-rdp: pass rdp_backend to rdp_head_create()Philipp Zabel2023-04-173-12/+5
| | | | | | | | | | | | 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>
* libweston: pass backend to weston_windowed_output_api::create_head()Philipp Zabel2023-04-173-21/+23
| | | | | | | | | | | 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>
* backend-vnc: remove output move listener leftoversPhilipp Zabel2023-04-151-3/+0
| | | | | | | | The output move listener removal was incomplete. Remove the remaining bits to fix a segfault on shutdown. Fixes: 40f5eaf401f0 ("backend-vnc: use output power_state to disable repainting while disconnected") Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
* backend-wayland: fully release pango and fontconfigPekka Paalanen2023-04-121-0/+3
| | | | | | | | | | | 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>
* backend-headless: fully release pango and fontconfigPekka Paalanen2023-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* backend-vnc: use output power_state to disable repainting while disconnectedPhilipp Zabel2023-04-121-43/+11
| | | | | | | | 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>
* input: Destroy tablet-tool bindings on exitDaniel Stone2023-04-121-0/+1
| | | | | | Make sure we don't leak any tablet tool bindings. Signed-off-by: Daniel Stone <daniels@collabora.com>
* color-lcms: add debug scope for pipeline optimizerLeandro Ribeiro2023-04-123-2/+139
| | | | | | | | 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>
* color-lcms: add debug scope for color profilesLeandro Ribeiro2023-04-123-1/+59
| | | | | | | 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>
* color-lcms: add debug scope for color tranformationsLeandro Ribeiro2023-04-125-3/+184
| | | | | | | 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>
* color-lcms: save ICC profile version string with a single decimal valueLeandro Ribeiro2023-04-121-1/+1
| | | | | | | | | | 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>
* color-lcms: Fix memory leak in join_curvesetsVitaly Prosyak2023-04-111-1/+1
| | | | | | | | 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>
* input: Fix uint/enum declaration mismatchDaniel Stone2023-04-111-1/+2
| | | | | | | | | 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>
* drm: Fix type confusion in writeback_stateDaniel Stone2023-04-041-2/+2
| | | | | | | | 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>
* libweston: Skip setting DPMS if output is not enabledmarius vlad2023-04-041-1/+1
| | | | | | | 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>
* libweston: Set default power state at output initializationmarius vlad2023-04-041-1/+1
| | | | | | | | | | | | 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>
* libweston: Damage the output after the output has been addedmarius vlad2023-04-041-1/+1
| | | | | | | | | | | 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>
* input: Consistently use enums for modifier/axis/stateDaniel Stone2023-04-031-5/+8
| | | | | | | 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>
* gl-renderer: Get rid of begin fence syncLoïc Molinari2023-04-032-37/+116
| | | | | | | | | | | | | | | | 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>
* libweston-desktop: implement tablet tool grabMichael Olbrich2023-03-311-1/+129
| | | | | | This is needed for correct focus handling when xdg popups are opened. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* tablet: Add binding to activate surfaces using the tablet toolMichael Olbrich2023-03-314-0/+49
| | | | | | | | | 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>
* clients: Add support for tablet cursor motion to window frames in libtoytoolkitLyude Paul2023-03-311-0/+11
| | | | | | | | | | | | | | 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>
* libweston: handle tablet cursors in the compositorMichael Olbrich2023-03-312-0/+134
| | | | | | | | | | | | | | 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>
* libinput: hook up tablet eventsMichael Olbrich2023-03-313-2/+302
| | | | | | | | 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>
* input: add weston grab interfaces for tablet toolsMichael Olbrich2023-03-312-5/+312
| | | | | | | | 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>
* input: add tablet focus handlingMichael Olbrich2023-03-311-0/+101
| | | | | | | | | | | | | | | 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>
* libweston: Add initial tablet support to westonMichael Olbrich2023-03-315-0/+480
| | | | | | | | | | | | | | | | | | | | | 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>
* drm: allow to skip composition if pending capture is writebackLeandro Ribeiro2023-03-313-5/+9
| | | | | | | | | | 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>
* desktop: Make popup grab follow keyboard focus semanticsJonas Ådahl2023-03-305-4/+63
| | | | | | | | | | | | A popup grab is specified to have the top most popup surface gain keyboard focus. This means the keyboard focus should always follow the most recent xdg_popup.grab() surface. Make sure this happens by keeping track of the parent surface in the libweston-desktop popup grab, updating the keyboard focus when surfaces are added and removed from the popup chain, and restoring the keyboard focus to the toplevel when there are no popups anymore. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* shell: Keep window 'activated' state if child has focusJonas Ådahl2023-03-302-3/+13
| | | | | | | | Popups should have keyboard focus when active, but the toplevel window should still appear "active". Make sure this is the case by changing the "active" tracking to see whether any child surface has keyboard focus. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Revert "input: Consistently use enums for modifier/axis/state"Daniel Stone2023-03-301-8/+5
| | | | | | This reverts commit 9248340db067e28e1e91e5be360bed586d914ebd. Signed-off-by: Daniel Stone <daniels@collabora.com>
* backend-drm: Select plane based on current attached CRTCAndrew F. Davis2023-03-302-0/+10
| | | | | | | | | | | | When doing plane selection for an output CRTC check if the plane already has a CRTC attached and if so prefer that plane only for the corresponding CRTC. This prevents changing a CRTC's primary plane when it is active which is not allowed by the DRM framework. Based-on-patch-by: Eric Ruei <e-ruei1@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com>
* input: Consistently use enums for modifier/axis/stateDaniel Stone2023-03-301-5/+8
| | | | | | | 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>
* backend-drm: Pass view alpha to plane state and commitVeeresh Kadasani2023-03-303-6/+16
| | | | | | | | | We map view alpha(0.0-1.0) to plane state's alpha by using the max plane alpha value got from drm. Signed-off-by: Hsuan-Yu Lin <hlin@jp.adit-jv.com> Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com> Signed-off-by: Vinh Nguyen Trong <Vinh.NguyenTrong@vn.bosch.com>
* backend-drm: Add plane alpha DRM-propertyVeeresh Kadasani2023-03-304-0/+32
| | | | | | | | | | | This checks whether plane alpha is supported. We get range of alpha value supported for plane which is required for mapping view's alpha(0.0-1.0) with drm plane alpha. No functional change. Signed-off-by: Hsuan-Yu Lin <hlin@jp.adit-jv.com> Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com> Signed-off-by: Vinh Nguyen Trong <Vinh.NguyenTrong@vn.bosch.com>
* libweston: Skip views without a parentMarius Vlad2023-03-301-0/+7
| | | | | | | | | | | | This prevents to trigger an assert within weston_view_set_rel_position(), introduced with commit 'libweston: Split weston_view_set_position() into rel and abs variants', which is hit when a subsurface attempts to commit without having a parent surface set. Fixes: #730 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Colin Kinloch <collin.kinloch@collabora.com>
* libweston/input: Fix assert for valid confine regionSergio Gómez2023-03-291-1/+1
| | | | | | | | | | We need only check that the region is not empty. If either the input region or the constraint region have degenerate extents, the intersection from the previous instruction will set confine_region->data to pixman_region_empty_data. Fixes: b6423e59 Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>