anv: Return earlier in anv_reloc_list functions

Xe KMD don't need relocs, so calling a nop function and avoiding the
CPU cycles and memory waste with reloc.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24411>
This commit is contained in:
José Roberto de Souza
2023-07-31 11:29:14 -07:00
committed by Marge Bot
parent d9d284d050
commit f49989148a
5 changed files with 30 additions and 11 deletions

View File

@@ -945,6 +945,8 @@ struct anv_physical_device {
*/
bool indirect_descriptors;
bool uses_relocs;
struct {
uint32_t family_count;
struct anv_queue_family families[ANV_MAX_QUEUE_FAMILIES];
@@ -1432,17 +1434,25 @@ void anv_vma_free(struct anv_device *device,
uint64_t address, uint64_t size);
struct anv_reloc_list {
bool uses_relocs;
uint32_t dep_words;
BITSET_WORD * deps;
const VkAllocationCallbacks *alloc;
};
VkResult anv_reloc_list_init(struct anv_reloc_list *list,
const VkAllocationCallbacks *alloc);
const VkAllocationCallbacks *alloc,
bool uses_relocs);
void anv_reloc_list_finish(struct anv_reloc_list *list);
VkResult anv_reloc_list_add_bo(struct anv_reloc_list *list,
struct anv_bo *target_bo);
VkResult
anv_reloc_list_add_bo_impl(struct anv_reloc_list *list, struct anv_bo *target_bo);
static inline VkResult
anv_reloc_list_add_bo(struct anv_reloc_list *list, struct anv_bo *target_bo)
{
return list->uses_relocs ? anv_reloc_list_add_bo_impl(list, target_bo) : VK_SUCCESS;
}
struct anv_batch_bo {
/* Link in the anv_cmd_buffer.owned_batch_bos list */