Mesa (main): anv: Drop anv_sync_create_for_bo
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Dec 17 02:11:37 UTC 2021
Module: Mesa
Branch: main
Commit: 3878094eb1c611d95deb472b6b93cd327e07a1ce
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3878094eb1c611d95deb472b6b93cd327e07a1ce
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Thu Dec 16 14:27:50 2021 -0600
anv: Drop anv_sync_create_for_bo
The older helper is unused so we can roll it all into
anv_create_sync_for_memory.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14237>
---
src/intel/vulkan/anv_bo_sync.c | 43 ++++++++++--------------------------------
src/intel/vulkan/anv_private.h | 4 ----
2 files changed, 10 insertions(+), 37 deletions(-)
diff --git a/src/intel/vulkan/anv_bo_sync.c b/src/intel/vulkan/anv_bo_sync.c
index 4415b1fa51e..149ae2c2ba2 100644
--- a/src/intel/vulkan/anv_bo_sync.c
+++ b/src/intel/vulkan/anv_bo_sync.c
@@ -212,49 +212,26 @@ const struct vk_sync_type anv_bo_sync_type = {
.wait_many = anv_bo_sync_wait,
};
-static VkResult
-_anv_sync_create_for_bo(struct anv_device *device,
- struct anv_bo *bo,
- enum anv_bo_sync_state state,
- struct vk_sync **sync_out)
+VkResult
+anv_create_sync_for_memory(struct vk_device *device,
+ VkDeviceMemory memory,
+ bool signal_memory,
+ struct vk_sync **sync_out)
{
+ ANV_FROM_HANDLE(anv_device_memory, mem, memory);
struct anv_bo_sync *bo_sync;
- bo_sync = vk_zalloc(&device->vk.alloc, sizeof(*bo_sync), 8,
+ bo_sync = vk_zalloc(&device->alloc, sizeof(*bo_sync), 8,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (bo_sync == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
bo_sync->sync.type = &anv_bo_sync_type;
- bo_sync->state = state;
- bo_sync->bo = anv_bo_ref(bo);
+ bo_sync->state = signal_memory ? ANV_BO_SYNC_STATE_RESET :
+ ANV_BO_SYNC_STATE_SUBMITTED;
+ bo_sync->bo = anv_bo_ref(mem->bo);
*sync_out = &bo_sync->sync;
return VK_SUCCESS;
}
-
-VkResult
-anv_sync_create_for_bo(struct anv_device *device,
- struct anv_bo *bo,
- struct vk_sync **sync_out)
-{
- return _anv_sync_create_for_bo(device, bo, ANV_BO_SYNC_STATE_SUBMITTED,
- sync_out);
-}
-
-VkResult
-anv_create_sync_for_memory(struct vk_device *vk_device,
- VkDeviceMemory memory,
- bool signal_memory,
- struct vk_sync **sync_out)
-{
- ANV_FROM_HANDLE(anv_device_memory, mem, memory);
- struct anv_device *device =
- container_of(vk_device, struct anv_device, vk);
-
- enum anv_bo_sync_state state = signal_memory ?
- ANV_BO_SYNC_STATE_RESET : ANV_BO_SYNC_STATE_SUBMITTED;
-
- return _anv_sync_create_for_bo(device, mem->bo, state, sync_out);
-}
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 9143fe2cfc7..749a92d4014 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3172,10 +3172,6 @@ vk_sync_is_anv_bo_sync(const struct vk_sync *sync)
return sync->type == &anv_bo_sync_type;
}
-VkResult anv_sync_create_for_bo(struct anv_device *device,
- struct anv_bo *bo,
- struct vk_sync **sync_out);
-
VkResult anv_create_sync_for_memory(struct vk_device *device,
VkDeviceMemory memory,
bool signal_memory,
More information about the mesa-commit
mailing list