server: set debug callback

This redirects virglrenderer logs to syslog.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 3 years ago
parent 31edb3caf0
commit 425658e792
  1. 9
      server/render_virgl.c

@ -59,6 +59,14 @@ render_virgl_lookup_context(uint32_t ctx_id)
return ctx; return ctx;
} }
static void
render_virgl_debug_callback(const char *fmt, va_list ap)
{
char buf[1024];
vsnprintf(buf, sizeof(buf), fmt, ap);
render_log(buf);
}
static void static void
render_virgl_cb_write_context_fence(UNUSED void *cookie, render_virgl_cb_write_context_fence(UNUSED void *cookie,
uint32_t ctx_id, uint32_t ctx_id,
@ -130,6 +138,7 @@ render_virgl_init(uint32_t init_flags)
} }
} else { } else {
render_virgl_lock_dispatch(); render_virgl_lock_dispatch();
virgl_set_debug_callback(render_virgl_debug_callback);
int ret = virgl_renderer_init(virgl, init_flags, int ret = virgl_renderer_init(virgl, init_flags,
(struct virgl_renderer_callbacks *)&render_virgl_cbs); (struct virgl_renderer_callbacks *)&render_virgl_cbs);
render_virgl_unlock_dispatch(); render_virgl_unlock_dispatch();

Loading…
Cancel
Save