radeonsi: tag perfetto conditions as unlikely

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33207>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-01-24 15:06:49 +01:00 committed by Marge Bot
parent 6c2edb9762
commit e6a16adbdb
4 changed files with 9 additions and 9 deletions

View file

@ -1237,7 +1237,7 @@ static void si_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info
}
}
if (sctx->perfetto_enabled)
if (unlikely(sctx->perfetto_enabled))
trace_si_begin_compute(&sctx->trace);
if (sctx->bo_list_add_all_compute_resources)
@ -1310,7 +1310,7 @@ static void si_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info
sctx->compute_is_busy = true;
sctx->num_compute_calls++;
if (sctx->perfetto_enabled)
if (unlikely(sctx->perfetto_enabled))
trace_si_end_compute(&sctx->trace, info->grid[0], info->grid[1], info->grid[2]);
if (cs_regalloc_hang) {

View file

@ -473,8 +473,8 @@ static void si_flush_all_queues(struct pipe_context *ctx,
if (unlikely(sctx->sqtt && (flags & PIPE_FLUSH_END_OF_FRAME))) {
si_handle_sqtt(sctx, &sctx->gfx_cs);
}
if (sctx->perfetto_enabled)
if (unlikely(sctx->perfetto_enabled))
u_trace_context_process(&sctx->ds.trace_context, flags & PIPE_FLUSH_END_OF_FRAME);
} else {
/* Instead of flushing, create a deferred fence. Constraints:

View file

@ -194,7 +194,7 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
uint64_t start_ts = 0, submission_id = 0;
const bool perfetto = ctx->perfetto_enabled;
if (perfetto) {
if (unlikely(perfetto)) {
start_ts = si_ds_begin_submit(&ctx->ds_queue);
submission_id = ctx->ds_queue.submission_id;
}
@ -202,7 +202,7 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
/* Flush the CS. */
ws->cs_flush(cs, flags, &ctx->last_gfx_fence);
if (perfetto)
if (unlikely(perfetto))
si_ds_end_submit(&ctx->ds_queue, start_ts);
tc_driver_internal_flush_notify(ctx->tc);
@ -228,7 +228,7 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
if (ctx->current_saved_cs)
si_saved_cs_reference(&ctx->current_saved_cs, NULL);
if (perfetto)
if (unlikely(perfetto))
si_utrace_flush(ctx, submission_id);
si_begin_new_gfx_cs(ctx, false);

View file

@ -2085,7 +2085,7 @@ static void si_draw(struct pipe_context *ctx,
si_need_gfx_cs_space(sctx, num_draws, ALT_HIZ_LOGIC ? 8 : 0);
if (sctx->perfetto_enabled)
if (unlikely(sctx->perfetto_enabled))
trace_si_begin_draw(&sctx->trace);
unsigned instance_count = info->instance_count;
@ -2437,7 +2437,7 @@ static void si_draw(struct pipe_context *ctx,
zstex->depth_cleared_level_mask &= ~BITFIELD_BIT(sctx->framebuffer.state.zsbuf->u.tex.level);
}
if (sctx->perfetto_enabled) {
if (unlikely(sctx->perfetto_enabled)) {
/* Just use the draw[0] vertex count for perfetto. */
trace_si_end_draw(&sctx->trace, draws[0].count);
}