[PATCH weston 2/6] gles2: check eglBindWaylandDisplayWL return value

Pekka Paalanen ppaalanen at gmail.com
Tue Oct 23 23:43:06 PDT 2012


If the bind fails, do not bother pretending the EGL Wayland extension
is usable, and no need to unbind, either.

Print some important details about the GLESv2 renderer configuration
into the log.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 src/gles2-renderer.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/gles2-renderer.c b/src/gles2-renderer.c
index 15b0f4d..544cc15 100644
--- a/src/gles2-renderer.c
+++ b/src/gles2-renderer.c
@@ -1258,8 +1258,11 @@ gles2_renderer_init(struct weston_compositor *ec)
 
 	if (strstr(extensions, "EGL_WL_bind_wayland_display"))
 		ec->has_bind_display = 1;
-	if (ec->has_bind_display)
-		ec->bind_display(ec->egl_display, ec->wl_display);
+	if (ec->has_bind_display) {
+		ret = ec->bind_display(ec->egl_display, ec->wl_display);
+		if (!ret)
+			ec->has_bind_display = 0;
+	}
 
 	glActiveTexture(GL_TEXTURE0);
 
@@ -1292,5 +1295,13 @@ gles2_renderer_init(struct weston_compositor *ec)
 	renderer->base.destroy_surface = gles2_renderer_destroy_surface;
 	ec->renderer = &renderer->base;
 
+	weston_log("GL ES 2 renderer features:\n");
+	weston_log_continue(STAMP_SPACE "read-back format: %s\n",
+			    ec->read_format == GL_BGRA_EXT ? "BGRA" : "RGBA");
+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
+			    ec->has_unpack_subimage ? "yes" : "no");
+	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
+			    ec->has_bind_display ? "yes" : "no");
+
 	return 0;
 }
-- 
1.7.8.6



More information about the wayland-devel mailing list