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_draw.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_draw.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_draw.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c index 9d3f9eff29e..9e0dfe514e4 100644 --- a/src/gallium/drivers/svga/svga_draw.c +++ b/src/gallium/drivers/svga/svga_draw.c @@ -703,11 +703,17 @@ draw_vgpu10(struct svga_hwtnl *hwtnl, enum pipe_error svga_hwtnl_flush(struct svga_hwtnl *hwtnl) { + enum pipe_error ret = PIPE_OK; + + SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLFLUSH); + if (!svga_have_vgpu10(hwtnl->svga) && hwtnl->cmd.prim_count) { /* we only queue up primitive for VGPU9 */ - return draw_vgpu9(hwtnl); + ret = draw_vgpu9(hwtnl); } - return PIPE_OK; + + SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws); + return ret; } @@ -881,6 +887,8 @@ svga_hwtnl_prim(struct svga_hwtnl *hwtnl, { enum pipe_error ret = PIPE_OK; + SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLPRIM); + if (svga_have_vgpu10(hwtnl->svga)) { /* draw immediately */ ret = draw_vgpu10(hwtnl, range, vcount, min_index, max_index, ib, @@ -905,7 +913,7 @@ svga_hwtnl_prim(struct svga_hwtnl *hwtnl, if (hwtnl->cmd.prim_count + 1 >= QSZ) { ret = svga_hwtnl_flush(hwtnl); if (ret != PIPE_OK) - return ret; + goto done; } /* min/max indices are relative to bias */ @@ -919,5 +927,7 @@ svga_hwtnl_prim(struct svga_hwtnl *hwtnl, hwtnl->cmd.prim_count++; } +done: + SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws); return ret; } |