anv: fix frame count reporting in INTEL_MEASURE

Report frame count at CB submit time, instead of CB build time.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25235>
This commit is contained in:
Felix DeGrood
2023-09-13 22:27:33 +00:00
committed by Marge Bot
parent 6f85e6b06b
commit b9c9fb7259
+2 -9
View File
@@ -113,20 +113,12 @@ anv_measure_start_snapshot(struct anv_cmd_buffer *cmd_buffer,
struct intel_measure_device *measure_device = &device->measure_device;
struct intel_measure_config *config = config_from_command_buffer(cmd_buffer);
const unsigned device_frame = measure_device->frame;
/* if the command buffer is not associated with a frame, associate it with
* the most recent acquired frame
*/
if (measure->base.frame == 0)
measure->base.frame = device_frame;
unsigned index = measure->base.index++;
if (event_name == NULL)
event_name = intel_measure_snapshot_string(type);
if (config->cpu_measure) {
intel_measure_print_cpu_result(measure->base.frame,
intel_measure_print_cpu_result(measure_device->frame,
measure->base.batch_count,
measure->base.batch_size,
index/2,
@@ -388,6 +380,7 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
static unsigned cmd_buffer_count = 0;
base->batch_count = p_atomic_inc_return(&cmd_buffer_count);
base->batch_size = cmd_buffer->total_batch_size;
base->frame = measure_device->frame;
if (base->index %2 == 1) {
anv_measure_end_snapshot(cmd_buffer, base->event_count);