venus: initial support for queue/fence/semaphore

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>
This commit is contained in:
Chia-I Wu 2019-11-06 10:19:20 -08:00 committed by Marge Bot
parent 5d94efd1b2
commit ddd7533055
3 changed files with 1390 additions and 0 deletions

View File

@ -52,6 +52,8 @@ struct vn_instance;
struct vn_physical_device;
struct vn_device;
struct vn_queue;
struct vn_fence;
struct vn_semaphore;
struct vn_command_buffer;
struct vn_cs_encoder;

File diff suppressed because it is too large Load Diff

View File

@ -96,6 +96,9 @@ struct vn_device {
struct vn_instance *instance;
struct vn_physical_device *physical_device;
struct vn_queue *queues;
uint32_t queue_count;
};
VK_DEFINE_HANDLE_CASTS(vn_device,
base.base.base,
@ -106,9 +109,68 @@ struct vn_queue {
struct vn_object_base base;
struct vn_device *device;
uint32_t family;
uint32_t index;
uint32_t flags;
uint32_t sync_queue_index;
struct vn_renderer_sync *idle_sync;
uint64_t idle_sync_value;
};
VK_DEFINE_HANDLE_CASTS(vn_queue, base.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
enum vn_sync_type {
/* no payload */
VN_SYNC_TYPE_INVALID,
/* When we signal or reset, we update both the device object and the
* renderer sync. When we wait or query, we use the renderer sync only.
*
* TODO VkFence does not need the device object
*/
VN_SYNC_TYPE_SYNC,
/* device object only; no renderer sync */
VN_SYNC_TYPE_DEVICE_ONLY,
/* already signaled by WSI */
VN_SYNC_TYPE_WSI_SIGNALED,
};
struct vn_sync_payload {
enum vn_sync_type type;
struct vn_renderer_sync *sync;
};
struct vn_fence {
struct vn_object_base base;
struct vn_sync_payload *payload;
struct vn_sync_payload permanent;
struct vn_sync_payload temporary;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_fence,
base.base,
VkFence,
VK_OBJECT_TYPE_FENCE)
struct vn_semaphore {
struct vn_object_base base;
VkSemaphoreType type;
struct vn_sync_payload *payload;
struct vn_sync_payload permanent;
struct vn_sync_payload temporary;
};
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_semaphore,
base.base,
VkSemaphore,
VK_OBJECT_TYPE_SEMAPHORE)
struct vn_command_buffer {
struct vn_object_base base;
@ -138,4 +200,10 @@ void
vn_instance_submit_command(struct vn_instance *instance,
struct vn_instance_submit_command *submit);
void
vn_fence_signal_wsi(struct vn_device *dev, struct vn_fence *fence);
void
vn_semaphore_signal_wsi(struct vn_device *dev, struct vn_semaphore *sem);
#endif /* VN_DEVICE_H */