xref: /aosp_15_r20/external/mesa3d/src/panfrost/vulkan/jm/panvk_queue.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2021 Collabora Ltd.
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #ifndef PANVK_QUEUE_H
7 #define PANVK_QUEUE_H
8 
9 #ifndef PAN_ARCH
10 #error "PAN_ARCH must be defined"
11 #endif
12 
13 #include <stdint.h>
14 
15 #include "panvk_device.h"
16 
17 #include "vk_queue.h"
18 
19 struct panvk_queue {
20    struct vk_queue vk;
21    uint32_t sync;
22 };
23 
24 VK_DEFINE_HANDLE_CASTS(panvk_queue, vk.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
25 
26 static inline void
panvk_per_arch(queue_finish)27 panvk_per_arch(queue_finish)(struct panvk_queue *queue)
28 {
29    struct panvk_device *dev = to_panvk_device(queue->vk.base.device);
30 
31    vk_queue_finish(&queue->vk);
32    drmSyncobjDestroy(dev->vk.drm_fd, queue->sync);
33 }
34 
35 VkResult panvk_per_arch(queue_init)(struct panvk_device *device,
36                                     struct panvk_queue *queue, int idx,
37                                     const VkDeviceQueueCreateInfo *create_info);
38 
39 #endif
40