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 e6109cfc22)
This commit is contained in:
Daniel Stone 2018-04-02 17:14:53 +01:00 committed by Jonas Ådahl
parent de7d7bbf3d
commit 1851fa2bd0

View File

@ -1996,7 +1996,7 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
CoglRenderer *cogl_renderer = cogl_display->renderer; CoglRenderer *cogl_renderer = cogl_display->renderer;
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys; CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform; 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; EGLNativeWindowType egl_native_window;
EGLSurface new_egl_surface; EGLSurface new_egl_surface;
uint32_t format = GBM_FORMAT_XRGB8888; uint32_t format = GBM_FORMAT_XRGB8888;
@ -2017,7 +2017,8 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
modifiers->len); modifiers->len);
g_array_free (modifiers, TRUE); g_array_free (modifiers, TRUE);
} }
else
if (!new_gbm_surface)
{ {
uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;