diff options
author | Dave Airlie <[email protected]> | 2017-02-27 19:14:00 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-07-21 21:31:54 +0100 |
commit | eaa56eab6da565c7bc84419c025c7c9bc90cf87a (patch) | |
tree | 09e2adf2a642a3879a4992157ba6293d677214c9 /src/amd/vulkan/radv_private.h | |
parent | b5670beb31d3e6cfb8fff6f14e5fd5ec03ec16e9 (diff) |
radv: initial support for shared semaphores (v2)
This adds support for sharing semaphores using kernel syncobjects.
Syncobj backed semaphores are used for any semaphore which is
created with external flags, and when a semaphore is imported,
otherwise we use the current non-kernel semaphores.
Temporary imports from syncobj fd are also available, these
just override the current user until the next wait, when the
temp syncobj is dropped.
v2: allocate more chunks upfront, fix off by one after
previous refactor of syncobj setup, remove unnecessary null
check.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_private.h')
-rw-r--r-- | src/amd/vulkan/radv_private.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 891b34ef138..8cd5ec00463 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1470,6 +1470,20 @@ struct radv_query_pool { uint32_t pipeline_stats_mask; }; +struct radv_semaphore { + /* use a winsys sem for non-exportable */ + struct radeon_winsys_sem *sem; + uint32_t syncobj; + uint32_t temp_syncobj; +}; + +VkResult radv_alloc_sem_info(struct radv_winsys_sem_info *sem_info, + int num_wait_sems, + const VkSemaphore *wait_sems, + int num_signal_sems, + const VkSemaphore *signal_sems); +void radv_free_sem_info(struct radv_winsys_sem_info *sem_info); + void radv_update_descriptor_sets(struct radv_device *device, struct radv_cmd_buffer *cmd_buffer, @@ -1563,6 +1577,6 @@ RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_query_pool, VkQueryPool) RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_render_pass, VkRenderPass) RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_sampler, VkSampler) RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_shader_module, VkShaderModule) -RADV_DEFINE_NONDISP_HANDLE_CASTS(radeon_winsys_sem, VkSemaphore) +RADV_DEFINE_NONDISP_HANDLE_CASTS(radv_semaphore, VkSemaphore) #endif /* RADV_PRIVATE_H */ |