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:
committed by
Pekka Paalanen
parent
24756a8965
commit
411a7cfe67
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user