summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorMark Janes <markjanes@swizzler.org>2021-01-05 21:06:13 -0800
committerMark Janes <markjanes@swizzler.org>2021-02-01 17:24:57 -0800
commit9eacbfaf7be7cc5cac03c60fa64d558ea693a03b (patch)
treeae97a7ea757b4fb42a96f39304273f1eba5d949c /src/intel
parentf7d4ebbf86477a5788ef741b75507e5f898db559 (diff)
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>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/common/intel_measure.h1
-rw-r--r--src/intel/vulkan/anv_measure.c33
2 files changed, 8 insertions, 26 deletions
diff --git a/src/intel/common/intel_measure.h b/src/intel/common/intel_measure.h
index 2e28367748c..b2e0389df1f 100644
--- a/src/intel/common/intel_measure.h
+++ b/src/intel/common/intel_measure.h
@@ -139,7 +139,6 @@ struct intel_measure_batch {
unsigned index;
unsigned frame, batch_count, event_count;
uintptr_t framebuffer;
- bool submitted;
struct intel_measure_snapshot snapshots[0];
};
diff --git a/src/intel/vulkan/anv_measure.c b/src/intel/vulkan/anv_measure.c
index faec7c18058..76ca02a7ead 100644
--- a/src/intel/vulkan/anv_measure.c
+++ b/src/intel/vulkan/anv_measure.c
@@ -154,7 +154,6 @@ anv_measure_gather(struct anv_device *device)
list_first_entry(&measure_device->queued_snapshots,
struct anv_measure_batch, link);
- assert(measure->base.submitted == true);
if (!anv_measure_ready(device, measure)) {
/* command buffer has begun execution on the gpu, but has not
* completed.
@@ -183,7 +182,6 @@ anv_measure_gather(struct anv_device *device)
anv_gem_munmap(device, map, measure->base.index * sizeof(uint64_t));
measure->base.index = 0;
measure->base.frame = 0;
- measure->base.submitted = false;
}
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);
}
- if (measure->base.submitted) {
- /* This snapshot was submitted, but was never gathered after rendering.
- * Since the client is resetting the command buffer, rendering is
- * certainly complete.
- */
- assert (anv_measure_ready(device, measure));
- anv_measure_gather(device);
- }
+ /* it is possible that the command buffer contains snapshots that have not
+ * yet been processed
+ */
+ anv_measure_gather(device);
- assert(!measure->base.submitted);
assert(cmd_buffer->device != NULL);
measure->base.index = 0;
@@ -405,15 +398,10 @@ anv_measure_destroy(struct anv_cmd_buffer *cmd_buffer)
if (measure == NULL)
return;
- if (measure->base.submitted) {
- /* This snapshot was submitted, but was never gathered after rendering.
- * Since the client is destroying the command buffer, rendering is
- * certainly complete.
- */
- assert(anv_measure_ready(device, measure));
- anv_measure_gather(device);
- assert(!measure->base.submitted);
- }
+ /* it is possible that the command buffer contains snapshots that have not
+ * yet been processed
+ */
+ anv_measure_gather(device);
anv_device_release_bo(device, measure->bo);
vk_free(&cmd_buffer->pool->alloc, measure);
@@ -455,7 +443,6 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
return;
if (measure == NULL)
return;
- assert(measure->base.submitted == false);
if (measure->base.index == 0)
/* no snapshots were started */
@@ -470,10 +457,6 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
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 */
pthread_mutex_lock(&measure_device->mutex);
list_addtail(&measure->link, &measure_device->queued_snapshots);