toytoolkit: fix EGL surface creation for lazy drivers
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Sun, 29 Mar 2015 06:17:01 +0000 (08:17 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 30 Mar 2015 12:42:16 +0000 (15:42 +0300)
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@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
shared/platform.h

index ff640b54a7b0ee7e9e8692482112abcee4c7fe91..364ce5aaaf9a5b5e6ec69ecfd548d470265fe519 100644 (file)
@@ -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);
        }