summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-03 10:25:19 +0900
committerAdam Jackson <ajax@redhat.com>2016-07-06 13:21:27 -0400
commite4bf0e5ad5503c9a1d08080bca0b826ac64bd389 (patch)
tree06f724701c1791c1ed3fb1d3f4f5f4d24c672a53
parente02d2174570e42800c21a2205f83dd286881469f (diff)
glamor: Call eglBindAPI after eglInitialize
Current Mesa Git master checks that the EGL display actually supports the API passed to eglBindAPI, which can only succeed after eglInitialize. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96344 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit d798b8318adf298bc23166e74f31e49805f0d881)
-rw-r--r--glamor/glamor_egl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 80a97f7a1..5aacbedef 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -823,11 +823,6 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
glamor_egl->has_gem = glamor_egl_check_has_gem(fd);
-#ifndef GLAMOR_GLES2
- eglBindAPI(EGL_OPENGL_API);
-#else
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
if (!eglInitialize
(glamor_egl->display, &glamor_egl->major, &glamor_egl->minor)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglInitialize() failed\n");
@@ -835,6 +830,12 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
goto error;
}
+#ifndef GLAMOR_GLES2
+ eglBindAPI(EGL_OPENGL_API);
+#else
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+
version = eglQueryString(glamor_egl->display, EGL_VERSION);
xf86Msg(X_INFO, "%s: EGL version %s:\n", glamor_name, version);