lavapipe: Use a common vk_queue structure

Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>
This commit is contained in:
Yevhenii Kolesnikov 2021-04-06 15:32:55 +03:00 committed by Marge Bot
parent c9dbd3c06e
commit 9d40877f72
2 changed files with 9 additions and 3 deletions

View file

@ -1410,6 +1410,10 @@ queue_thread(void *data, void *gdata, int thread_index)
static VkResult
lvp_queue_init(struct lvp_device *device, struct lvp_queue *queue)
{
VkResult result = vk_queue_init(&queue->vk, &device->vk);
if (result != VK_SUCCESS)
return result;
queue->device = device;
simple_mtx_init(&queue->last_lock, mtx_plain);
@ -1420,7 +1424,6 @@ lvp_queue_init(struct lvp_device *device, struct lvp_queue *queue)
util_queue_init(&queue->queue, "lavapipe", 8, 1, UTIL_QUEUE_INIT_RESIZE_IF_FULL, device);
p_atomic_set(&queue->count, 0);
vk_object_base_init(&device->vk, &queue->base, VK_OBJECT_TYPE_QUEUE);
return VK_SUCCESS;
}
@ -1433,6 +1436,8 @@ lvp_queue_finish(struct lvp_queue *queue)
cso_destroy_context(queue->cso);
queue->ctx->destroy(queue->ctx);
simple_mtx_destroy(&queue->last_lock);
vk_queue_finish(&queue->vk);
}
VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(

View file

@ -61,6 +61,7 @@ typedef uint32_t xcb_window_t;
#include "vk_format.h"
#include "vk_cmd_queue.h"
#include "vk_command_buffer.h"
#include "vk_queue.h"
#include "wsi_common.h"
@ -165,7 +166,7 @@ bool lvp_physical_device_extension_supported(struct lvp_physical_device *dev,
const char *name);
struct lvp_queue {
struct vk_object_base base;
struct vk_queue vk;
VkDeviceQueueCreateFlags flags;
struct lvp_device * device;
struct pipe_context *ctx;
@ -614,7 +615,7 @@ VK_DEFINE_HANDLE_CASTS(lvp_device, vk.base, VkDevice, VK_OBJECT_TYPE_DEVICE)
VK_DEFINE_HANDLE_CASTS(lvp_instance, vk.base, VkInstance, VK_OBJECT_TYPE_INSTANCE)
VK_DEFINE_HANDLE_CASTS(lvp_physical_device, vk.base, VkPhysicalDevice,
VK_OBJECT_TYPE_PHYSICAL_DEVICE)
VK_DEFINE_HANDLE_CASTS(lvp_queue, base, VkQueue, VK_OBJECT_TYPE_QUEUE)
VK_DEFINE_HANDLE_CASTS(lvp_queue, vk.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
VK_DEFINE_NONDISP_HANDLE_CASTS(lvp_cmd_pool, base,VkCommandPool,
VK_OBJECT_TYPE_COMMAND_POOL)