radv: Add thread for timeline syncobj submission.
[mesa.git] / src / amd / vulkan / radv_private.h
index 9a674fad14ba36453addcf6fca7c7577585b34bc..4fa1ac3e08923cd7c42159ddcf888332683afc11 100644 (file)
@@ -675,6 +675,8 @@ struct radv_meta_state {
 
 #define RADV_MAX_QUEUE_FAMILIES 3
 
+struct radv_deferred_queue_submission;
+
 enum ring_type radv_queue_family_to_ring(int f);
 
 struct radv_queue {
@@ -711,6 +713,13 @@ struct radv_queue {
 
        struct list_head pending_submissions;
        pthread_mutex_t pending_mutex;
+
+       pthread_mutex_t thread_mutex;
+       pthread_cond_t thread_cond;
+       struct radv_deferred_queue_submission *thread_submission;
+       pthread_t submission_thread;
+       bool thread_exit;
+       bool thread_running;
 };
 
 struct radv_bo_list {
@@ -2364,13 +2373,32 @@ void radv_initialize_fmask(struct radv_cmd_buffer *cmd_buffer,
                           struct radv_image *image,
                           const VkImageSubresourceRange *range);
 
+typedef enum {
+       RADV_FENCE_NONE,
+       RADV_FENCE_WINSYS,
+       RADV_FENCE_SYNCOBJ,
+       RADV_FENCE_WSI,
+} radv_fence_kind;
+
+struct radv_fence_part {
+       radv_fence_kind kind;
+
+       union {
+               /* AMDGPU winsys fence. */
+               struct radeon_winsys_fence *fence;
+
+               /* DRM syncobj handle for syncobj-based fences. */
+               uint32_t syncobj;
+
+               /* WSI fence. */
+               struct wsi_fence *fence_wsi;
+       };
+};
+
 struct radv_fence {
        struct vk_object_base base;
-       struct radeon_winsys_fence *fence;
-       struct wsi_fence *fence_wsi;
-
-       uint32_t syncobj;
-       uint32_t temp_syncobj;
+       struct radv_fence_part permanent;
+       struct radv_fence_part temporary;
 };
 
 /* radv_nir_to_llvm.c */