log: Add some diagnostics to the log
Just a few useful things to get this started: egl vendor and extensions,
gles2 extensions, drm and kms info and just a bit of x11 backend info.
diff --git a/src/compositor.c b/src/compositor.c
index 8f02422..700f31b 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -46,6 +46,7 @@
#include <setjmp.h>
#include <sys/time.h>
#include <time.h>
+#include <ctype.h>
#include <wayland-server.h>
#include "compositor.h"
@@ -2873,6 +2874,26 @@
&compositor_interface, id, compositor);
}
+static void
+log_extensions(const char *name, const char *extensions)
+{
+ const char *p, *end;
+ int l;
+
+ l = weston_log("%s:", name);
+ p = extensions;
+ while (*p) {
+ end = strchrnul(p, ' ');
+ if (l + (end - p) > 78)
+ l = weston_log_continue("\n %.*s", end - p, p);
+ else
+ l += weston_log_continue(" %.*s", end - p, p);
+ for (p = end; isspace(*p); p++)
+ ;
+ }
+ weston_log_continue("\n");
+}
+
WL_EXPORT int
weston_compositor_init(struct weston_compositor *ec,
struct wl_display *display,
@@ -2913,6 +2934,11 @@
wl_display_init_shm(display);
+ weston_log("egl vendor: %s\n",
+ eglQueryString(ec->display, EGL_VENDOR));
+ log_extensions("egl extensions",
+ eglQueryString(ec->display, EGL_EXTENSIONS));
+
ec->image_target_texture_2d =
(void *) eglGetProcAddress("glEGLImageTargetTexture2DOES");
ec->image_target_renderbuffer_storage = (void *)
@@ -2930,6 +2956,8 @@
return -1;
}
+ log_extensions("gles2 extensions", extensions);
+
if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) {
weston_log("GL_EXT_texture_format_BGRA8888 not available\n");
return -1;