From 1851fa2bd0ca7330079a99b8019920e0a15e842a Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 2 Apr 2018 17:14:53 +0100 Subject: [PATCH] renderer-native: Fall back to non-modifier GBM surfaces If we attempt GBM surface allocation with a set of modifiers but the allocation fails, fall back to non-modifier allocations. This fixes startup on Pineview-based Atom systems, where KMS provides us a set of modifiers but the GBM implementation doesn't support modifier use. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/84 (cherry picked from commit e6109cfc22f06412e67bd3c1f9f0dfa6ad7e0b19) --- src/backends/native/meta-renderer-native.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 1fc593ad5..2717f7d2e 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -1996,7 +1996,7 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen, CoglRenderer *cogl_renderer = cogl_display->renderer; CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys; MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform; - struct gbm_surface *new_gbm_surface; + struct gbm_surface *new_gbm_surface = NULL; EGLNativeWindowType egl_native_window; EGLSurface new_egl_surface; uint32_t format = GBM_FORMAT_XRGB8888; @@ -2017,7 +2017,8 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen, modifiers->len); g_array_free (modifiers, TRUE); } - else + + if (!new_gbm_surface) { uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;