[PATCH weston] toytoolkit: fix EGL surface creation for lazy drivers

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Sat Mar 28 23:17:01 PDT 2015


From: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>

Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.

Allow toytoolkit to create EGL surfaces with them, by
falling back to the old creation method.

Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
---
 shared/platform.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/shared/platform.h b/shared/platform.h
index ff640b5..364ce5a 100644
--- a/shared/platform.h
+++ b/shared/platform.h
@@ -55,8 +55,9 @@ weston_platform_get_egl_proc_address(const char *address)
 {
 	const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
 
-	if (strstr(extensions, "EGL_EXT_platform_wayland")
-	    || strstr(extensions, "EGL_KHR_platform_wayland")) {
+	if (extensions
+	    && (strstr(extensions, "EGL_EXT_platform_wayland")
+	        || strstr(extensions, "EGL_KHR_platform_wayland"))) {
 		return (void *) eglGetProcAddress(address);
 	}
 
-- 
1.8.3.1



More information about the wayland-devel mailing list