summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorRohan Garg <rohan@garg.io>2018-12-13 17:46:27 +0100
committerAdam Jackson <ajax@nwnk.net>2019-01-10 21:35:19 +0000
commit88dd4cea51f7e461cb4859c06bfe641890caa97b (patch)
tree05b553af1e27a30e788504f242c98a261f15dd3c /glamor
parente3fb178617a579c98877a3baae14c4dfe4d55db8 (diff)
glamor/egl: Drop a implicit depends on EGL_KHR_no_config_context
Not all platforms provide EGL_KHR_no_config_context, this ensures that eglCreateContext works on such platforms by querying for a config.
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_egl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index ca7ea8c98..0f4edb5a3 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -905,6 +905,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
{
struct glamor_egl_screen_private *glamor_egl;
const GLubyte *renderer;
+ EGLConfig egl_config;
+ int n;
glamor_egl = calloc(sizeof(*glamor_egl), 1);
if (glamor_egl == NULL)
@@ -983,8 +985,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
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,
- NULL, EGL_NO_CONTEXT,
+ egl_config, EGL_NO_CONTEXT,
config_attribs);
}
if (glamor_egl->context == EGL_NO_CONTEXT) {