glamor: Require EGL_KHR_no_config_context
This is not actually a change for xwayland with gbm, or for xfree86 with big-GL, but we do change them as well to use EGL_NO_CONFIG_KHR explicitly. Reviewed-by: Emma Anholt <emma@anholt.net>
This commit is contained in:
parent
abda3f4233
commit
7d5b4c5405
|
@ -933,8 +933,6 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
||||||
{
|
{
|
||||||
struct glamor_egl_screen_private *glamor_egl;
|
struct glamor_egl_screen_private *glamor_egl;
|
||||||
const GLubyte *renderer;
|
const GLubyte *renderer;
|
||||||
EGLConfig egl_config;
|
|
||||||
int n;
|
|
||||||
|
|
||||||
glamor_egl = calloc(sizeof(*glamor_egl), 1);
|
glamor_egl = calloc(sizeof(*glamor_egl), 1);
|
||||||
if (glamor_egl == NULL)
|
if (glamor_egl == NULL)
|
||||||
|
@ -977,6 +975,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
GLAMOR_CHECK_EGL_EXTENSION(KHR_surfaceless_context);
|
GLAMOR_CHECK_EGL_EXTENSION(KHR_surfaceless_context);
|
||||||
|
GLAMOR_CHECK_EGL_EXTENSION(KHR_no_config_context);
|
||||||
|
|
||||||
if (eglBindAPI(EGL_OPENGL_API)) {
|
if (eglBindAPI(EGL_OPENGL_API)) {
|
||||||
static const EGLint config_attribs_core[] = {
|
static const EGLint config_attribs_core[] = {
|
||||||
|
@ -993,12 +992,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
||||||
};
|
};
|
||||||
|
|
||||||
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
||||||
NULL, EGL_NO_CONTEXT,
|
EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT,
|
||||||
config_attribs_core);
|
config_attribs_core);
|
||||||
|
|
||||||
if (glamor_egl->context == EGL_NO_CONTEXT)
|
if (glamor_egl->context == EGL_NO_CONTEXT)
|
||||||
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
||||||
NULL, EGL_NO_CONTEXT,
|
EGL_NO_CONFIG_KHR,
|
||||||
|
EGL_NO_CONTEXT,
|
||||||
config_attribs);
|
config_attribs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,14 +1029,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eglChooseConfig(glamor_egl->display, NULL, &egl_config, 1, &n)) {
|
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
|
||||||
"glamor: No acceptable EGL configs found\n");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
glamor_egl->context = eglCreateContext(glamor_egl->display,
|
||||||
egl_config, EGL_NO_CONTEXT,
|
EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT,
|
||||||
config_attribs);
|
config_attribs);
|
||||||
|
|
||||||
if (glamor_egl->context == EGL_NO_CONTEXT) {
|
if (glamor_egl->context == EGL_NO_CONTEXT) {
|
||||||
|
|
|
@ -325,7 +325,7 @@ ephyr_glamor_screen_init(xcb_window_t win, xcb_visualid_t vid)
|
||||||
context_attribs[i++] = ephyr_glamor_gles2 ? 0 : 1;
|
context_attribs[i++] = ephyr_glamor_gles2 ? 0 : 1;
|
||||||
context_attribs[i++] = EGL_NONE;
|
context_attribs[i++] = EGL_NONE;
|
||||||
|
|
||||||
ctx = eglCreateContext(glamor->dpy, config, EGL_NO_CONTEXT,
|
ctx = eglCreateContext(glamor->dpy, EGL_NO_CONFIG_KHR, EGL_NO_CONTEXT,
|
||||||
context_attribs);
|
context_attribs);
|
||||||
|
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
|
|
|
@ -989,8 +989,10 @@ xwl_glamor_eglstream_init_egl(struct xwl_screen *xwl_screen)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eglBindAPI(EGL_OPENGL_API);
|
eglBindAPI(EGL_OPENGL_API);
|
||||||
xwl_screen->egl_context = eglCreateContext(
|
xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display,
|
||||||
xwl_screen->egl_display, config, EGL_NO_CONTEXT, attrib_list);
|
EGL_NO_CONFIG_KHR,
|
||||||
|
EGL_NO_CONTEXT,
|
||||||
|
attrib_list);
|
||||||
if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
|
if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
|
||||||
ErrorF("Failed to create main EGL context: 0x%x\n", eglGetError());
|
ErrorF("Failed to create main EGL context: 0x%x\n", eglGetError());
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -785,12 +785,12 @@ xwl_glamor_try_big_gl_api(struct xwl_screen *xwl_screen)
|
||||||
eglBindAPI(EGL_OPENGL_API);
|
eglBindAPI(EGL_OPENGL_API);
|
||||||
|
|
||||||
xwl_screen->egl_context =
|
xwl_screen->egl_context =
|
||||||
eglCreateContext(xwl_screen->egl_display, NULL,
|
eglCreateContext(xwl_screen->egl_display, EGL_NO_CONFIG_KHR,
|
||||||
EGL_NO_CONTEXT, config_attribs_core);
|
EGL_NO_CONTEXT, config_attribs_core);
|
||||||
|
|
||||||
if (xwl_screen->egl_context == EGL_NO_CONTEXT)
|
if (xwl_screen->egl_context == EGL_NO_CONTEXT)
|
||||||
xwl_screen->egl_context =
|
xwl_screen->egl_context =
|
||||||
eglCreateContext(xwl_screen->egl_display, NULL,
|
eglCreateContext(xwl_screen->egl_display, EGL_NO_CONFIG_KHR,
|
||||||
EGL_NO_CONTEXT, NULL);
|
EGL_NO_CONTEXT, NULL);
|
||||||
|
|
||||||
if (!xwl_glamor_try_to_make_context_current(xwl_screen)) {
|
if (!xwl_glamor_try_to_make_context_current(xwl_screen)) {
|
||||||
|
@ -824,7 +824,8 @@ xwl_glamor_try_gles_api(struct xwl_screen *xwl_screen)
|
||||||
|
|
||||||
eglBindAPI(EGL_OPENGL_ES_API);
|
eglBindAPI(EGL_OPENGL_ES_API);
|
||||||
|
|
||||||
xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display, NULL,
|
xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display,
|
||||||
|
EGL_NO_CONFIG_KHR,
|
||||||
EGL_NO_CONTEXT, gles_attribs);
|
EGL_NO_CONTEXT, gles_attribs);
|
||||||
|
|
||||||
if (!xwl_glamor_try_to_make_context_current(xwl_screen)) {
|
if (!xwl_glamor_try_to_make_context_current(xwl_screen)) {
|
||||||
|
|
Loading…
Reference in New Issue