xref: /aosp_15_r20/external/mesa3d/src/asahi/vulkan/hk_queue.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2024 Valve Corporation
3  * Copyright 2024 Alyssa Rosenzweig
4  * Copyright 2022-2023 Collabora Ltd. and Red Hat Inc.
5  * SPDX-License-Identifier: MIT
6  */
7 
8 #pragma once
9 
10 #include "hk_private.h"
11 #include "vk_queue.h"
12 
13 struct hk_device;
14 
15 struct hk_queue {
16    struct vk_queue vk;
17 
18    struct {
19       /* Asahi kernel queue ID */
20       uint32_t id;
21 
22       /* Timeline syncobj backing the queue */
23       uint32_t syncobj;
24 
25       /* Current maximum timeline value for the queue's syncobj. If the
26        * syncobj's value equals timeline_value, then all work is complete.
27        */
28       uint32_t timeline_value;
29    } drm;
30 };
31 
32 static inline struct hk_device *
hk_queue_device(struct hk_queue * queue)33 hk_queue_device(struct hk_queue *queue)
34 {
35    return (struct hk_device *)queue->vk.base.device;
36 }
37 
38 VkResult hk_queue_init(struct hk_device *dev, struct hk_queue *queue,
39                        const VkDeviceQueueCreateInfo *pCreateInfo,
40                        uint32_t index_in_family);
41 
42 void hk_queue_finish(struct hk_device *dev, struct hk_queue *queue);
43