summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_tgsi.c
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2016-08-19 08:49:17 -0600
committerBrian Paul <[email protected]>2016-08-26 06:19:51 -0600
commit2e1cfcc431471c68ba79c9323716bed7da79c909 (patch)
tree79fbbe6fb5da05d1f6596eb4944bc94ab832ff6f /src/gallium/drivers/svga/svga_tgsi.c
parent479199180871432030d3eebc2822bd7cb3dc6fd6 (diff)
svga: add guest statistic gathering interface
With this patch, guest statistic gathering interface is added to svga winsys interface that can be used to gather svga driver statistic. The winsys module can then share the statistic info with the VMX host via the mksstats interface. The statistic enums used in the svga driver are defined in svga_stats_count and svga_stats_time in svga_winsys.h Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_tgsi.c')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi.c b/src/gallium/drivers/svga/svga_tgsi.c
index 7396ad08e27..7cbd5166900 100644
--- a/src/gallium/drivers/svga/svga_tgsi.c
+++ b/src/gallium/drivers/svga/svga_tgsi.c
@@ -173,6 +173,8 @@ svga_tgsi_vgpu9_translate(struct svga_context *svga,
struct svga_shader_variant *variant = NULL;
struct svga_shader_emitter emit;
+ SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_TGSIVGPU9TRANSLATE);
+
memset(&emit, 0, sizeof(emit));
emit.size = 1024;
@@ -252,11 +254,15 @@ svga_tgsi_vgpu9_translate(struct svga_context *svga,
}
#endif
- return variant;
+ goto done;
- fail:
+fail:
FREE(variant);
if (emit.buf != err_buf)
FREE(emit.buf);
- return NULL;
+ variant = NULL;
+
+done:
+ SVGA_STATS_TIME_POP(svga_sws(svga));
+ return variant;
}