anv: add identifier BO
A buffer added to all execbufs so that we can attribute a batch that caused a hang to a particular driver. v2: Reuse workaround BO Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3203>
This commit is contained in:
committed by
Marge Bot
parent
507b1ca10c
commit
64473fd8f7
@@ -1680,7 +1680,13 @@ anv_queue_execbuf_locked(struct anv_queue *queue,
|
||||
execbuf.alloc_scope = submit->alloc_scope;
|
||||
execbuf.perf_query_pass = submit->perf_query_pass;
|
||||
|
||||
VkResult result;
|
||||
/* Always add the workaround BO as it includes a driver identifier for the
|
||||
* error_state.
|
||||
*/
|
||||
VkResult result =
|
||||
anv_execbuf_add_bo(device, &execbuf, device->workaround_bo, NULL, 0);
|
||||
if (result != VK_SUCCESS)
|
||||
goto error;
|
||||
|
||||
for (uint32_t i = 0; i < submit->fence_bo_count; i++) {
|
||||
int signaled;
|
||||
|
||||
@@ -2926,7 +2926,8 @@ VkResult anv_CreateDevice(
|
||||
goto fail_binding_table_pool;
|
||||
}
|
||||
|
||||
result = anv_device_alloc_bo(device, 4096, 0 /* flags */,
|
||||
result = anv_device_alloc_bo(device, 4096,
|
||||
ANV_BO_ALLOC_CAPTURE | ANV_BO_ALLOC_MAPPED /* flags */,
|
||||
0 /* explicit_address */,
|
||||
&device->workaround_bo);
|
||||
if (result != VK_SUCCESS)
|
||||
@@ -2934,8 +2935,17 @@ VkResult anv_CreateDevice(
|
||||
|
||||
device->workaround_address = (struct anv_address) {
|
||||
.bo = device->workaround_bo,
|
||||
.offset = align_u32(
|
||||
intel_debug_write_identifiers(device->workaround_bo->map,
|
||||
device->workaround_bo->size,
|
||||
"Anv") + 8, 8),
|
||||
};
|
||||
|
||||
if (!device->info.has_llc) {
|
||||
gen_clflush_range(device->workaround_bo->map,
|
||||
device->workaround_address.offset);
|
||||
}
|
||||
|
||||
result = anv_device_init_trivial_batch(device);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail_workaround_bo;
|
||||
|
||||
@@ -2133,10 +2133,7 @@ genX(cmd_buffer_apply_pipe_flushes)(struct anv_cmd_buffer *cmd_buffer)
|
||||
if (bits & ANV_PIPE_END_OF_PIPE_SYNC_BIT) {
|
||||
pipe.CommandStreamerStallEnable = true;
|
||||
pipe.PostSyncOperation = WriteImmediateData;
|
||||
pipe.Address = (struct anv_address) {
|
||||
.bo = cmd_buffer->device->workaround_bo,
|
||||
.offset = 0
|
||||
};
|
||||
pipe.Address = cmd_buffer->device->workaround_address;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2206,10 +2203,7 @@ genX(cmd_buffer_apply_pipe_flushes)(struct anv_cmd_buffer *cmd_buffer)
|
||||
*/
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(MI_LOAD_REGISTER_MEM), lrm) {
|
||||
lrm.RegisterAddress = 0x243C; /* GEN7_3DPRIM_START_INSTANCE */
|
||||
lrm.MemoryAddress = (struct anv_address) {
|
||||
.bo = cmd_buffer->device->workaround_bo,
|
||||
.offset = 0
|
||||
};
|
||||
lrm.MemoryAddress = cmd_buffer->device->workaround_address;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user