freedreno/a6xx: timestamp logging support
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4366>
This commit is contained in:
@@ -152,6 +152,7 @@ PC_UNKNOWN_9805:
|
||||
fd6_texture_init(pctx);
|
||||
fd6_prog_init(pctx);
|
||||
fd6_emit_init(pctx);
|
||||
fd6_query_context_init(pctx);
|
||||
|
||||
pctx = fd_context_init(&fd6_ctx->base, pscreen, primtypes, priv, flags);
|
||||
if (!pctx)
|
||||
@@ -179,7 +180,6 @@ PC_UNKNOWN_9805:
|
||||
|
||||
fd_context_setup_common_vbos(&fd6_ctx->base);
|
||||
|
||||
fd6_query_context_init(pctx);
|
||||
fd6_blitter_init(pctx);
|
||||
|
||||
fd6_ctx->border_color_uploader = u_upload_create(pctx, 4096, 0,
|
||||
|
||||
@@ -204,8 +204,19 @@ timestamp_pause(struct fd_acc_query *aq, struct fd_batch *batch)
|
||||
/* We captured a timestamp in timestamp_resume(), nothing to do here. */
|
||||
}
|
||||
|
||||
/* timestamp logging for fd_log(): */
|
||||
static void
|
||||
record_timestamp(struct fd_ringbuffer *ring, struct fd_bo *bo, unsigned offset)
|
||||
{
|
||||
OUT_PKT7(ring, CP_EVENT_WRITE, 4);
|
||||
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(CACHE_FLUSH_AND_INV_EVENT) |
|
||||
CP_EVENT_WRITE_0_TIMESTAMP);
|
||||
OUT_RELOCW(ring, bo, offset, 0, 0);
|
||||
OUT_RING(ring, 0x00000000);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
ticks_to_ns(uint32_t ts)
|
||||
ticks_to_ns(uint64_t ts)
|
||||
{
|
||||
/* This is based on the 19.2MHz always-on rbbm timer.
|
||||
*
|
||||
@@ -637,6 +648,9 @@ fd6_query_context_init(struct pipe_context *pctx)
|
||||
ctx->create_query = fd_acc_create_query;
|
||||
ctx->query_set_stage = fd_acc_query_set_stage;
|
||||
|
||||
ctx->record_timestamp = record_timestamp;
|
||||
ctx->ts_to_ns = ticks_to_ns;
|
||||
|
||||
pctx->create_batch_query = fd6_create_batch_query;
|
||||
|
||||
fd_acc_query_register_provider(pctx, &occlusion_counter);
|
||||
|
||||
Reference in New Issue
Block a user