diff options
author | Charmaine Lee <charmainel@vmware.com> | 2016-08-19 08:49:17 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2016-08-26 06:19:51 -0600 |
commit | 2e1cfcc431471c68ba79c9323716bed7da79c909 (patch) | |
tree | 79fbbe6fb5da05d1f6596eb4944bc94ab832ff6f /src/gallium/drivers/svga/svga_shader.c | |
parent | 479199180871432030d3eebc2822bd7cb3dc6fd6 (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 <brianp@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_shader.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_shader.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_shader.c b/src/gallium/drivers/svga/svga_shader.c index 9e37e237a7d..9ba60555bf0 100644 --- a/src/gallium/drivers/svga/svga_shader.c +++ b/src/gallium/drivers/svga/svga_shader.c @@ -350,19 +350,22 @@ svga_define_shader(struct svga_context *svga, unsigned codeLen = variant->nr_tokens * sizeof(variant->tokens[0]); enum pipe_error ret; + SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_DEFINESHADER); + variant->id = UTIL_BITMASK_INVALID_INDEX; if (svga_have_gb_objects(svga)) { if (svga_have_vgpu10(svga)) - return define_gb_shader_vgpu10(svga, type, variant, codeLen); + ret = define_gb_shader_vgpu10(svga, type, variant, codeLen); else - return define_gb_shader_vgpu9(svga, type, variant, codeLen); + ret = define_gb_shader_vgpu9(svga, type, variant, codeLen); } else { /* Allocate an integer ID for the shader */ variant->id = util_bitmask_add(svga->shader_id_bm); if (variant->id == UTIL_BITMASK_INVALID_INDEX) { - return PIPE_ERROR_OUT_OF_MEMORY; + ret = PIPE_ERROR_OUT_OF_MEMORY; + goto done; } /* Issue SVGA3D device command to define the shader */ @@ -379,6 +382,8 @@ svga_define_shader(struct svga_context *svga, } } +done: + SVGA_STATS_TIME_POP(svga_sws(svga)); return ret; } |