diff options
author | Charmaine Lee <[email protected]> | 2016-08-19 08:49:17 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-08-26 06:19:51 -0600 |
commit | 2e1cfcc431471c68ba79c9323716bed7da79c909 (patch) | |
tree | 79fbbe6fb5da05d1f6596eb4944bc94ab832ff6f /src/gallium/drivers/svga/svga_state_fs.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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_state_fs.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_fs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c index 72d591bb1bb..2c7c5bbd346 100644 --- a/src/gallium/drivers/svga/svga_state_fs.c +++ b/src/gallium/drivers/svga/svga_state_fs.c @@ -407,6 +407,8 @@ emit_hw_fs(struct svga_context *svga, unsigned dirty) struct svga_fragment_shader *fs = svga->curr.fs; struct svga_compile_key key; + SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_EMITFS); + /* SVGA_NEW_BLEND * SVGA_NEW_TEXTURE_BINDING * SVGA_NEW_RAST @@ -418,13 +420,13 @@ emit_hw_fs(struct svga_context *svga, unsigned dirty) */ ret = make_fs_key(svga, fs, &key); if (ret != PIPE_OK) - return ret; + goto done; variant = svga_search_shader_key(&fs->base, &key); if (!variant) { ret = compile_fs(svga, fs, &key, &variant); if (ret != PIPE_OK) - return ret; + goto done; } assert(variant); @@ -432,7 +434,7 @@ emit_hw_fs(struct svga_context *svga, unsigned dirty) if (variant != svga->state.hw_draw.fs) { ret = svga_set_shader(svga, SVGA3D_SHADERTYPE_PS, variant); if (ret != PIPE_OK) - return ret; + goto done; svga->rebind.flags.fs = FALSE; @@ -440,7 +442,9 @@ emit_hw_fs(struct svga_context *svga, unsigned dirty) svga->state.hw_draw.fs = variant; } - return PIPE_OK; +done: + SVGA_STATS_TIME_POP(svga_sws(svga)); + return ret; } struct svga_tracked_state svga_hw_fs = |