mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-12 00:58:22 +02:00
freedreno/perfetto: Add non-draw stage
Make it easier to see the scope of non-draw passes, rather than only showing individual compute/blit jobs. Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42013>
This commit is contained in:
parent
b9e2da183e
commit
87b34e03ae
4 changed files with 37 additions and 7 deletions
|
|
@ -708,14 +708,11 @@ fd_gmem_render_tiles(struct fd_batch *batch)
|
|||
if (!(batch->cleared || batch->num_draws))
|
||||
sysmem = true;
|
||||
|
||||
if (!batch->nondraw) {
|
||||
#if HAVE_PERFETTO
|
||||
/* For non-draw batches, we don't really have a good place to
|
||||
* match up the api event submit-id to the on-gpu rendering,
|
||||
* so skip this for non-draw batches.
|
||||
*/
|
||||
fd_perfetto_submit(ctx);
|
||||
fd_perfetto_submit(ctx);
|
||||
#endif
|
||||
|
||||
if (!batch->nondraw) {
|
||||
trace_flush_batch(&batch->trace, batch->gmem, batch, batch->cleared,
|
||||
batch->gmem_reason, batch->num_draws);
|
||||
trace_framebuffer_state(&batch->trace, batch->gmem, pfb);
|
||||
|
|
@ -760,8 +757,11 @@ fd_gmem_render_tiles(struct fd_batch *batch)
|
|||
|
||||
if (batch->nondraw) {
|
||||
DBG("%p: rendering non-draw", batch);
|
||||
if (!fd_ringbuffer_empty(batch->draw))
|
||||
if (!fd_ringbuffer_empty(batch->draw)) {
|
||||
trace_start_nondraw(&batch->trace, batch->gmem, ctx->submit_count);
|
||||
render_sysmem(batch);
|
||||
trace_end_nondraw(&batch->trace, batch->gmem);
|
||||
}
|
||||
ctx->stats.batch_nondraw++;
|
||||
} else if (sysmem) {
|
||||
trace_render_sysmem(&batch->trace, batch->gmem);
|
||||
|
|
|
|||
|
|
@ -187,6 +187,8 @@ stage_end(struct pipe_context *pctx, uint64_t ts_ns, enum fd_stage_id stage)
|
|||
data->set_name("binHeight");
|
||||
data->set_value(std::to_string(p->binh));
|
||||
}
|
||||
} else if (stage == NONDRAW_STAGE_ID) {
|
||||
event->set_submission_id(p->submit_id);
|
||||
} else if (stage == COMPUTE_STAGE_ID) {
|
||||
{
|
||||
auto data = event->add_extra_data();
|
||||
|
|
@ -368,6 +370,28 @@ fd_end_render_pass(struct pipe_context *pctx, uint64_t ts_ns,
|
|||
stage_end(pctx, ts_ns, SURFACE_STAGE_ID);
|
||||
}
|
||||
|
||||
void
|
||||
fd_start_nondraw(struct pipe_context *pctx, uint64_t ts_ns,
|
||||
uint16_t tp_idx, const void *flush_data,
|
||||
const struct trace_start_nondraw *payload,
|
||||
const void *indirect_data)
|
||||
{
|
||||
stage_start(pctx, ts_ns, NONDRAW_STAGE_ID);
|
||||
|
||||
struct fd_perfetto_state *p = &fd_context(pctx)->perfetto;
|
||||
|
||||
p->submit_id = payload->submit_id;
|
||||
}
|
||||
|
||||
void
|
||||
fd_end_nondraw(struct pipe_context *pctx, uint64_t ts_ns,
|
||||
uint16_t tp_idx, const void *flush_data,
|
||||
const struct trace_end_nondraw *payload,
|
||||
const void *indirect_data)
|
||||
{
|
||||
stage_end(pctx, ts_ns, NONDRAW_STAGE_ID);
|
||||
}
|
||||
|
||||
void
|
||||
fd_start_binning_ib(struct pipe_context *pctx, uint64_t ts_ns,
|
||||
uint16_t tp_idx, const void *flush_data,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ extern "C" {
|
|||
*/
|
||||
enum fd_stage_id {
|
||||
SURFACE_STAGE_ID, /* Surface is a sort of meta-stage for render-target info */
|
||||
NONDRAW_STAGE_ID,
|
||||
BINNING_STAGE_ID,
|
||||
GMEM_STAGE_ID,
|
||||
BYPASS_STAGE_ID,
|
||||
|
|
@ -37,6 +38,7 @@ static const struct {
|
|||
const char *desc;
|
||||
} stages[] = {
|
||||
[SURFACE_STAGE_ID] = {"Surface"},
|
||||
[NONDRAW_STAGE_ID] = {"Non-draw"},
|
||||
[BINNING_STAGE_ID] = {"Binning", "Perform Visibility pass and determine target bins"},
|
||||
[GMEM_STAGE_ID] = {"Render", "Rendering to GMEM"},
|
||||
[BYPASS_STAGE_ID] = {"Render", "Rendering to system memory"},
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ begin_end_tp('render_pass',
|
|||
TracepointArg(type='uint16_t', var='binh', c_format='%u')],
|
||||
)
|
||||
|
||||
begin_end_tp('nondraw',
|
||||
args=[TracepointArg(type='uint32_t', var='submit_id', c_format='%u')],
|
||||
)
|
||||
|
||||
begin_end_tp('binning_ib')
|
||||
begin_end_tp('vsc_overflow_test')
|
||||
begin_end_tp('prologue')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue