From 885c616589874c22aa0d185e1b50dbf4ea563c10 Mon Sep 17 00:00:00 2001 From: Ray Smith Date: Thu, 14 Dec 2023 15:10:09 +0000 Subject: [PATCH] backend-drm: fix confused fallback format handling This seems to think formats needs to be NULL terminated, but it doesn't and gl_renderer_get_egl_config asserts that all formats_count elements are not NULL. This happens when EGL_KHR_no_config_context is not supported. Signed-off-by: Ray Smith --- libweston/backend-drm/drm-gbm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libweston/backend-drm/drm-gbm.c b/libweston/backend-drm/drm-gbm.c index ef3a123d..5b02b38d 100644 --- a/libweston/backend-drm/drm-gbm.c +++ b/libweston/backend-drm/drm-gbm.c @@ -82,18 +82,17 @@ drm_backend_create_gl_renderer(struct drm_backend *b) const struct pixel_format_info *format[3] = { b->format, fallback_format_for(b->format), - NULL, }; struct gl_renderer_display_options options = { .egl_platform = EGL_PLATFORM_GBM_KHR, .egl_native_display = b->gbm, .egl_surface_type = EGL_WINDOW_BIT, .formats = format, - .formats_count = 2, + .formats_count = 1, }; if (format[1]) - options.formats_count = 3; + options.formats_count = 2; return weston_compositor_init_renderer(b->compositor, WESTON_RENDERER_GL,