[mutter] backend/native: Only disable dmabuf screen cast when not hw accelerated
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backend/native: Only disable dmabuf screen cast when not hw accelerated
- Date: Mon, 7 Feb 2022 19:47:24 +0000 (UTC)
commit 52ce81657d4ac608ecf72fe78da16475aecc45e3
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Nov 11 09:28:25 2021 +0100
backend/native: Only disable dmabuf screen cast when not hw accelerated
We now only enable DMA buffer based PipeWire screen casting if a
format/modifier has been negotiated. This practically means a consumer
is aware about what is needed, and we should not try to predict that it
uses the DMA buffer the right way (i.e. not mmap:ing directly).
However, in case we're not hardware accelerated, we never want to
attempt to use DMA buffer screen sharing, as we want to avoid
compositing into a DMA buffer on such hardware as doing so can be very
slow.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2086>
data/org.gnome.mutter.gschema.xml.in | 8 +------
src/backends/meta-settings-private.h | 3 +--
src/backends/meta-settings.c | 2 --
src/backends/native/meta-backend-native.c | 35 +++++--------------------------
4 files changed, 7 insertions(+), 41 deletions(-)
---
diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in
index b54170eec6..c014b749fc 100644
--- a/data/org.gnome.mutter.gschema.xml.in
+++ b/data/org.gnome.mutter.gschema.xml.in
@@ -4,8 +4,7 @@
<value nick="scale-monitor-framebuffer" value="1"/>
<value nick="kms-modifiers" value="2"/>
<value nick="rt-scheduler" value="4"/>
- <value nick="dma-buf-screen-sharing" value="8"/>
- <value nick="autoclose-xwayland" value="16"/>
+ <value nick="autoclose-xwayland" value="8"/>
</flags>
<schema id="org.gnome.mutter" path="/org/gnome/mutter/"
@@ -139,11 +138,6 @@
• “rt-scheduler” — makes mutter request a low priority
real-time scheduling. Requires a restart.
- • “dma-buf-screen-sharing” — enables DMA buffered screen sharing. This
- is already enabled by default when using
- the i915 driver, but disabled for
- everything else. Requires a restart.
-
• “autoclose-xwayland” — automatically terminates Xwayland if all
relevant X11 clients are gone.
Requires a restart.
diff --git a/src/backends/meta-settings-private.h b/src/backends/meta-settings-private.h
index fb9aea0dcb..47d2d6074e 100644
--- a/src/backends/meta-settings-private.h
+++ b/src/backends/meta-settings-private.h
@@ -34,8 +34,7 @@ typedef enum _MetaExperimentalFeature
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER = (1 << 2),
- META_EXPERIMENTAL_FEATURE_DMA_BUF_SCREEN_SHARING = (1 << 3),
- META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND = (1 << 4),
+ META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND = (1 << 3),
} MetaExperimentalFeature;
typedef enum _MetaXwaylandExtension
diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c
index f672026ea5..2826ff98f9 100644
--- a/src/backends/meta-settings.c
+++ b/src/backends/meta-settings.c
@@ -294,8 +294,6 @@ experimental_features_handler (GVariant *features_variant,
feature = META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
else if (g_str_equal (feature_str, "rt-scheduler"))
feature = META_EXPERIMENTAL_FEATURE_RT_SCHEDULER;
- else if (g_str_equal (feature_str, "dma-buf-screen-sharing"))
- feature = META_EXPERIMENTAL_FEATURE_DMA_BUF_SCREEN_SHARING;
else if (g_str_equal (feature_str, "autoclose-xwayland"))
feature = META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND;
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index e3d2c5ab03..5a59d7dd51 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -158,40 +158,15 @@ static void
maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
{
MetaBackend *backend = META_BACKEND (native);
- MetaSettings *settings = meta_backend_get_settings (backend);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
- MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
- MetaGpuKms *primary_gpu;
- MetaKmsDevice *kms_device;
- const char *driver_name;
- static const char *enable_dma_buf_drivers[] = {
- "i915",
- NULL,
- };
-
- primary_gpu = meta_renderer_native_get_primary_gpu (renderer_native);
- if (!primary_gpu)
+
+ if (!meta_renderer_is_hardware_accelerated (renderer))
{
- g_message ("Disabling DMA buffer screen sharing (surfaceless)");
- goto disable_dma_bufs;
+ g_message ("Disabling DMA buffer screen sharing "
+ "(not hardware accelerated)");
+ meta_screen_cast_disable_dma_bufs (screen_cast);
}
-
- kms_device = meta_gpu_kms_get_kms_device (primary_gpu);
- driver_name = meta_kms_device_get_driver_name (kms_device);
-
- if (g_strv_contains (enable_dma_buf_drivers, driver_name))
- return;
-
- if (meta_settings_is_experimental_feature_enabled (settings,
- META_EXPERIMENTAL_FEATURE_DMA_BUF_SCREEN_SHARING))
- return;
-
- g_message ("Disabling DMA buffer screen sharing for driver '%s'.",
- driver_name);
-
-disable_dma_bufs:
- meta_screen_cast_disable_dma_bufs (screen_cast);
}
#endif /* HAVE_REMOTE_DESKTOP */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]