anv: Fast-path surface relocs when we have softpin

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11236>
This commit is contained in:
Jason Ekstrand 2021-06-08 09:15:09 -05:00 committed by Marge Bot
parent 6afc3f97b6
commit 921bd2d1c7

View file

@ -243,13 +243,21 @@ static void
add_surface_reloc(struct anv_cmd_buffer *cmd_buffer,
struct anv_state state, struct anv_address addr)
{
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
VkResult result;
VkResult result =
anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
state.offset + isl_dev->ss.addr_offset,
addr.bo, addr.offset, NULL);
if (result != VK_SUCCESS)
if (anv_use_softpin(cmd_buffer->device->physical)) {
result = anv_reloc_list_add_bo(&cmd_buffer->surface_relocs,
&cmd_buffer->pool->alloc,
addr.bo);
} else {
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
result = anv_reloc_list_add(&cmd_buffer->surface_relocs,
&cmd_buffer->pool->alloc,
state.offset + isl_dev->ss.addr_offset,
addr.bo, addr.offset, NULL);
}
if (unlikely(result != VK_SUCCESS))
anv_batch_set_error(&cmd_buffer->batch, result);
}