screen-cast: Add 'dma-buf-screen-sharing' experimental feature

It's enabled by default when using the i915 driver, but disabled
everywhere else until it can be made reliably an improvement. Until
then, for anyone want to force-enable it, add the string
'dma-buf-screen-sharing' to the experimental features list in GSettings.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1442
This commit is contained in:
Jonas Ådahl 2020-09-14 18:23:10 +02:00 committed by Georges Basile Stavracas Neto
parent 6c0440697d
commit af9df1e5b6
3 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,7 @@ typedef enum _MetaExperimentalFeature
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1), META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER = (1 << 2), META_EXPERIMENTAL_FEATURE_RT_SCHEDULER = (1 << 2),
META_EXPERIMENTAL_FEATURE_AUTOSTART_XWAYLAND = (1 << 3), META_EXPERIMENTAL_FEATURE_AUTOSTART_XWAYLAND = (1 << 3),
META_EXPERIMENTAL_FEATURE_DMA_BUF_SCREEN_SHARING = (1 << 4),
} MetaExperimentalFeature; } MetaExperimentalFeature;
typedef enum _MetaXwaylandExtension typedef enum _MetaXwaylandExtension

View File

@ -273,6 +273,8 @@ experimental_features_handler (GVariant *features_variant,
feature = META_EXPERIMENTAL_FEATURE_RT_SCHEDULER; feature = META_EXPERIMENTAL_FEATURE_RT_SCHEDULER;
else if (g_str_equal (feature_str, "autostart-xwayland")) else if (g_str_equal (feature_str, "autostart-xwayland"))
feature = META_EXPERIMENTAL_FEATURE_AUTOSTART_XWAYLAND; feature = META_EXPERIMENTAL_FEATURE_AUTOSTART_XWAYLAND;
else if (g_str_equal (feature_str, "dma-buf-screen-sharing"))
feature = META_EXPERIMENTAL_FEATURE_DMA_BUF_SCREEN_SHARING;
if (feature) if (feature)
g_message ("Enabling experimental feature '%s'", feature_str); g_message ("Enabling experimental feature '%s'", feature_str);

View File

@ -347,6 +347,7 @@ static void
maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native) maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
{ {
MetaBackend *backend = META_BACKEND (native); MetaBackend *backend = META_BACKEND (native);
MetaSettings *settings = meta_backend_get_settings (backend);
MetaRenderer *renderer = meta_backend_get_renderer (backend); MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer); MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend); MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
@ -365,6 +366,10 @@ maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
if (g_strv_contains (enable_dma_buf_drivers, driver_name)) if (g_strv_contains (enable_dma_buf_drivers, driver_name))
return; 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'.", g_message ("Disabling DMA buffer screen sharing for driver '%s'.",
driver_name); driver_name);