From 203d88460c46ea9b92c42129a3c6d33c7a2e8a0c Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Tue, 8 Nov 2016 11:54:56 -0800 Subject: svga: add mksstats for context creation Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_context.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index 940ce19a1f5..8640da95e82 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -130,6 +130,8 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags) struct svga_context *svga = NULL; enum pipe_error ret; + SVGA_STATS_TIME_PUSH(svgascreen->sws, SVGA_STATS_TIME_CREATECONTEXT); + svga = CALLOC_STRUCT(svga_context); if (!svga) goto cleanup; @@ -298,7 +300,7 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags) svga->pred.query_id = SVGA3D_INVALID_ID; svga->disable_rasterizer = FALSE; - return &svga->pipe; + goto done; cleanup: svga_destroy_swtnl(svga); @@ -325,7 +327,10 @@ cleanup: util_bitmask_destroy(svga->stream_output_id_bm); util_bitmask_destroy(svga->query_id_bm); FREE(svga); - return NULL; + +done: + SVGA_STATS_TIME_POP(svgascreen->sws); + return svga ? &svga->pipe:NULL; } -- cgit v1.2.3