From ee1d968e641ecd0aa672faafcdb37a780cb96ef0 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 31 Jan 2019 00:02:25 +0000 Subject: [PATCH] compositor-drm: Fall back if GBM surface fails with modifiers If we cannot create a gbm_surface using a list of modifiers, fall back to using the old pre-modifier version. This fixes initialisation on systems where KMS supports modifiers but the GBM driver does not, such as old i915 systems like Pine View using the unified KMS driver but the old i915 Mesa driver. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 54230ecc..a5de6611 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -5061,7 +5061,12 @@ drm_output_init_egl(struct drm_output *output, struct drm_backend *b) output->gbm_format, plane->formats[i].modifiers, plane->formats[i].count_modifiers); - } else + } + + /* If allocating with modifiers fails, try again without. This can + * happen when the KMS display device supports modifiers but the + * GBM driver does not, e.g. the old i915 Mesa driver. */ + if (!output->gbm_surface) #endif { output->gbm_surface =