mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
freedreno: track staging and shadow perf ctrs for the HUD
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
d848bee50f
commit
2697480c92
5 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue