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 <rsmith@brightsign.biz>
This commit is contained in:
Ray Smith 2023-12-14 15:10:09 +00:00 committed by Pekka Paalanen
parent e37454a262
commit 885c616589
1 changed files with 2 additions and 3 deletions

View File

@ -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,