| 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 |
/* Ring-idx used with virtgpu, equal to priority + 1 */ |
| 26 |
uint32_t virt_ring_idx; |
| 27 |
|
| 28 |
/* Current maximum timeline value for the queue's syncobj. If the |
| 29 |
* syncobj's value equals timeline_value, then all work is complete. |
| 30 |
*/ |
| 31 |
uint64_t timeline_value; |
| 32 |
} drm; |
| 33 |
}; |
| 34 |
|
| 35 |
static inline struct hk_device * |
| 36 |
hk_queue_device(struct hk_queue *queue) |
| 37 |
{ |
| 38 |
return (struct hk_device *)queue->vk.base.device; |
| 39 |
} |
| 40 |
|
| 41 |
VkResult hk_queue_init(struct hk_device *dev, |
| 42 |
const VkDeviceQueueCreateInfo *pCreateInfo, |
| 43 |
uint32_t index_in_family); |
| 44 |
|
| 45 |
void hk_queue_finish(struct hk_device *dev, struct hk_queue *queue); |