[PATCH weston 3/3] gl-renderer: fix configless_context check
Pekka Paalanen
ppaalanen at gmail.com
Wed Apr 8 07:02:22 PDT 2015
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
EGL_MESA_configless_context is a display extension. The query for client
extensions was overwriting the pointer, so it was being searched from
the client extensions instead.
Fix any confusion here by moving all client extension checks into
another function. Drop a useless cast.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
src/gl-renderer.c | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index 35cd7e7..ae3122f 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -2086,6 +2086,24 @@ gl_renderer_destroy(struct weston_compositor *ec)
free(gr);
}
+static void
+renderer_setup_egl_client_extensions(struct gl_renderer *gr)
+{
+ const char *extensions;
+
+ extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (!extensions) {
+ weston_log("Retrieving EGL client extension string failed.\n");
+ return;
+ }
+
+ 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");
+}
+
static int
gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
{
@@ -2132,24 +2150,13 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
"supported. Performance could be affected.\n");
#endif
- extensions =
- (const char *) eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
- if (!extensions) {
- weston_log("Retrieving EGL client extension string failed.\n");
- return 0;
- }
-
- 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;
#endif
+ renderer_setup_egl_client_extensions(gr);
+
return 0;
}
--
2.0.5
More information about the wayland-devel
mailing list