anv: Rename anv_fence_state to anv_bo_fence_state

It only applies to legacy BO fences.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand
2017-08-04 12:59:45 -07:00
parent 92286dc08a
commit caa71343c6
3 changed files with 18 additions and 18 deletions

View File

@@ -1619,7 +1619,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
* vkGetFenceStatus() return a valid result (VK_ERROR_DEVICE_LOST or * vkGetFenceStatus() return a valid result (VK_ERROR_DEVICE_LOST or
* VK_SUCCESS) in a finite amount of time even if execbuf fails. * 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) { if (result == VK_SUCCESS && need_out_fence) {

View File

@@ -1713,16 +1713,16 @@ enum anv_fence_type {
ANV_FENCE_TYPE_SYNCOBJ, ANV_FENCE_TYPE_SYNCOBJ,
}; };
enum anv_fence_state { enum anv_bo_fence_state {
/** Indicates that this is a new (or newly reset fence) */ /** 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 /** Indicates that this fence has been submitted to the GPU but is still
* (as far as we know) in use by the GPU. * (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 { struct anv_fence_impl {
@@ -1740,7 +1740,7 @@ struct anv_fence_impl {
*/ */
struct { struct {
struct anv_bo bo; struct anv_bo bo;
enum anv_fence_state state; enum anv_bo_fence_state state;
} bo; } bo;
}; };
}; };

View File

@@ -279,9 +279,9 @@ VkResult anv_CreateFence(
return result; return result;
if (pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT) { 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 { } else {
fence->permanent.bo.state = ANV_FENCE_STATE_RESET; fence->permanent.bo.state = ANV_BO_FENCE_STATE_RESET;
} }
*pFence = anv_fence_to_handle(fence); *pFence = anv_fence_to_handle(fence);
@@ -336,7 +336,7 @@ VkResult anv_ResetFences(
switch (impl->type) { switch (impl->type) {
case ANV_FENCE_TYPE_BO: case ANV_FENCE_TYPE_BO:
impl->bo.state = ANV_FENCE_STATE_RESET; impl->bo.state = ANV_BO_FENCE_STATE_RESET;
break; break;
default: default:
@@ -363,18 +363,18 @@ VkResult anv_GetFenceStatus(
switch (impl->type) { switch (impl->type) {
case ANV_FENCE_TYPE_BO: case ANV_FENCE_TYPE_BO:
switch (impl->bo.state) { 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 */ /* If it hasn't even been sent off to the GPU yet, it's not ready */
return VK_NOT_READY; return VK_NOT_READY;
case ANV_FENCE_STATE_SIGNALED: case ANV_BO_FENCE_STATE_SIGNALED:
/* It's been signaled, return success */ /* It's been signaled, return success */
return VK_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); VkResult result = anv_device_bo_busy(device, &impl->bo.bo);
if (result == VK_SUCCESS) { if (result == VK_SUCCESS) {
impl->bo.state = ANV_FENCE_STATE_SIGNALED; impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED;
return VK_SUCCESS; return VK_SUCCESS;
} else { } else {
return result; return result;
@@ -427,7 +427,7 @@ anv_wait_for_bo_fences(struct anv_device *device,
struct anv_fence_impl *impl = &fence->permanent; struct anv_fence_impl *impl = &fence->permanent;
switch (impl->bo.state) { 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 /* 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 * time around. Yes, this may mean we dead-loop but, short of
* lots of locking and a condition variable, there's not much that * 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++; pending_fences++;
continue; 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 /* This fence is not pending. If waitAll isn't set, we can return
* early. Otherwise, we have to keep going. * early. Otherwise, we have to keep going.
*/ */
@@ -446,14 +446,14 @@ anv_wait_for_bo_fences(struct anv_device *device,
} }
continue; continue;
case ANV_FENCE_STATE_SUBMITTED: case ANV_BO_FENCE_STATE_SUBMITTED:
/* These are the fences we really care about. Go ahead and wait /* These are the fences we really care about. Go ahead and wait
* on it until we hit a timeout. * on it until we hit a timeout.
*/ */
result = anv_device_wait(device, &impl->bo.bo, timeout); result = anv_device_wait(device, &impl->bo.bo, timeout);
switch (result) { switch (result) {
case VK_SUCCESS: case VK_SUCCESS:
impl->bo.state = ANV_FENCE_STATE_SIGNALED; impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED;
signaled_fences = true; signaled_fences = true;
if (!waitAll) if (!waitAll)
goto done; goto done;
@@ -483,7 +483,7 @@ anv_wait_for_bo_fences(struct anv_device *device,
uint32_t now_pending_fences = 0; uint32_t now_pending_fences = 0;
for (uint32_t i = 0; i < fenceCount; i++) { for (uint32_t i = 0; i < fenceCount; i++) {
ANV_FROM_HANDLE(anv_fence, fence, pFences[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++; now_pending_fences++;
} }
assert(now_pending_fences <= pending_fences); assert(now_pending_fences <= pending_fences);