diff options
author | Keith Packard <[email protected]> | 2017-06-15 21:00:56 -0700 |
---|---|---|
committer | Keith Packard <[email protected]> | 2018-06-23 07:59:00 -0700 |
commit | 16eb390834daaa153522e63bb17df9526eb9123c (patch) | |
tree | 18cb5da23ee5c32bdf6a97aa07adcdbe79f82491 /src/intel/vulkan/anv_queue.c | |
parent | 86c8d93e5a045772b6c1c6ce6a24a5404a37f4cb (diff) |
anv: add VK_EXT_display_control to anv driver [v5]
This extension provides fences and frame count information to direct
display contexts. It uses new kernel ioctls to provide 64-bits of
vblank sequence and nanosecond resolution.
v2: Adopt Jason Ekstrand's coding conventions
Declare variables at first use, eliminate extra whitespace between
types and names. Wrap lines to 80 columns.
Add extension to list in alphabetical order
Suggested-by: Jason Ekstrand <[email protected]>
v3: Adapt to WSI fence API change. It now returns VkResult and
no longer has an option for relative timeouts.
v4: wsi_register_display_event and wsi_register_device_event now
use the default allocator when NULL is provided, so remove the
computation of 'alloc' here.
v5: use zalloc2 instead of alloc2 for the WSI fence.
Suggested-by: Jason Ekstrand <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_queue.c')
-rw-r--r-- | src/intel/vulkan/anv_queue.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index 6e275629e14..e0c0a42069f 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -324,6 +324,10 @@ anv_fence_impl_cleanup(struct anv_device *device, anv_gem_syncobj_destroy(device, impl->syncobj); break; + case ANV_FENCE_TYPE_WSI: + impl->fence_wsi->destroy(impl->fence_wsi); + break; + default: unreachable("Invalid fence type"); } @@ -674,6 +678,17 @@ done: } static VkResult +anv_wait_for_wsi_fence(struct anv_device *device, + const VkFence _fence, + uint64_t abs_timeout) +{ + ANV_FROM_HANDLE(anv_fence, fence, _fence); + struct anv_fence_impl *impl = &fence->permanent; + + return impl->fence_wsi->wait(impl->fence_wsi, abs_timeout); +} + +static VkResult anv_wait_for_fences(struct anv_device *device, uint32_t fenceCount, const VkFence *pFences, @@ -695,6 +710,9 @@ anv_wait_for_fences(struct anv_device *device, result = anv_wait_for_syncobj_fences(device, 1, &pFences[i], true, abs_timeout); break; + case ANV_FENCE_TYPE_WSI: + result = anv_wait_for_wsi_fence(device, pFences[i], abs_timeout); + break; case ANV_FENCE_TYPE_NONE: result = VK_SUCCESS; break; |