mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 09:30:11 +01:00
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>
This commit is contained in:
parent
9cb945015c
commit
766a6a5a4d
3 changed files with 11 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue