From: Rob Clark Date: Tue, 21 Nov 2017 18:20:53 +0000 (-0500) Subject: freedreno: track staging and shadow perf ctrs for the HUD X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2697480c923e4c811d9b9f11169de6be55ae38da;p=mesa.git freedreno: track staging and shadow perf ctrs for the HUD Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 2f501cf815b..d8d23ad8539 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -216,6 +216,7 @@ struct fd_context { uint64_t prims_generated; uint64_t draw_calls; uint64_t batch_total, batch_sysmem, batch_gmem, batch_restore; + uint64_t staging_uploads, shadow_uploads; } stats; /* Current batch.. the rule here is that you can deref ctx->batch diff --git a/src/gallium/drivers/freedreno/freedreno_query.c b/src/gallium/drivers/freedreno/freedreno_query.c index 0d7bc9f205b..d76994e5d9e 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.c +++ b/src/gallium/drivers/freedreno/freedreno_query.c @@ -129,6 +129,8 @@ fd_get_driver_query_info(struct pipe_screen *pscreen, {"batches-gmem", FD_QUERY_BATCH_GMEM, {0}}, {"restores", FD_QUERY_BATCH_RESTORE, {0}}, {"prims-emitted", PIPE_QUERY_PRIMITIVES_EMITTED, {0}}, + {"staging", FD_QUERY_STAGING_UPLOADS, {0}}, + {"shadow", FD_QUERY_SHADOW_UPLOADS, {0}}, }; if (!info) diff --git a/src/gallium/drivers/freedreno/freedreno_query.h b/src/gallium/drivers/freedreno/freedreno_query.h index a391a7a0ff8..78717c68701 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.h +++ b/src/gallium/drivers/freedreno/freedreno_query.h @@ -61,6 +61,8 @@ fd_query(struct pipe_query *pq) #define FD_QUERY_BATCH_SYSMEM (PIPE_QUERY_DRIVER_SPECIFIC + 2) /* batches using system memory (GMEM bypass) */ #define FD_QUERY_BATCH_GMEM (PIPE_QUERY_DRIVER_SPECIFIC + 3) /* batches using GMEM */ #define FD_QUERY_BATCH_RESTORE (PIPE_QUERY_DRIVER_SPECIFIC + 4) /* batches requiring GMEM restore */ +#define FD_QUERY_STAGING_UPLOADS (PIPE_QUERY_DRIVER_SPECIFIC + 5) /* texture/buffer uploads using staging blit */ +#define FD_QUERY_SHADOW_UPLOADS (PIPE_QUERY_DRIVER_SPECIFIC + 6) /* texture/buffer uploads that shadowed rsc */ void fd_query_screen_init(struct pipe_screen *pscreen); void fd_query_context_init(struct pipe_context *pctx); diff --git a/src/gallium/drivers/freedreno/freedreno_query_sw.c b/src/gallium/drivers/freedreno/freedreno_query_sw.c index 50965161146..93da2dc08e1 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_sw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_sw.c @@ -67,6 +67,10 @@ read_counter(struct fd_context *ctx, int type) return ctx->stats.batch_gmem; case FD_QUERY_BATCH_RESTORE: return ctx->stats.batch_restore; + case FD_QUERY_STAGING_UPLOADS: + return ctx->stats.staging_uploads; + case FD_QUERY_SHADOW_UPLOADS: + return ctx->stats.shadow_uploads; } return 0; } @@ -79,6 +83,8 @@ is_rate_query(struct fd_query *q) case FD_QUERY_BATCH_SYSMEM: case FD_QUERY_BATCH_GMEM: case FD_QUERY_BATCH_RESTORE: + case FD_QUERY_STAGING_UPLOADS: + case FD_QUERY_SHADOW_UPLOADS: return true; default: return false; @@ -142,6 +148,8 @@ fd_sw_create_query(struct fd_context *ctx, unsigned query_type) case FD_QUERY_BATCH_SYSMEM: case FD_QUERY_BATCH_GMEM: case FD_QUERY_BATCH_RESTORE: + case FD_QUERY_STAGING_UPLOADS: + case FD_QUERY_SHADOW_UPLOADS: break; default: return NULL; diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index e1375d24837..a04c49b7094 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -500,6 +500,7 @@ fd_resource_transfer_map(struct pipe_context *pctx, if (needs_flush && fd_try_shadow_resource(ctx, rsc, level, box)) { needs_flush = busy = false; rebind_resource(ctx, prsc); + ctx->stats.shadow_uploads++; } else { struct fd_resource *staging_rsc; @@ -531,6 +532,8 @@ fd_resource_transfer_map(struct pipe_context *pctx, fd_batch_reference(&write_batch, NULL); + ctx->stats.staging_uploads++; + return buf; } }