diff options
author | Jason Ekstrand <[email protected]> | 2018-05-26 12:08:22 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-06-11 10:08:30 -0700 |
commit | d6533c02d00b7daa71eeed49577f266da1f072cb (patch) | |
tree | e025c12d223ad7e48ca3562d8881ad018b0b23c3 /src/intel | |
parent | 3737e4df7c77111e0bd1b0957f5b650f06e32edc (diff) |
anv: Set fence/semaphore types to NONE in impl_cleanup
There were some places that were calling anv_semaphore_impl_cleanup and
neither deleting the semaphore nor setting the type back to NONE. Just
set it to NONE in impl_cleanup to avoid these issues.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106643
Fixes: 031f57eba "anv: Add a basic implementation of VK_KHX_external..."
Reviewed-by: Lionel Landwerlin <[email protected]>
(cherry picked from commit 237c5ac4f9748d254aa4c5428fec44cf753bc47d)
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_queue.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index b9ca189fddc..69f2462e143 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -311,18 +311,21 @@ anv_fence_impl_cleanup(struct anv_device *device, switch (impl->type) { case ANV_FENCE_TYPE_NONE: /* Dummy. Nothing to do */ - return; + break; case ANV_FENCE_TYPE_BO: anv_bo_pool_free(&device->batch_bo_pool, &impl->bo.bo); - return; + break; case ANV_FENCE_TYPE_SYNCOBJ: anv_gem_syncobj_destroy(device, impl->syncobj); - return; + break; + + default: + unreachable("Invalid fence type"); } - unreachable("Invalid fence type"); + impl->type = ANV_FENCE_TYPE_NONE; } void anv_DestroyFence( @@ -359,10 +362,8 @@ VkResult anv_ResetFences( * first restored. The remaining operations described therefore * operate on the restored payload. */ - if (fence->temporary.type != ANV_FENCE_TYPE_NONE) { + if (fence->temporary.type != ANV_FENCE_TYPE_NONE) anv_fence_impl_cleanup(device, &fence->temporary); - fence->temporary.type = ANV_FENCE_TYPE_NONE; - } struct anv_fence_impl *impl = &fence->permanent; @@ -914,22 +915,25 @@ anv_semaphore_impl_cleanup(struct anv_device *device, case ANV_SEMAPHORE_TYPE_NONE: case ANV_SEMAPHORE_TYPE_DUMMY: /* Dummy. Nothing to do */ - return; + break; case ANV_SEMAPHORE_TYPE_BO: anv_bo_cache_release(device, &device->bo_cache, impl->bo); - return; + break; case ANV_SEMAPHORE_TYPE_SYNC_FILE: close(impl->fd); - return; + break; case ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ: anv_gem_syncobj_destroy(device, impl->syncobj); - return; + break; + + default: + unreachable("Invalid semaphore type"); } - unreachable("Invalid semaphore type"); + impl->type = ANV_SEMAPHORE_TYPE_NONE; } void @@ -940,7 +944,6 @@ anv_semaphore_reset_temporary(struct anv_device *device, return; anv_semaphore_impl_cleanup(device, &semaphore->temporary); - semaphore->temporary.type = ANV_SEMAPHORE_TYPE_NONE; } void anv_DestroySemaphore( |