intel: stop tracking submission state in INTEL_MEASURE
With secondary command buffers, it is inconvenient to track whether a batch has been submitted and needs to be gathered. Instead, always check for completed snapshots before destroying a command buffer. Acked-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7354>
This commit is contained in:
parent
f7d4ebbf86
commit
9eacbfaf7b
|
@ -347,7 +347,6 @@ iris_measure_gather(struct iris_context *ice)
|
||||||
list_first_entry(&measure_device->queued_snapshots,
|
list_first_entry(&measure_device->queued_snapshots,
|
||||||
struct iris_measure_batch, link);
|
struct iris_measure_batch, link);
|
||||||
|
|
||||||
assert(measure->base.submitted == true);
|
|
||||||
if (!iris_measure_ready(measure)) {
|
if (!iris_measure_ready(measure)) {
|
||||||
/* command buffer has begun execution on the gpu, but has not
|
/* command buffer has begun execution on the gpu, but has not
|
||||||
* completed.
|
* completed.
|
||||||
|
@ -375,7 +374,6 @@ iris_measure_gather(struct iris_context *ice)
|
||||||
iris_bo_unmap(measure->bo);
|
iris_bo_unmap(measure->bo);
|
||||||
measure->base.index = 0;
|
measure->base.index = 0;
|
||||||
measure->base.frame = 0;
|
measure->base.frame = 0;
|
||||||
measure->base.submitted = false;
|
|
||||||
iris_destroy_batch_measure(measure);
|
iris_destroy_batch_measure(measure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +424,6 @@ iris_measure_batch_end(struct iris_context *ice, struct iris_batch *batch)
|
||||||
/* enqueue snapshot for gathering */
|
/* enqueue snapshot for gathering */
|
||||||
pthread_mutex_lock(&measure_device->mutex);
|
pthread_mutex_lock(&measure_device->mutex);
|
||||||
list_addtail(&iris_measure_batch->link, &measure_device->queued_snapshots);
|
list_addtail(&iris_measure_batch->link, &measure_device->queued_snapshots);
|
||||||
measure_batch->submitted = true;
|
|
||||||
batch->measure = NULL;
|
batch->measure = NULL;
|
||||||
pthread_mutex_unlock(&measure_device->mutex);
|
pthread_mutex_unlock(&measure_device->mutex);
|
||||||
/* init new measure_batch */
|
/* init new measure_batch */
|
||||||
|
@ -448,15 +445,6 @@ iris_measure_frame_end(struct iris_context *ice)
|
||||||
|
|
||||||
if (!config)
|
if (!config)
|
||||||
return;
|
return;
|
||||||
/* check that the snapshots were submitted */
|
|
||||||
for (int i = 0; i < IRIS_BATCH_COUNT; ++i) {
|
|
||||||
struct intel_measure_batch *measure_batch =
|
|
||||||
&ice->batches[i].measure->base;
|
|
||||||
|
|
||||||
if (measure_batch != NULL) {
|
|
||||||
assert(measure_batch->submitted || measure_batch->index == 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* increment frame counter */
|
/* increment frame counter */
|
||||||
intel_measure_frame_transition(p_atomic_inc_return(&measure_device->frame));
|
intel_measure_frame_transition(p_atomic_inc_return(&measure_device->frame));
|
||||||
|
|
|
@ -139,7 +139,6 @@ struct intel_measure_batch {
|
||||||
unsigned index;
|
unsigned index;
|
||||||
unsigned frame, batch_count, event_count;
|
unsigned frame, batch_count, event_count;
|
||||||
uintptr_t framebuffer;
|
uintptr_t framebuffer;
|
||||||
bool submitted;
|
|
||||||
struct intel_measure_snapshot snapshots[0];
|
struct intel_measure_snapshot snapshots[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,6 @@ anv_measure_gather(struct anv_device *device)
|
||||||
list_first_entry(&measure_device->queued_snapshots,
|
list_first_entry(&measure_device->queued_snapshots,
|
||||||
struct anv_measure_batch, link);
|
struct anv_measure_batch, link);
|
||||||
|
|
||||||
assert(measure->base.submitted == true);
|
|
||||||
if (!anv_measure_ready(device, measure)) {
|
if (!anv_measure_ready(device, measure)) {
|
||||||
/* command buffer has begun execution on the gpu, but has not
|
/* command buffer has begun execution on the gpu, but has not
|
||||||
* completed.
|
* completed.
|
||||||
|
@ -183,7 +182,6 @@ anv_measure_gather(struct anv_device *device)
|
||||||
anv_gem_munmap(device, map, measure->base.index * sizeof(uint64_t));
|
anv_gem_munmap(device, map, measure->base.index * sizeof(uint64_t));
|
||||||
measure->base.index = 0;
|
measure->base.index = 0;
|
||||||
measure->base.frame = 0;
|
measure->base.frame = 0;
|
||||||
measure->base.submitted = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_measure_print(measure_device, &device->info);
|
intel_measure_print(measure_device, &device->info);
|
||||||
|
@ -366,16 +364,11 @@ anv_measure_reset(struct anv_cmd_buffer *cmd_buffer)
|
||||||
return anv_measure_init(cmd_buffer);
|
return anv_measure_init(cmd_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (measure->base.submitted) {
|
/* it is possible that the command buffer contains snapshots that have not
|
||||||
/* This snapshot was submitted, but was never gathered after rendering.
|
* yet been processed
|
||||||
* Since the client is resetting the command buffer, rendering is
|
*/
|
||||||
* certainly complete.
|
anv_measure_gather(device);
|
||||||
*/
|
|
||||||
assert (anv_measure_ready(device, measure));
|
|
||||||
anv_measure_gather(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(!measure->base.submitted);
|
|
||||||
assert(cmd_buffer->device != NULL);
|
assert(cmd_buffer->device != NULL);
|
||||||
|
|
||||||
measure->base.index = 0;
|
measure->base.index = 0;
|
||||||
|
@ -405,15 +398,10 @@ anv_measure_destroy(struct anv_cmd_buffer *cmd_buffer)
|
||||||
if (measure == NULL)
|
if (measure == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (measure->base.submitted) {
|
/* it is possible that the command buffer contains snapshots that have not
|
||||||
/* This snapshot was submitted, but was never gathered after rendering.
|
* yet been processed
|
||||||
* Since the client is destroying the command buffer, rendering is
|
*/
|
||||||
* certainly complete.
|
anv_measure_gather(device);
|
||||||
*/
|
|
||||||
assert(anv_measure_ready(device, measure));
|
|
||||||
anv_measure_gather(device);
|
|
||||||
assert(!measure->base.submitted);
|
|
||||||
}
|
|
||||||
|
|
||||||
anv_device_release_bo(device, measure->bo);
|
anv_device_release_bo(device, measure->bo);
|
||||||
vk_free(&cmd_buffer->pool->alloc, measure);
|
vk_free(&cmd_buffer->pool->alloc, measure);
|
||||||
|
@ -455,7 +443,6 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
|
||||||
return;
|
return;
|
||||||
if (measure == NULL)
|
if (measure == NULL)
|
||||||
return;
|
return;
|
||||||
assert(measure->base.submitted == false);
|
|
||||||
|
|
||||||
if (measure->base.index == 0)
|
if (measure->base.index == 0)
|
||||||
/* no snapshots were started */
|
/* no snapshots were started */
|
||||||
|
@ -470,10 +457,6 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
|
||||||
measure->base.event_count = 0;
|
measure->base.event_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* verify that snapshots are submitted once */
|
|
||||||
assert(measure->base.submitted == false);
|
|
||||||
measure->base.submitted = true;
|
|
||||||
|
|
||||||
/* add to the list of submitted snapshots */
|
/* add to the list of submitted snapshots */
|
||||||
pthread_mutex_lock(&measure_device->mutex);
|
pthread_mutex_lock(&measure_device->mutex);
|
||||||
list_addtail(&measure->link, &measure_device->queued_snapshots);
|
list_addtail(&measure->link, &measure_device->queued_snapshots);
|
||||||
|
|
Loading…
Reference in New Issue