From 88e5fcb55a36dc4f1e09440f1d0449eb1dd1878c Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 13 Sep 2019 17:31:07 +0300 Subject: [PATCH] gl-renderer: pbuffer config for non-surfaceless If we don't have the surfaceless_context extension, we create a pbuffer as a dummy surface to work with. If we also don't have configless_context, then it is possible the config used for creating the context does not support pbuffers. Therefore, if both conditions apply, we need to pick a config that supports both window and pbuffer surfaces. This makes the "base" config compatible, but it does not yet guarantee that we actually pick it again when creating the pbuffer surface. Fixing that is another patch. Signed-off-by: Pekka Paalanen --- libweston/renderer-gl/gl-renderer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index ed4ea652..35203b2b 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -3427,7 +3427,13 @@ gl_renderer_display_create(struct weston_compositor *ec, goto fail_with_error; if (!gr->has_configless_context) { - gr->egl_config = gl_renderer_get_egl_config(gr, EGL_WINDOW_BIT, + EGLint surface_type = EGL_WINDOW_BIT; + + if (!gr->has_surfaceless_context) + surface_type |= EGL_PBUFFER_BIT; + + gr->egl_config = gl_renderer_get_egl_config(gr, + surface_type, drm_formats, drm_formats_count); if (gr->egl_config == EGL_NO_CONFIG_KHR) { -- 2.34.1