blob: 8c6abae782db01dfa6764d0efd88914dff5463c7 [file] [log] [blame]
From 4ca8b5cb12cb96db0354a3fd2eba01b29a97a7da Mon Sep 17 00:00:00 2001
From: Mike Mason <michael.w.mason@intel.com>
Date: Thu, 22 Oct 2015 14:36:20 -0700
Subject: [PATCH] null: Fix null code to work with Mesa 11.0.2
Mesa 11.0.2 replaces the EGL 'null' platform used by Google with
the 'surfaceless' platform, which is the upstream version of 'null'.
This patch fixes waffle to work with 'surfaceless'.
Signed-off-by: Mike Mason <michael.w.mason@intel.com>
---
src/waffle/egl/wegl_platform.c | 14 +++++++-------
src/waffle/null/wnull_platform.c | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/waffle/egl/wegl_platform.c b/src/waffle/egl/wegl_platform.c
index 0c9eb44..8b5ac2b 100644
--- a/src/waffle/egl/wegl_platform.c
+++ b/src/waffle/egl/wegl_platform.c
@@ -72,11 +72,8 @@ wegl_platform_init(struct wegl_platform *self)
goto error;
}
-#define OPTIONAL_EGL_SYMBOL(function) \
- self->function = dlsym(self->eglHandle, #function);
-
#define RETRIEVE_EGL_SYMBOL(function) \
- OPTIONAL_EGL_SYMBOL(function) \
+ self->function = dlsym(self->eglHandle, #function); \
if (!self->function) { \
wcore_errorf(WAFFLE_ERROR_FATAL, \
"dlsym(\"%s\", \"" #function "\") failed: %s", \
@@ -85,9 +82,6 @@ wegl_platform_init(struct wegl_platform *self)
goto error; \
}
- OPTIONAL_EGL_SYMBOL(eglCreateImageKHR);
- OPTIONAL_EGL_SYMBOL(eglDestroyImageKHR);
-
RETRIEVE_EGL_SYMBOL(eglMakeCurrent);
RETRIEVE_EGL_SYMBOL(eglGetProcAddress);
@@ -112,6 +106,12 @@ wegl_platform_init(struct wegl_platform *self)
RETRIEVE_EGL_SYMBOL(eglDestroySurface);
RETRIEVE_EGL_SYMBOL(eglSwapBuffers);
+#define OPTIONAL_EGL_SYMBOL(function) \
+ self->function = (void*)self->eglGetProcAddress(#function);
+
+ OPTIONAL_EGL_SYMBOL(eglCreateImageKHR);
+ OPTIONAL_EGL_SYMBOL(eglDestroyImageKHR);
+
#undef OPTIONAL_EGL_SYMBOL
#undef RETRIEVE_EGL_SYMBOL
diff --git a/src/waffle/null/wnull_platform.c b/src/waffle/null/wnull_platform.c
index 012a788..f8626bc 100644
--- a/src/waffle/null/wnull_platform.c
+++ b/src/waffle/null/wnull_platform.c
@@ -43,7 +43,7 @@ wnull_platform_create(void)
return NULL;
}
- setenv("EGL_PLATFORM", "null", true);
+ setenv("EGL_PLATFORM", "surfaceless", true);
self->wgbm.wegl.wcore.vtbl = &wnull_platform_vtbl;
return &self->wgbm.wegl.wcore;
--
1.9.1