From 4e4167d3a01bd677f73a51a90d9ee336149dd5d8 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 11 Jun 2012 14:06:05 +0300 Subject: [PATCH] compositor: log more EGL and GL info Signed-off-by: Pekka Paalanen --- src/compositor.c | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 6468e43d..aa862cd0 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2906,7 +2906,8 @@ log_extensions(const char *name, const char *extensions) while (*p) { end = strchrnul(p, ' '); if (l + (end - p) > 78) - l = weston_log_continue("\n %.*s", end - p, p); + l = weston_log_continue("\n" STAMP_SPACE "%.*s", + end - p, p); else l += weston_log_continue(" %.*s", end - p, p); for (p = end; isspace(*p); p++) @@ -2915,6 +2916,39 @@ log_extensions(const char *name, const char *extensions) weston_log_continue("\n"); } +static void +log_egl_gl_info(EGLDisplay egldpy) +{ + const char *str; + + str = eglQueryString(egldpy, EGL_VERSION); + weston_log("EGL version: %s\n", str ? str : "(null)"); + + str = eglQueryString(egldpy, EGL_VENDOR); + weston_log("EGL vendor: %s\n", str ? str : "(null)"); + + str = eglQueryString(egldpy, EGL_CLIENT_APIS); + weston_log("EGL client APIs: %s\n", str ? str : "(null)"); + + str = eglQueryString(egldpy, EGL_EXTENSIONS); + log_extensions("EGL extensions", str ? str : "(null)"); + + str = (char *)glGetString(GL_VERSION); + weston_log("GL version: %s\n", str ? str : "(null)"); + + str = (char *)glGetString(GL_SHADING_LANGUAGE_VERSION); + weston_log("GLSL version: %s\n", str ? str : "(null)"); + + str = (char *)glGetString(GL_VENDOR); + weston_log("GL vendor: %s\n", str ? str : "(null)"); + + str = (char *)glGetString(GL_RENDERER); + weston_log("GL renderer: %s\n", str ? str : "(null)"); + + str = (char *)glGetString(GL_EXTENSIONS); + log_extensions("GL extensions", str ? str : "(null)"); +} + WL_EXPORT int weston_compositor_init(struct weston_compositor *ec, struct wl_display *display, @@ -2955,10 +2989,7 @@ weston_compositor_init(struct weston_compositor *ec, 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)); + log_egl_gl_info(ec->display); ec->image_target_texture_2d = (void *) eglGetProcAddress("glEGLImageTargetTexture2DOES"); @@ -2977,8 +3008,6 @@ weston_compositor_init(struct weston_compositor *ec, 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;