From 1ce3a2723f9739e3e2f0ce5df244a9e2d3bdab85 Mon Sep 17 00:00:00 2001 From: Sinclair Yeh Date: Tue, 23 May 2017 07:42:08 -0600 Subject: svga: Add the ability to log messages to vmware.log on the host. For now this capability only exists in the SVGA driver but can be exported later if other modules, e.g. winsys, wants to use it for logging. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_screen.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gallium/drivers/svga/svga_screen.c') diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index b79d9e9a767..866eef13930 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -23,6 +23,7 @@ * **********************************************************/ +#include "git_sha1.h" /* For MESA_GIT_SHA1 */ #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_inlines.h" @@ -45,6 +46,10 @@ /* NOTE: this constant may get moved into a svga3d*.h header file */ #define SVGA3D_DX_MAX_RESOURCE_SIZE (128 * 1024 * 1024) +#ifndef MESA_GIT_SHA1 +#define MESA_GIT_SHA1 "(unknown git revision)" +#endif + #ifdef DEBUG int SVGA_DEBUG = 0; @@ -1124,6 +1129,15 @@ svga_screen_create(struct svga_winsys_screen *sws) svga_screen_cache_init(svgascreen); + /* Log Version to Host */ + util_snprintf(host_log, sizeof(host_log) - strlen(HOST_LOG_PREFIX), + "%s%s", HOST_LOG_PREFIX, svga_get_name(screen)); + svga_host_log(host_log); + + util_snprintf(host_log, sizeof(host_log) - strlen(HOST_LOG_PREFIX), + "%s%s (%s)", HOST_LOG_PREFIX, PACKAGE_VERSION, MESA_GIT_SHA1); + svga_host_log(host_log); + return screen; error2: FREE(svgascreen); -- cgit v1.2.3