From caa71343c684bfbe8de0e2c780c585bd808728de Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 4 Aug 2017 12:59:45 -0700 Subject: [PATCH] anv: Rename anv_fence_state to anv_bo_fence_state It only applies to legacy BO fences. Reviewed-by: Lionel Landwerlin --- src/intel/vulkan/anv_batch_chain.c | 2 +- src/intel/vulkan/anv_private.h | 10 +++++----- src/intel/vulkan/anv_queue.c | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 775009c913a..0a0be8dfc9d 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1619,7 +1619,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device, * vkGetFenceStatus() return a valid result (VK_ERROR_DEVICE_LOST or * VK_SUCCESS) in a finite amount of time even if execbuf fails. */ - fence->permanent.bo.state = ANV_FENCE_STATE_SUBMITTED; + fence->permanent.bo.state = ANV_BO_FENCE_STATE_SUBMITTED; } if (result == VK_SUCCESS && need_out_fence) { diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index ab6e5e25658..3b50c49550e 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1713,16 +1713,16 @@ enum anv_fence_type { ANV_FENCE_TYPE_SYNCOBJ, }; -enum anv_fence_state { +enum anv_bo_fence_state { /** Indicates that this is a new (or newly reset fence) */ - ANV_FENCE_STATE_RESET, + ANV_BO_FENCE_STATE_RESET, /** Indicates that this fence has been submitted to the GPU but is still * (as far as we know) in use by the GPU. */ - ANV_FENCE_STATE_SUBMITTED, + ANV_BO_FENCE_STATE_SUBMITTED, - ANV_FENCE_STATE_SIGNALED, + ANV_BO_FENCE_STATE_SIGNALED, }; struct anv_fence_impl { @@ -1740,7 +1740,7 @@ struct anv_fence_impl { */ struct { struct anv_bo bo; - enum anv_fence_state state; + enum anv_bo_fence_state state; } bo; }; }; diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index f8a2f6448ee..23f8d7d613f 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -279,9 +279,9 @@ VkResult anv_CreateFence( return result; if (pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT) { - fence->permanent.bo.state = ANV_FENCE_STATE_SIGNALED; + fence->permanent.bo.state = ANV_BO_FENCE_STATE_SIGNALED; } else { - fence->permanent.bo.state = ANV_FENCE_STATE_RESET; + fence->permanent.bo.state = ANV_BO_FENCE_STATE_RESET; } *pFence = anv_fence_to_handle(fence); @@ -336,7 +336,7 @@ VkResult anv_ResetFences( switch (impl->type) { case ANV_FENCE_TYPE_BO: - impl->bo.state = ANV_FENCE_STATE_RESET; + impl->bo.state = ANV_BO_FENCE_STATE_RESET; break; default: @@ -363,18 +363,18 @@ VkResult anv_GetFenceStatus( switch (impl->type) { case ANV_FENCE_TYPE_BO: switch (impl->bo.state) { - case ANV_FENCE_STATE_RESET: + case ANV_BO_FENCE_STATE_RESET: /* If it hasn't even been sent off to the GPU yet, it's not ready */ return VK_NOT_READY; - case ANV_FENCE_STATE_SIGNALED: + case ANV_BO_FENCE_STATE_SIGNALED: /* It's been signaled, return success */ return VK_SUCCESS; - case ANV_FENCE_STATE_SUBMITTED: { + case ANV_BO_FENCE_STATE_SUBMITTED: { VkResult result = anv_device_bo_busy(device, &impl->bo.bo); if (result == VK_SUCCESS) { - impl->bo.state = ANV_FENCE_STATE_SIGNALED; + impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED; return VK_SUCCESS; } else { return result; @@ -427,7 +427,7 @@ anv_wait_for_bo_fences(struct anv_device *device, struct anv_fence_impl *impl = &fence->permanent; switch (impl->bo.state) { - case ANV_FENCE_STATE_RESET: + case ANV_BO_FENCE_STATE_RESET: /* This fence hasn't been submitted yet, we'll catch it the next * time around. Yes, this may mean we dead-loop but, short of * lots of locking and a condition variable, there's not much that @@ -436,7 +436,7 @@ anv_wait_for_bo_fences(struct anv_device *device, pending_fences++; continue; - case ANV_FENCE_STATE_SIGNALED: + case ANV_BO_FENCE_STATE_SIGNALED: /* This fence is not pending. If waitAll isn't set, we can return * early. Otherwise, we have to keep going. */ @@ -446,14 +446,14 @@ anv_wait_for_bo_fences(struct anv_device *device, } continue; - case ANV_FENCE_STATE_SUBMITTED: + case ANV_BO_FENCE_STATE_SUBMITTED: /* These are the fences we really care about. Go ahead and wait * on it until we hit a timeout. */ result = anv_device_wait(device, &impl->bo.bo, timeout); switch (result) { case VK_SUCCESS: - impl->bo.state = ANV_FENCE_STATE_SIGNALED; + impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED; signaled_fences = true; if (!waitAll) goto done; @@ -483,7 +483,7 @@ anv_wait_for_bo_fences(struct anv_device *device, uint32_t now_pending_fences = 0; for (uint32_t i = 0; i < fenceCount; i++) { ANV_FROM_HANDLE(anv_fence, fence, pFences[i]); - if (fence->permanent.bo.state == ANV_FENCE_STATE_RESET) + if (fence->permanent.bo.state == ANV_BO_FENCE_STATE_RESET) now_pending_fences++; } assert(now_pending_fences <= pending_fences); -- 2.30.2