[PATCH weston] gl-renderer: fix EGL initialization steps

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Sat Mar 28 20:03:09 PDT 2015


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

We should not prevent gl-renderer to initalize if client
extensions were not found. Practically, this prevented
Weston from running with GL on i915 DRI platforms.

Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.
Just as we do in gl_renderer_supports(), which returns 0
but does not fail in this case, do not fail in
gl_renderer_setup_egl_extensions().
---
 src/gl-renderer.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index b3b2364..28ecc63 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -2136,15 +2136,14 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
 		(const char *) eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
 	if (!extensions) {
 		weston_log("Retrieving EGL client extension string failed.\n");
-		return -1;
+	} else {
+		if (strstr(extensions, "EGL_EXT_platform_base"))
+			gr->create_platform_window =
+				(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
+		else
+			weston_log("warning: EGL_EXT_platform_base not supported.\n");
 	}
 
-	if (strstr(extensions, "EGL_EXT_platform_base"))
-		gr->create_platform_window =
-			(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
-	else
-		weston_log("warning: EGL_EXT_platform_base not supported.\n");
-
 #ifdef EGL_MESA_configless_context
 	if (strstr(extensions, "EGL_MESA_configless_context"))
 		gr->has_configless_context = 1;
@@ -2256,12 +2255,9 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
 	EGLint major, minor;
 	int supports = 0;
 
-	if (platform) {
+	if (platform)
 		supports = gl_renderer_supports(
 			ec, platform_to_extension(platform));
-		if (supports < 0)
-			return -1;
-	}
 
 	gr = zalloc(sizeof *gr);
 	if (gr == NULL)
-- 
1.8.3.1



More information about the wayland-devel mailing list