From 38f3bf6ee289e4732029111d672c5d73bcf57a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 25 Jan 2022 14:59:40 +0100 Subject: [PATCH] screen-cast/src: Add debug logging when creating buffers Add some debug logging that allows checking whether we're using DMA buffers for screencasting or system memory buffers. This can be useful for debugging screencasting performance and CPU usage. Part-of: --- src/backends/meta-screen-cast-stream-src.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index 2efe7bc23..96fd35457 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -859,6 +859,10 @@ on_stream_add_buffer (void *data, if (dmabuf_handle) { + meta_topic (META_DEBUG_SCREEN_CAST, + "Allocating DMA buffer for pw_stream %u", + pw_stream_get_node_id (priv->pipewire_stream)); + spa_data[0].type = SPA_DATA_DmaBuf; spa_data[0].flags = SPA_DATA_FLAG_READWRITE; spa_data[0].fd = cogl_dma_buf_handle_get_fd (dmabuf_handle); @@ -878,6 +882,10 @@ on_stream_add_buffer (void *data, return; } + meta_topic (META_DEBUG_SCREEN_CAST, + "Allocating MemFd buffer for pw_stream %u", + pw_stream_get_node_id (priv->pipewire_stream)); + /* Fallback to a memfd buffer */ spa_data[0].type = SPA_DATA_MemFd; spa_data[0].flags = SPA_DATA_FLAG_READWRITE;