From: Faith Ekstrand Date: Fri, 21 Jul 2023 20:03:25 +0000 (-0500) Subject: nvk: Use an empty EXEC for the empty submit case X-Git-Tag: upstream/23.3.3~3760 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=766a6a5a4d4e2d09780af005bcc39a6dbd8f7e85;p=platform%2Fupstream%2Fmesa.git 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 Part-of: --- diff --git a/src/nouveau/vulkan/nvk_queue.c b/src/nouveau/vulkan/nvk_queue.c index 85e6844..2d5c0c0 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 65c113c..7cf6953 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 6cca10e..b387530 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);