mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
anv: Delete anv_reloc_list_add()
We don't need the offset to write a relocation at any longer, so all it does is call anv_reloc_list_add_bo() at this point. Just use that. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18208>
This commit is contained in:
parent
4b5c29bad0
commit
7b7381e8d7
3 changed files with 6 additions and 37 deletions
|
|
@ -196,23 +196,6 @@ anv_reloc_list_add_bo(struct anv_reloc_list *list,
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult
|
|
||||||
anv_reloc_list_add(struct anv_reloc_list *list,
|
|
||||||
const VkAllocationCallbacks *alloc,
|
|
||||||
uint32_t offset, struct anv_bo *target_bo, uint32_t delta,
|
|
||||||
uint64_t *address_u64_out)
|
|
||||||
{
|
|
||||||
struct anv_bo *unwrapped_target_bo = anv_bo_unwrap(target_bo);
|
|
||||||
uint64_t target_bo_offset = READ_ONCE(unwrapped_target_bo->offset);
|
|
||||||
if (address_u64_out)
|
|
||||||
*address_u64_out = target_bo_offset + delta;
|
|
||||||
|
|
||||||
assert(unwrapped_target_bo->gem_handle > 0);
|
|
||||||
assert(unwrapped_target_bo->refcount > 0);
|
|
||||||
|
|
||||||
return anv_reloc_list_add_bo(list, alloc, unwrapped_target_bo);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
anv_reloc_list_clear(struct anv_reloc_list *list)
|
anv_reloc_list_clear(struct anv_reloc_list *list)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1384,11 +1384,6 @@ VkResult anv_reloc_list_init(struct anv_reloc_list *list,
|
||||||
void anv_reloc_list_finish(struct anv_reloc_list *list,
|
void anv_reloc_list_finish(struct anv_reloc_list *list,
|
||||||
const VkAllocationCallbacks *alloc);
|
const VkAllocationCallbacks *alloc);
|
||||||
|
|
||||||
VkResult anv_reloc_list_add(struct anv_reloc_list *list,
|
|
||||||
const VkAllocationCallbacks *alloc,
|
|
||||||
uint32_t offset, struct anv_bo *target_bo,
|
|
||||||
uint32_t delta, uint64_t *address_u64_out);
|
|
||||||
|
|
||||||
VkResult anv_reloc_list_add_bo(struct anv_reloc_list *list,
|
VkResult anv_reloc_list_add_bo(struct anv_reloc_list *list,
|
||||||
const VkAllocationCallbacks *alloc,
|
const VkAllocationCallbacks *alloc,
|
||||||
struct anv_bo *target_bo);
|
struct anv_bo *target_bo);
|
||||||
|
|
|
||||||
|
|
@ -280,32 +280,23 @@ static void
|
||||||
add_surface_state_relocs(struct anv_cmd_buffer *cmd_buffer,
|
add_surface_state_relocs(struct anv_cmd_buffer *cmd_buffer,
|
||||||
struct anv_surface_state state)
|
struct anv_surface_state state)
|
||||||
{
|
{
|
||||||
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
|
|
||||||
|
|
||||||
assert(!anv_address_is_null(state.address));
|
assert(!anv_address_is_null(state.address));
|
||||||
add_surface_reloc(cmd_buffer, state.state, state.address);
|
add_surface_reloc(cmd_buffer, state.state, state.address);
|
||||||
|
|
||||||
if (!anv_address_is_null(state.aux_address)) {
|
if (!anv_address_is_null(state.aux_address)) {
|
||||||
VkResult result =
|
VkResult result =
|
||||||
anv_reloc_list_add(&cmd_buffer->surface_relocs,
|
anv_reloc_list_add_bo(&cmd_buffer->surface_relocs,
|
||||||
&cmd_buffer->vk.pool->alloc,
|
&cmd_buffer->vk.pool->alloc,
|
||||||
state.state.offset + isl_dev->ss.aux_addr_offset,
|
state.aux_address.bo);
|
||||||
state.aux_address.bo,
|
|
||||||
state.aux_address.offset,
|
|
||||||
NULL);
|
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
anv_batch_set_error(&cmd_buffer->batch, result);
|
anv_batch_set_error(&cmd_buffer->batch, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!anv_address_is_null(state.clear_address)) {
|
if (!anv_address_is_null(state.clear_address)) {
|
||||||
VkResult result =
|
VkResult result =
|
||||||
anv_reloc_list_add(&cmd_buffer->surface_relocs,
|
anv_reloc_list_add_bo(&cmd_buffer->surface_relocs,
|
||||||
&cmd_buffer->vk.pool->alloc,
|
&cmd_buffer->vk.pool->alloc,
|
||||||
state.state.offset +
|
state.clear_address.bo);
|
||||||
isl_dev->ss.clear_color_state_offset,
|
|
||||||
state.clear_address.bo,
|
|
||||||
state.clear_address.offset,
|
|
||||||
NULL);
|
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
anv_batch_set_error(&cmd_buffer->batch, result);
|
anv_batch_set_error(&cmd_buffer->batch, result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue