diff --git a/src/intel/common/intel_measure.c b/src/intel/common/intel_measure.c index 9e50325ebed..52773c1460a 100644 --- a/src/intel/common/intel_measure.c +++ b/src/intel/common/intel_measure.c @@ -215,6 +215,7 @@ intel_measure_init(struct intel_measure_device *device) device->config = NULL; device->frame = 0; + device->release_batch = NULL; pthread_mutex_init(&device->mutex, NULL); list_inithead(&device->queued_snapshots); @@ -661,6 +662,8 @@ intel_measure_gather(struct intel_measure_device *measure_device, batch->index = 0; batch->frame = 0; + if (measure_device->release_batch) + measure_device->release_batch(batch); } intel_measure_print(measure_device, info); diff --git a/src/intel/common/intel_measure.h b/src/intel/common/intel_measure.h index 8283332aafa..e7234268027 100644 --- a/src/intel/common/intel_measure.h +++ b/src/intel/common/intel_measure.h @@ -124,9 +124,13 @@ struct intel_measure_ringbuffer { struct intel_measure_buffered_result results[0]; }; +/* This function will be called when enqueued snapshots have been processed */ +typedef void (*intel_measure_release_batch_cb)(struct intel_measure_batch *base); + struct intel_measure_device { struct intel_measure_config *config; unsigned frame; + intel_measure_release_batch_cb release_batch; /* Holds the list of (iris/anv)_measure_batch snapshots that have been * submitted for rendering, but have not completed.