gles2: check eglBindWaylandDisplayWL return value

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@gmail.com>
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 @@
 
 	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 @@
 	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;
 }