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.
This commit is contained in:
@@ -1018,6 +1018,8 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weston_log("using %s\n", filename);
|
||||||
|
|
||||||
ec->drm.fd = fd;
|
ec->drm.fd = fd;
|
||||||
ec->gbm = gbm_create_device(ec->drm.fd);
|
ec->gbm = gbm_create_device(ec->drm.fd);
|
||||||
ec->base.display = eglGetDisplay(ec->gbm);
|
ec->base.display = eglGetDisplay(ec->gbm);
|
||||||
@@ -1350,6 +1352,12 @@ create_output_for_connector(struct drm_compositor *ec,
|
|||||||
output->base.set_dpms = drm_set_dpms;
|
output->base.set_dpms = drm_set_dpms;
|
||||||
output->base.switch_mode = drm_output_switch_mode;
|
output->base.switch_mode = drm_output_switch_mode;
|
||||||
|
|
||||||
|
weston_log("kms connector %d, crtc %d at mode %dx%d@%.1f\n",
|
||||||
|
output->connector_id, output->crtc_id,
|
||||||
|
output->base.current->width,
|
||||||
|
output->base.current->height,
|
||||||
|
output->base.current->refresh / 1000.0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_surface:
|
err_surface:
|
||||||
@@ -1748,6 +1756,8 @@ drm_compositor_create(struct wl_display *display,
|
|||||||
struct wl_event_loop *loop;
|
struct wl_event_loop *loop;
|
||||||
uint32_t key;
|
uint32_t key;
|
||||||
|
|
||||||
|
weston_log("initializing drm backend\n");
|
||||||
|
|
||||||
ec = malloc(sizeof *ec);
|
ec = malloc(sizeof *ec);
|
||||||
if (ec == NULL)
|
if (ec == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -523,6 +523,9 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y,
|
|||||||
|
|
||||||
wl_list_insert(c->base.output_list.prev, &output->base.link);
|
wl_list_insert(c->base.output_list.prev, &output->base.link);
|
||||||
|
|
||||||
|
weston_log("x11 output %dx%d, window id %d\n",
|
||||||
|
width, height, output->window);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -865,6 +868,8 @@ x11_compositor_create(struct wl_display *display,
|
|||||||
xcb_screen_iterator_t s;
|
xcb_screen_iterator_t s;
|
||||||
int i, x;
|
int i, x;
|
||||||
|
|
||||||
|
weston_log("initializing x11 backend\n");
|
||||||
|
|
||||||
c = malloc(sizeof *c);
|
c = malloc(sizeof *c);
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <wayland-server.h>
|
#include <wayland-server.h>
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
@@ -2873,6 +2874,26 @@ compositor_bind(struct wl_client *client,
|
|||||||
&compositor_interface, id, compositor);
|
&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
|
WL_EXPORT int
|
||||||
weston_compositor_init(struct weston_compositor *ec,
|
weston_compositor_init(struct weston_compositor *ec,
|
||||||
struct wl_display *display,
|
struct wl_display *display,
|
||||||
@@ -2913,6 +2934,11 @@ weston_compositor_init(struct weston_compositor *ec,
|
|||||||
|
|
||||||
wl_display_init_shm(display);
|
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 =
|
ec->image_target_texture_2d =
|
||||||
(void *) eglGetProcAddress("glEGLImageTargetTexture2DOES");
|
(void *) eglGetProcAddress("glEGLImageTargetTexture2DOES");
|
||||||
ec->image_target_renderbuffer_storage = (void *)
|
ec->image_target_renderbuffer_storage = (void *)
|
||||||
@@ -2930,6 +2956,8 @@ weston_compositor_init(struct weston_compositor *ec,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log_extensions("gles2 extensions", extensions);
|
||||||
|
|
||||||
if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) {
|
if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) {
|
||||||
weston_log("GL_EXT_texture_format_BGRA8888 not available\n");
|
weston_log("GL_EXT_texture_format_BGRA8888 not available\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user