diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 02ec4a0ed..fafc0cc6d 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -239,6 +239,17 @@ meta_renderer_native_has_pending_mode_set (MetaRendererNative *renderer_native) return renderer_native->pending_mode_set; } +MetaRendererNativeMode +meta_renderer_native_get_mode (MetaRendererNative *renderer_native) +{ + MetaGpuKms *primary_gpu = renderer_native->primary_gpu_kms; + MetaRendererNativeGpuData *primary_gpu_data; + + primary_gpu_data = meta_renderer_native_get_gpu_data (renderer_native, + primary_gpu); + return primary_gpu_data->mode; +} + static void meta_renderer_native_disconnect (CoglRenderer *cogl_renderer) { diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h index 2c23c651a..a01ceede2 100644 --- a/src/backends/native/meta-renderer-native.h +++ b/src/backends/native/meta-renderer-native.h @@ -68,4 +68,6 @@ void meta_renderer_native_reset_modes (MetaRendererNative *renderer_native); gboolean meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native); +MetaRendererNativeMode meta_renderer_native_get_mode (MetaRendererNative *renderer_native); + #endif /* META_RENDERER_NATIVE_H */ diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 089b2d502..ceb2afed3 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -51,6 +51,10 @@ #include "wayland/meta-xwayland-private.h" #include "wayland/meta-xwayland.h" +#ifdef HAVE_NATIVE_BACKEND +#include "backends/native/meta-renderer-native.h" +#endif + static char *_display_name_override; G_DEFINE_TYPE (MetaWaylandCompositor, meta_wayland_compositor, G_TYPE_OBJECT) @@ -573,8 +577,25 @@ meta_wayland_compositor_new (MetaContext *context) compositor); #ifdef HAVE_WAYLAND_EGLSTREAM - meta_wayland_eglstream_controller_init (compositor); -#endif + { + gboolean should_enable_eglstream_controller = TRUE; +#if defined(HAVE_EGL_DEVICE) && defined(HAVE_NATIVE_BACKEND) + MetaRenderer *renderer = meta_backend_get_renderer (backend); + + if (META_IS_RENDERER_NATIVE (renderer)) + { + MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer); + + if (meta_renderer_native_get_mode (renderer_native) == + META_RENDERER_NATIVE_MODE_GBM) + should_enable_eglstream_controller = FALSE; + } +#endif /* defined(HAVE_EGL_DEVICE) && defined(HAVE_NATIVE_BACKEND) */ + + if (should_enable_eglstream_controller) + meta_wayland_eglstream_controller_init (compositor); + } +#endif /* HAVE_WAYLAND_EGLSTREAM */ x11_display_policy = meta_context_get_x11_display_policy (compositor->context);