gl-renderer: display_create needs surface type

In case the base EGLConfig is needed, gl_renderer_display_create() needs to
know it should use EGL_WINDOW_BIT or EGL_PBUFFER_BIT.

The PBUFFER case is added for when the headless backend will grow GL-renderer
support.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2019-09-19 12:45:06 +03:00
committed by Pekka Paalanen
parent 24756a8965
commit 411a7cfe67
5 changed files with 9 additions and 4 deletions
+3 -4
View File
@@ -3354,6 +3354,7 @@ static int
gl_renderer_display_create(struct weston_compositor *ec,
EGLenum platform,
void *native_display,
EGLint egl_surface_type,
const uint32_t *drm_formats,
unsigned drm_formats_count)
{
@@ -3427,13 +3428,11 @@ gl_renderer_display_create(struct weston_compositor *ec,
goto fail_with_error;
if (!gr->has_configless_context) {
EGLint surface_type = EGL_WINDOW_BIT;
if (!gr->has_surfaceless_context)
surface_type |= EGL_PBUFFER_BIT;
egl_surface_type |= EGL_PBUFFER_BIT;
gr->egl_config = gl_renderer_get_egl_config(gr,
surface_type,
egl_surface_type,
drm_formats,
drm_formats_count);
if (gr->egl_config == EGL_NO_CONFIG_KHR) {
+3
View File
@@ -46,6 +46,8 @@ typedef void *EGLConfig;
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativeWindowType;
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
#define EGL_PBUFFER_BIT 0x0001
#define EGL_WINDOW_BIT 0x0004
#endif /* ENABLE_EGL */
@@ -60,6 +62,7 @@ struct gl_renderer_interface {
int (*display_create)(struct weston_compositor *ec,
EGLenum platform,
void *native_display,
EGLint egl_surface_type,
const uint32_t *drm_formats,
unsigned drm_formats_count);