diff options
author | Faith Ekstrand <faith.ekstrand@collabora.com> | 2023-07-21 15:03:25 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-08-04 21:32:07 +0000 |
commit | 766a6a5a4d4e2d09780af005bcc39a6dbd8f7e85 (patch) | |
tree | 6c81effad2365b4212645d15abc7ea8389410c15 | |
parent | 9cb945015caf81ee7840e54af17406648ef5fc13 (diff) |
nvk: Use an empty EXEC for the empty submit case
The new UAPI allows for an EXEC with zero pushes just fine so we no
longer need the no-op push just for synchronization. This lets us drop
the whole empty push we allocate per-queue as well.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
-rw-r--r-- | src/nouveau/vulkan/nvk_queue.c | 7 | ||||
-rw-r--r-- | src/nouveau/vulkan/nvk_queue.h | 2 | ||||
-rw-r--r-- | src/nouveau/vulkan/nvk_queue_drm_nouveau.c | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/nouveau/vulkan/nvk_queue.c b/src/nouveau/vulkan/nvk_queue.c index 85e6844ca91..2d5c0c0e864 100644 --- a/src/nouveau/vulkan/nvk_queue.c +++ b/src/nouveau/vulkan/nvk_queue.c @@ -325,6 +325,8 @@ nvk_queue_init(struct nvk_device *dev, struct nvk_queue *queue, goto fail_init; } #endif + +#if NVK_NEW_UAPI == 0 void *empty_push_map; queue->empty_push = nouveau_ws_bo_new_mapped(dev->ws_dev, 4096, 0, NOUVEAU_WS_BO_GART | @@ -344,6 +346,7 @@ nvk_queue_init(struct nvk_device *dev, struct nvk_queue *queue, queue->empty_push_dw_count = nv_push_dw_count(&push); } nouveau_ws_bo_unmap(queue->empty_push, empty_push_map); +#endif result = nvk_queue_init_context_draw_state(queue); if (result != VK_SUCCESS) @@ -352,7 +355,9 @@ nvk_queue_init(struct nvk_device *dev, struct nvk_queue *queue, return VK_SUCCESS; fail_empty_push: +#if NVK_NEW_UAPI == 0 nouveau_ws_bo_destroy(queue->empty_push); +#endif fail_init: vk_queue_finish(&queue->vk); @@ -367,7 +372,9 @@ nvk_queue_finish(struct nvk_device *dev, struct nvk_queue *queue) ASSERTED int err = drmSyncobjDestroy(dev->ws_dev->fd, queue->syncobj_handle); assert(err == 0); #endif +#if NVK_NEW_UAPI == 0 nouveau_ws_bo_destroy(queue->empty_push); +#endif vk_queue_finish(&queue->vk); } diff --git a/src/nouveau/vulkan/nvk_queue.h b/src/nouveau/vulkan/nvk_queue.h index 65c113c9512..7cf695338e8 100644 --- a/src/nouveau/vulkan/nvk_queue.h +++ b/src/nouveau/vulkan/nvk_queue.h @@ -45,8 +45,10 @@ struct nvk_queue { struct nvk_queue_state state; +#if NVK_NEW_UAPI == 0 struct nouveau_ws_bo *empty_push; uint32_t empty_push_dw_count; +#endif uint32_t syncobj_handle; }; diff --git a/src/nouveau/vulkan/nvk_queue_drm_nouveau.c b/src/nouveau/vulkan/nvk_queue_drm_nouveau.c index 6cca10e3378..b387530d90b 100644 --- a/src/nouveau/vulkan/nvk_queue_drm_nouveau.c +++ b/src/nouveau/vulkan/nvk_queue_drm_nouveau.c @@ -458,8 +458,10 @@ nvk_queue_submit_drm_nouveau(struct nvk_queue *queue, if (is_vmbind) { assert(submit->command_buffer_count == 0); } else if (submit->command_buffer_count == 0) { +#if NVK_NEW_UAPI == 0 push_add_push_bo(&pb, queue->empty_push, 0, queue->empty_push_dw_count * 4); +#endif } else { push_add_queue_state(&pb, &queue->state); |