1 /* 2 * Copyright © 2022 Collabora Ltd. and Red Hat Inc. 3 * SPDX-License-Identifier: MIT 4 */ 5 #ifndef NVK_QUEUE_H 6 #define NVK_QUEUE_H 1 7 8 #include "nvk_private.h" 9 10 #include "vk_queue.h" 11 #include "nvkmd/nvkmd.h" 12 13 struct nouveau_ws_bo; 14 struct nouveau_ws_context; 15 struct novueau_ws_push; 16 struct nv_push; 17 struct nvk_device; 18 struct nvkmd_mem; 19 struct nvkmd_ctx; 20 21 struct nvk_queue_state { 22 struct { 23 struct nvkmd_mem *mem; 24 uint32_t alloc_count; 25 } images; 26 27 struct { 28 struct nvkmd_mem *mem; 29 uint32_t alloc_count; 30 } samplers; 31 32 struct { 33 struct nvkmd_mem *mem; 34 uint32_t bytes_per_warp; 35 uint32_t bytes_per_tpc; 36 } slm; 37 }; 38 39 struct nvk_queue { 40 struct vk_queue vk; 41 42 enum nvkmd_engines engines; 43 44 struct nvkmd_ctx *bind_ctx; 45 struct nvkmd_ctx *exec_ctx; 46 47 struct nvk_queue_state state; 48 49 /* CB0 for all draw commands on this queue */ 50 struct nvkmd_mem *draw_cb0; 51 }; 52 53 static inline struct nvk_device * nvk_queue_device(struct nvk_queue * queue)54nvk_queue_device(struct nvk_queue *queue) 55 { 56 return (struct nvk_device *)queue->vk.base.device; 57 } 58 59 VkResult nvk_queue_init(struct nvk_device *dev, struct nvk_queue *queue, 60 const VkDeviceQueueCreateInfo *pCreateInfo, 61 uint32_t index_in_family); 62 63 void nvk_queue_finish(struct nvk_device *dev, struct nvk_queue *queue); 64 65 VkResult nvk_push_draw_state_init(struct nvk_queue *queue, 66 struct nv_push *p); 67 68 VkResult nvk_push_dispatch_state_init(struct nvk_queue *queue, 69 struct nv_push *p); 70 71 #endif 72