mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 09:00:42 -05:00
renderer/native: Choose first EGL config for non-GBM backends
Commit712ec30cd9
added the logic to only choose EGL configs that match the GBM_FORMAT_XRGB8888 pixel format. However, there won't be any EGL config satisfying such criteria for non-GBM backends, such as EGLDevice. This change will let us choose the first EGL config for the EGLDevice backend, while still forcing GBM_FORMAT_XRGB8888 configs for the GBM one. Related to: https://gitlab.gnome.org/GNOME/mutter/issues/2 (cherry picked from commit1bf2eb95b5
)
This commit is contained in:
parent
f8d99dc004
commit
0f93452488
@ -993,14 +993,29 @@ meta_renderer_native_choose_egl_config (CoglDisplay *cogl_display,
|
|||||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
MetaEgl *egl = meta_backend_get_egl (backend);
|
MetaEgl *egl = meta_backend_get_egl (backend);
|
||||||
|
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
|
||||||
EGLDisplay egl_display = cogl_renderer_egl->edpy;
|
EGLDisplay egl_display = cogl_renderer_egl->edpy;
|
||||||
|
|
||||||
return choose_egl_config_from_gbm_format (egl,
|
switch (renderer_gpu_data->mode)
|
||||||
egl_display,
|
{
|
||||||
attributes,
|
case META_RENDERER_NATIVE_MODE_GBM:
|
||||||
GBM_FORMAT_XRGB8888,
|
return choose_egl_config_from_gbm_format (egl,
|
||||||
out_config,
|
egl_display,
|
||||||
error);
|
attributes,
|
||||||
|
GBM_FORMAT_XRGB8888,
|
||||||
|
out_config,
|
||||||
|
error);
|
||||||
|
#ifdef HAVE_EGL_DEVICE
|
||||||
|
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
||||||
|
return meta_egl_choose_first_config (egl,
|
||||||
|
egl_display,
|
||||||
|
attributes,
|
||||||
|
out_config,
|
||||||
|
error);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2923,10 +2938,11 @@ meta_renderer_native_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
create_secondary_egl_config (MetaEgl *egl,
|
create_secondary_egl_config (MetaEgl *egl,
|
||||||
EGLDisplay egl_display,
|
MetaRendererNativeMode mode,
|
||||||
EGLConfig *egl_config,
|
EGLDisplay egl_display,
|
||||||
GError **error)
|
EGLConfig *egl_config,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
EGLint attributes[] = {
|
EGLint attributes[] = {
|
||||||
EGL_RED_SIZE, 1,
|
EGL_RED_SIZE, 1,
|
||||||
@ -2939,12 +2955,26 @@ create_secondary_egl_config (MetaEgl *egl,
|
|||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
return choose_egl_config_from_gbm_format (egl,
|
switch (mode)
|
||||||
egl_display,
|
{
|
||||||
attributes,
|
case META_RENDERER_NATIVE_MODE_GBM:
|
||||||
GBM_FORMAT_XRGB8888,
|
return choose_egl_config_from_gbm_format (egl,
|
||||||
egl_config,
|
egl_display,
|
||||||
error);
|
attributes,
|
||||||
|
GBM_FORMAT_XRGB8888,
|
||||||
|
egl_config,
|
||||||
|
error);
|
||||||
|
#ifdef HAVE_EGL_DEVICE
|
||||||
|
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
||||||
|
return meta_egl_choose_first_config (egl,
|
||||||
|
egl_display,
|
||||||
|
attributes,
|
||||||
|
egl_config,
|
||||||
|
error);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EGLContext
|
static EGLContext
|
||||||
@ -2988,7 +3018,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
|
|||||||
EGLContext egl_context;
|
EGLContext egl_context;
|
||||||
char **missing_gl_extensions;
|
char **missing_gl_extensions;
|
||||||
|
|
||||||
if (!create_secondary_egl_config (egl,egl_display, &egl_config, error))
|
if (!create_secondary_egl_config (egl, renderer_gpu_data->mode, egl_display,
|
||||||
|
&egl_config, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);
|
egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);
|
||||||
|
Loading…
Reference in New Issue
Block a user