From 0a6034ef3a745c25ab63c2ca8d4ae08bc5e09d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 28 Feb 2020 11:09:46 +0100 Subject: [PATCH] monitor-manager: Remove 'mirror' capability With per-CRTC views, there is nothing stopping NVIDA EGLStream based rendering to not support monitor mirroring, so lets remove that restriction. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1098 --- src/backends/meta-monitor-manager-dummy.c | 2 -- src/backends/meta-monitor-manager-private.h | 5 ++-- src/backends/meta-monitor-manager.c | 6 ---- .../native/meta-monitor-manager-kms.c | 5 ---- src/backends/native/meta-renderer-native.c | 28 ------------------- src/backends/native/meta-renderer-native.h | 2 -- .../x11/meta-monitor-manager-xrandr.c | 3 +- src/tests/meta-monitor-manager-test.c | 2 -- 8 files changed, 3 insertions(+), 50 deletions(-) diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c index 470c327e5..2ddd826a8 100644 --- a/src/backends/meta-monitor-manager-dummy.c +++ b/src/backends/meta-monitor-manager-dummy.c @@ -714,8 +714,6 @@ meta_monitor_manager_dummy_get_capabilities (MetaMonitorManager *manager) MetaMonitorManagerCapability capabilities = META_MONITOR_MANAGER_CAPABILITY_NONE; - capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING; - if (meta_settings_is_experimental_feature_enabled ( settings, META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER)) diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h index 4dd0364a8..a0a28b6c2 100644 --- a/src/backends/meta-monitor-manager-private.h +++ b/src/backends/meta-monitor-manager-private.h @@ -43,9 +43,8 @@ typedef enum _MetaMonitorManagerCapability { META_MONITOR_MANAGER_CAPABILITY_NONE = 0, - META_MONITOR_MANAGER_CAPABILITY_MIRRORING = (1 << 0), - META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE = (1 << 1), - META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED = (1 << 2) + META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE = (1 << 0), + META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED = (1 << 1) } MetaMonitorManagerCapability; /* Equivalent to the 'method' enum in org.gnome.Mutter.DisplayConfig */ diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index b94967d79..3505573b8 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1446,12 +1446,6 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, g_variant_builder_init (&properties_builder, G_VARIANT_TYPE ("a{sv}")); capabilities = meta_monitor_manager_get_capabilities (manager); - if ((capabilities & META_MONITOR_MANAGER_CAPABILITY_MIRRORING) == 0) - { - g_variant_builder_add (&properties_builder, "{sv}", - "supports-mirroring", - g_variant_new_boolean (FALSE)); - } g_variant_builder_add (&properties_builder, "{sv}", "layout-mode", diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c index b7da048e2..6dcba6442 100644 --- a/src/backends/native/meta-monitor-manager-kms.c +++ b/src/backends/native/meta-monitor-manager-kms.c @@ -547,8 +547,6 @@ meta_monitor_manager_kms_get_capabilities (MetaMonitorManager *manager) { MetaBackend *backend = meta_monitor_manager_get_backend (manager); MetaSettings *settings = meta_backend_get_settings (backend); - MetaRenderer *renderer = meta_backend_get_renderer (backend); - MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer); MetaMonitorManagerCapability capabilities = META_MONITOR_MANAGER_CAPABILITY_NONE; @@ -557,9 +555,6 @@ meta_monitor_manager_kms_get_capabilities (MetaMonitorManager *manager) META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER)) capabilities |= META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE; - if (meta_renderer_native_supports_mirroring (renderer_native)) - capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING; - return capabilities; } diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 6d9243716..1ebc761eb 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -2793,34 +2793,6 @@ _cogl_winsys_egl_vtable = { .context_init = meta_renderer_native_init_egl_context }; -gboolean -meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native) -{ - MetaRenderer *renderer = META_RENDERER (renderer_native); - MetaBackend *backend = meta_renderer_get_backend (renderer); - GList *l; - - for (l = meta_backend_get_gpus (backend); l; l = l->next) - { - MetaGpuKms *gpu_kms = META_GPU_KMS (l->data); - MetaRendererNativeGpuData *renderer_gpu_data; - - renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native, - gpu_kms); - switch (renderer_gpu_data->mode) - { - case META_RENDERER_NATIVE_MODE_GBM: - break; -#ifdef HAVE_EGL_DEVICE - case META_RENDERER_NATIVE_MODE_EGL_DEVICE: - return FALSE; -#endif - } - } - - return TRUE; -} - static void meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native) { diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h index 650968c57..7abe7c152 100644 --- a/src/backends/native/meta-renderer-native.h +++ b/src/backends/native/meta-renderer-native.h @@ -51,8 +51,6 @@ MetaRendererNative * meta_renderer_native_new (MetaBackendNative *backend_nativ struct gbm_device * meta_gbm_device_from_gpu (MetaGpuKms *gpu_kms); -gboolean meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native); - void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native); int64_t meta_renderer_native_get_frame_counter (MetaRendererNative *renderer_native); diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index fd105c07a..5c161896f 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -959,8 +959,7 @@ meta_monitor_manager_xrandr_calculate_supported_scales (MetaMonitorManager static MetaMonitorManagerCapability meta_monitor_manager_xrandr_get_capabilities (MetaMonitorManager *manager) { - return (META_MONITOR_MANAGER_CAPABILITY_MIRRORING | - META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED); + return META_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED; } static gboolean diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c index 49ef6494d..42a57608e 100644 --- a/src/tests/meta-monitor-manager-test.c +++ b/src/tests/meta-monitor-manager-test.c @@ -371,8 +371,6 @@ meta_monitor_manager_test_get_capabilities (MetaMonitorManager *manager) MetaMonitorManagerCapability capabilities = META_MONITOR_MANAGER_CAPABILITY_NONE; - capabilities |= META_MONITOR_MANAGER_CAPABILITY_MIRRORING; - if (is_monitor_framebuffer_scaled ()) capabilities |= META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;