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_gs.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_gs.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_gs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_state_gs.c b/src/gallium/drivers/svga/svga_state_gs.c index 618bec248dd..cff11ad5c3f 100644 --- a/src/gallium/drivers/svga/svga_state_gs.c +++ b/src/gallium/drivers/svga/svga_state_gs.c @@ -175,6 +175,8 @@ emit_hw_gs(struct svga_context *svga, unsigned dirty) enum pipe_error ret = PIPE_OK; struct svga_compile_key key; + SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_EMITGS); + /* If there's a user-defined GS, we should have a pointer to a derived * GS. This should have been resolved in update_tgsi_transform(). */ @@ -190,7 +192,7 @@ emit_hw_gs(struct svga_context *svga, unsigned dirty) ret = svga_set_shader(svga, SVGA3D_SHADERTYPE_GS, NULL); svga->state.hw_draw.gs = NULL; } - return ret; + goto done; } /* If there is stream output info for this geometry shader, then use @@ -218,7 +220,7 @@ emit_hw_gs(struct svga_context *svga, unsigned dirty) if (!variant) { ret = compile_gs(svga, gs, &key, &variant); if (ret != PIPE_OK) - return ret; + goto done; /* insert the new variant at head of linked list */ assert(variant); @@ -231,14 +233,16 @@ emit_hw_gs(struct svga_context *svga, unsigned dirty) /* Bind the new variant */ ret = svga_set_shader(svga, SVGA3D_SHADERTYPE_GS, variant); if (ret != PIPE_OK) - return ret; + goto done; svga->rebind.flags.gs = FALSE; svga->dirty |= SVGA_NEW_GS_VARIANT; svga->state.hw_draw.gs = variant; } - return PIPE_OK; +done: + SVGA_STATS_TIME_POP(svga_sws(svga)); + return ret; } struct svga_tracked_state svga_hw_gs = |