mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
anv: add tracepoints timestamp mode for empty dispatches
When the runtime is going to potentially emit no dispatch, we need to
have a way to capture a timestamp. Add a new flag for this to tell
whether we don't have a HW instruction to capture the timestamp and
rely on MI_STORE_REGISTER_MEM instead.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: de00fe3f66 ("anv: add BVH building tracking through u_trace")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12382
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32835>
This commit is contained in:
parent
a224105a26
commit
6281b207db
4 changed files with 50 additions and 27 deletions
|
|
@ -112,7 +112,7 @@ iris_utrace_record_ts(struct u_trace *trace, void *cs,
|
||||||
|
|
||||||
const bool is_end_compute =
|
const bool is_end_compute =
|
||||||
cs == NULL &&
|
cs == NULL &&
|
||||||
(flags & INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE_CS);
|
(flags & INTEL_DS_TRACEPOINT_FLAG_END_CS);
|
||||||
if (is_end_compute) {
|
if (is_end_compute) {
|
||||||
assert(ice->utrace.last_compute_walker != NULL);
|
assert(ice->utrace.last_compute_walker != NULL);
|
||||||
batch->screen->vtbl.rewrite_compute_walker_pc(
|
batch->screen->vtbl.rewrite_compute_walker_pc(
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,14 @@ enum intel_ds_tracepoint_flags {
|
||||||
/**
|
/**
|
||||||
* Whether this tracepoint's timestamp is recorded on the compute pipeline.
|
* Whether this tracepoint's timestamp is recorded on the compute pipeline.
|
||||||
*/
|
*/
|
||||||
INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE_CS = BITFIELD_BIT(1),
|
INTEL_DS_TRACEPOINT_FLAG_END_CS = BITFIELD_BIT(1),
|
||||||
|
/**
|
||||||
|
* Whether this tracepoint's timestamp is recorded on the compute pipeline
|
||||||
|
* or from top of pipe if there was no dispatch (useful for acceleration
|
||||||
|
* structure builds where the runtime might choose to not emit anything for
|
||||||
|
* a number of reasons).
|
||||||
|
*/
|
||||||
|
INTEL_DS_TRACEPOINT_FLAG_END_CS_OR_NOOP = BITFIELD_BIT(2),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Convert internal driver PIPE_CONTROL stall bits to intel_ds_stall_flag. */
|
/* Convert internal driver PIPE_CONTROL stall bits to intel_ds_stall_flag. */
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ def define_tracepoints(args):
|
||||||
|
|
||||||
def begin_end_tp(name, tp_args=[], tp_struct=None, tp_print=None,
|
def begin_end_tp(name, tp_args=[], tp_struct=None, tp_print=None,
|
||||||
tp_default_enabled=True, end_pipelined=True,
|
tp_default_enabled=True, end_pipelined=True,
|
||||||
compute=False,
|
compute=False, maybe_compute=False,
|
||||||
need_cs_param=False):
|
need_cs_param=False):
|
||||||
global intel_default_tps
|
global intel_default_tps
|
||||||
if tp_default_enabled:
|
if tp_default_enabled:
|
||||||
|
|
@ -59,7 +59,9 @@ def define_tracepoints(args):
|
||||||
tp_flags = []
|
tp_flags = []
|
||||||
if end_pipelined:
|
if end_pipelined:
|
||||||
if compute:
|
if compute:
|
||||||
tp_flags.append('INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE_CS')
|
tp_flags.append('INTEL_DS_TRACEPOINT_FLAG_END_CS')
|
||||||
|
elif maybe_compute:
|
||||||
|
tp_flags.append('INTEL_DS_TRACEPOINT_FLAG_END_CS_OR_NOOP')
|
||||||
else:
|
else:
|
||||||
tp_flags.append('INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE')
|
tp_flags.append('INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE')
|
||||||
Tracepoint('intel_end_{0}'.format(name),
|
Tracepoint('intel_end_{0}'.format(name),
|
||||||
|
|
@ -199,13 +201,13 @@ def define_tracepoints(args):
|
||||||
need_cs_param=True)
|
need_cs_param=True)
|
||||||
|
|
||||||
begin_end_tp('as_build')
|
begin_end_tp('as_build')
|
||||||
begin_end_tp('as_build_leaves', compute=True)
|
begin_end_tp('as_build_leaves', maybe_compute=True)
|
||||||
begin_end_tp('as_morton_generate', compute=True)
|
begin_end_tp('as_morton_generate', maybe_compute=True)
|
||||||
begin_end_tp('as_morton_sort', compute=True)
|
begin_end_tp('as_morton_sort', maybe_compute=True)
|
||||||
begin_end_tp('as_lbvh_build_internal', compute=True)
|
begin_end_tp('as_lbvh_build_internal', maybe_compute=True)
|
||||||
begin_end_tp('as_ploc_build_internal', compute=True)
|
begin_end_tp('as_ploc_build_internal', maybe_compute=True)
|
||||||
begin_end_tp('as_encode', compute=True)
|
begin_end_tp('as_encode', maybe_compute=True)
|
||||||
begin_end_tp('as_copy', compute=True)
|
begin_end_tp('as_copy', maybe_compute=True)
|
||||||
|
|
||||||
begin_end_tp('rays',
|
begin_end_tp('rays',
|
||||||
tp_args=[Arg(type='uint32_t', var='group_x', c_format='%u'),
|
tp_args=[Arg(type='uint32_t', var='group_x', c_format='%u'),
|
||||||
|
|
|
||||||
|
|
@ -350,21 +350,36 @@ anv_utrace_record_ts(struct u_trace *ut, void *cs,
|
||||||
/* Is this a end of compute trace point? */
|
/* Is this a end of compute trace point? */
|
||||||
const bool is_end_compute =
|
const bool is_end_compute =
|
||||||
cs == NULL &&
|
cs == NULL &&
|
||||||
(flags & INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE_CS);
|
(flags & INTEL_DS_TRACEPOINT_FLAG_END_CS);
|
||||||
|
const bool is_end_compute_or_noop =
|
||||||
assert(device->info->verx10 < 125 ||
|
cs == NULL &&
|
||||||
!is_end_compute ||
|
(flags & INTEL_DS_TRACEPOINT_FLAG_END_CS_OR_NOOP);
|
||||||
cmd_buffer->state.last_indirect_dispatch != NULL ||
|
enum anv_timestamp_capture_type capture_type;
|
||||||
cmd_buffer->state.last_compute_walker != NULL);
|
if (is_end_compute) {
|
||||||
|
assert(device->info->verx10 < 125 ||
|
||||||
enum anv_timestamp_capture_type capture_type =
|
!is_end_compute ||
|
||||||
(device->info->verx10 >= 125 && is_end_compute) ?
|
cmd_buffer->state.last_indirect_dispatch != NULL ||
|
||||||
(cmd_buffer->state.last_indirect_dispatch != NULL ?
|
cmd_buffer->state.last_compute_walker != NULL);
|
||||||
ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH : ANV_TIMESTAMP_REWRITE_COMPUTE_WALKER) :
|
capture_type =
|
||||||
(flags & (INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE |
|
device->info->verx10 >= 125 ?
|
||||||
INTEL_DS_TRACEPOINT_FLAG_END_OF_PIPE_CS)) ?
|
(cmd_buffer->state.last_indirect_dispatch != NULL ?
|
||||||
ANV_TIMESTAMP_CAPTURE_END_OF_PIPE : ANV_TIMESTAMP_CAPTURE_TOP_OF_PIPE;
|
ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH :
|
||||||
|
ANV_TIMESTAMP_REWRITE_COMPUTE_WALKER) :
|
||||||
|
ANV_TIMESTAMP_CAPTURE_END_OF_PIPE;
|
||||||
|
} else if (is_end_compute_or_noop) {
|
||||||
|
capture_type =
|
||||||
|
device->info->verx10 >= 125 ?
|
||||||
|
(cmd_buffer->state.last_indirect_dispatch != NULL ?
|
||||||
|
ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH :
|
||||||
|
(cmd_buffer->state.last_compute_walker != NULL ?
|
||||||
|
ANV_TIMESTAMP_REWRITE_COMPUTE_WALKER :
|
||||||
|
ANV_TIMESTAMP_CAPTURE_TOP_OF_PIPE)) :
|
||||||
|
ANV_TIMESTAMP_CAPTURE_TOP_OF_PIPE;
|
||||||
|
} else {
|
||||||
|
capture_type = (flags & INTEL_DS_TRACEPOINT_FLAG_END_CS) ?
|
||||||
|
ANV_TIMESTAMP_CAPTURE_END_OF_PIPE :
|
||||||
|
ANV_TIMESTAMP_CAPTURE_TOP_OF_PIPE;
|
||||||
|
}
|
||||||
|
|
||||||
void *addr = capture_type == ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH ?
|
void *addr = capture_type == ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH ?
|
||||||
cmd_buffer->state.last_indirect_dispatch :
|
cmd_buffer->state.last_indirect_dispatch :
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue