From: Rob Clark Date: Sat, 28 Mar 2020 17:43:42 +0000 (-0700) Subject: freedreno/a6xx: timestamp logging support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55839fd41c81701c817edc0b227aef363c3f3e36;p=mesa.git freedreno/a6xx: timestamp logging support Signed-off-by: Rob Clark Part-of: --- diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.c b/src/gallium/drivers/freedreno/a6xx/fd6_context.c index 63d7ecedb4f..6eb8e1f979d 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_context.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_context.c @@ -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, diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_query.c b/src/gallium/drivers/freedreno/a6xx/fd6_query.c index 90b93288d2a..d99dd70bde3 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_query.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_query.c @@ -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);