summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_screen.c
diff options
context:
space:
mode:
authorSinclair Yeh <[email protected]>2017-05-23 07:42:08 -0600
committerBrian Paul <[email protected]>2017-05-24 11:33:46 -0600
commit1ce3a2723f9739e3e2f0ce5df244a9e2d3bdab85 (patch)
treef9d870d99822b4c363dc8afff4fe98767f06aa54 /src/gallium/drivers/svga/svga_screen.c
parent3ad5325da036adab2a82f4d639e65d3d96a183a7 (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen.c')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c14
1 files changed, 14 insertions, 0 deletions
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);