anv: Implement Wa_14019708328

As each anv_device has its own address space it was necessary create
one dummy_aux_bo per anv_device.

Also this workaround requires us to disable the
buffer_length_in_aux_addr optimization, that is done in the physical
device creating because isl_dev of physical device is copied
to isl_dev in anv_device.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29619>
This commit is contained in:
José Roberto de Souza 2023-08-16 09:27:44 -07:00 committed by Marge Bot
parent 3ddcf17a12
commit f7e3aecb87
3 changed files with 21 additions and 2 deletions

View file

@ -2538,7 +2538,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
driQueryOptioni(&instance->dri_options, "shader_spilling_rate");
isl_device_init(&device->isl_dev, &device->info);
device->isl_dev.buffer_length_in_aux_addr = true;
device->isl_dev.buffer_length_in_aux_addr = !intel_needs_workaround(device->isl_dev.info, 14019708328);
result = anv_physical_device_init_uuids(device);
if (result != VK_SUCCESS)
@ -3712,6 +3712,17 @@ VkResult anv_CreateDevice(
if (result != VK_SUCCESS)
goto fail_surface_aux_map_pool;
if (intel_needs_workaround(device->info, 14019708328)) {
result = anv_device_alloc_bo(device, "dummy_aux", 4096,
0 /* alloc_flags */,
0 /* explicit_address */,
&device->dummy_aux_bo);
if (result != VK_SUCCESS)
goto fail_workaround_bo;
device->isl_dev.dummy_aux_address = device->dummy_aux_bo->offset;
}
device->workaround_address = (struct anv_address) {
.bo = device->workaround_bo,
.offset = align(intel_debug_write_identifiers(device->workaround_bo->map,
@ -3741,7 +3752,7 @@ VkResult anv_CreateDevice(
0 /* explicit_address */,
&device->ray_query_bo);
if (result != VK_SUCCESS)
goto fail_workaround_bo;
goto fail_dummy_aux_bo;
}
result = anv_device_init_trivial_batch(device);
@ -4005,6 +4016,9 @@ VkResult anv_CreateDevice(
fail_ray_query_bo:
if (device->ray_query_bo)
anv_device_release_bo(device, device->ray_query_bo);
fail_dummy_aux_bo:
if (device->dummy_aux_bo)
anv_device_release_bo(device, device->dummy_aux_bo);
fail_workaround_bo:
anv_device_release_bo(device, device->workaround_bo);
fail_surface_aux_map_pool:
@ -4161,6 +4175,8 @@ void anv_DestroyDevice(
anv_device_release_bo(device, device->ray_query_bo);
}
anv_device_release_bo(device, device->workaround_bo);
if (device->dummy_aux_bo)
anv_device_release_bo(device, device->dummy_aux_bo);
anv_device_release_bo(device, device->trivial_batch_bo);
if (device->info->has_aux_map) {

View file

@ -499,6 +499,7 @@ build_load_render_surface_state_address(nir_builder *b,
{
if (state->pdevice->isl_dev.buffer_length_in_aux_addr)
return build_optimized_load_render_surface_state_address(b, desc_addr, state);
/* Wa_14019708328 */
return build_non_optimized_load_render_surface_state_address(b, desc_addr, state);
}

View file

@ -1835,6 +1835,8 @@ struct anv_device {
struct anv_bo * workaround_bo;
struct anv_address workaround_address;
struct anv_bo * dummy_aux_bo;
/**
* Workarounds for game bugs.
*/