Module: Mesa
Branch: main
Commit: e2b59e340873841b8b0d5ebc3ba2917f1a4938c1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e2b59e340873841b8b0d5ebc3ba2917f1a4938c1

Author: Yevhenii Kolesnikov <[email protected]>
Date:   Tue Apr  6 15:26:12 2021 +0300

radv: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>

---

 src/amd/vulkan/radv_device.c  | 8 +++++---
 src/amd/vulkan/radv_private.h | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index dad3ba0bef9..75d329dd301 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2793,14 +2793,16 @@ radv_queue_init(struct radv_device *device, struct 
radv_queue *queue, uint32_t q
    queue->flags = flags;
    queue->hw_ctx = device->hw_ctx[queue->priority];
 
-   vk_object_base_init(&device->vk, &queue->base, VK_OBJECT_TYPE_QUEUE);
+   VkResult result = vk_queue_init(&queue->vk, &device->vk);
+   if (result != VK_SUCCESS)
+      return result;
 
    list_inithead(&queue->pending_submissions);
    mtx_init(&queue->pending_mutex, mtx_plain);
 
    mtx_init(&queue->thread_mutex, mtx_plain);
    if (u_cnd_monotonic_init(&queue->thread_cond)) {
-      vk_object_base_finish(&queue->base);
+      vk_queue_finish(&queue->vk);
       return vk_error(device->instance, VK_ERROR_INITIALIZATION_FAILED);
    }
    queue->cond_created = true;
@@ -2849,7 +2851,7 @@ radv_queue_finish(struct radv_queue *queue)
    if (queue->compute_scratch_bo)
       queue->device->ws->buffer_destroy(queue->device->ws, 
queue->compute_scratch_bo);
 
-   vk_object_base_finish(&queue->base);
+   vk_queue_finish(&queue->vk);
 }
 
 static void
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 64c7c4edf38..ab4ba1ed5c3 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -62,6 +62,7 @@
 #include "vk_physical_device.h"
 #include "vk_shader_module.h"
 #include "vk_command_buffer.h"
+#include "vk_queue.h"
 #include "vk_util.h"
 
 #include "ac_binary.h"
@@ -690,7 +691,7 @@ struct radv_deferred_queue_submission;
 enum ring_type radv_queue_family_to_ring(int f);
 
 struct radv_queue {
-   struct vk_object_base base;
+   struct vk_queue vk;
    struct radv_device *device;
    struct radeon_winsys_ctx *hw_ctx;
    enum radeon_ctx_priority priority;

Reply via email to