From 9c407f0a1b40128fc65b19b6a499f1d4dae6f702 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 4 Apr 2018 16:16:37 +0100 Subject: [PATCH] glamor: Fall back to non-modifier allocations If we try to allocate with particular modifiers but it fails, try to fall back to non-modifier allocations. Signed-off-by: Daniel Stone Reported-by: Adam Jackson Reviewed-by: Adam Jackson --- glamor/glamor_egl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index a1e0bc3c9..2dffbb8dc 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -261,7 +261,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) unsigned width = pixmap->drawable.width; unsigned height = pixmap->drawable.height; uint32_t format; - struct gbm_bo *bo; + struct gbm_bo *bo = NULL; Bool used_modifiers = FALSE; PixmapPtr exported; GCPtr scratch_gc; @@ -295,8 +295,9 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) used_modifiers = TRUE; free(modifiers); } - else #endif + + if (!bo) { bo = gbm_bo_create(glamor_egl->gbm, width, height, format, #ifdef GLAMOR_HAS_GBM_LINEAR