nvk: always sync internal cmd bufs for vma lifetimes.

We always sync on the internal push buf submissions for zero vram
and ctx setup, these shouldn't be bottlenecks.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Dave Airlie
2022-11-02 16:54:33 +10:00
committed by Marge Bot
parent 9d7d76cddc
commit c815ff1661
6 changed files with 11 additions and 17 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ nvk_queue_init_context_draw_state(struct nvk_queue *queue)
P_IMMD(p, NVB0C0, SET_SELECT_MAXWELL_TEXTURE_HEADERS, V_TRUE);
return nvk_queue_submit_simple(queue, nv_push_dw_count(&push), push_data,
0, NULL, false /* sync */);
0, NULL);
}
void
+1 -1
View File
@@ -89,7 +89,7 @@ zero_vram(struct nvk_device *dev, struct nouveau_ws_bo *bo)
P_NV902D_RENDER_SOLID_PRIM_POINT_Y(p, 1, height);
return nvk_queue_submit_simple(&dev->queue, nv_push_dw_count(&push),
push_data, 1, &bo, false /* sync */);
push_data, 1, &bo);
}
static enum nouveau_ws_bo_flags
+1 -2
View File
@@ -131,8 +131,7 @@ nvk_heap_grow_locked(struct nvk_device *dev, struct nvk_heap *heap)
struct nouveau_ws_bo *push_bos[] = { new_bo, old_bo, };
result = nvk_queue_submit_simple(&dev->queue,
nv_push_dw_count(&push), push_dw,
ARRAY_SIZE(push_bos), push_bos,
true /* sync */);
ARRAY_SIZE(push_bos), push_bos);
if (result != VK_SUCCESS) {
nouveau_ws_bo_unmap(new_bo, new_bo_map);
nouveau_ws_bo_destroy(new_bo);
+3 -6
View File
@@ -365,8 +365,7 @@ VkResult
nvk_queue_submit_simple(struct nvk_queue *queue,
uint32_t dw_count, const uint32_t *dw,
uint32_t extra_bo_count,
struct nouveau_ws_bo **extra_bos,
bool sync)
struct nouveau_ws_bo **extra_bos)
{
struct nvk_device *dev = nvk_queue_device(queue);
struct nouveau_ws_bo *push_bo;
@@ -384,12 +383,10 @@ nvk_queue_submit_simple(struct nvk_queue *queue,
memcpy(push_map, dw, dw_count * 4);
const bool debug_sync = dev->ws_dev->debug_flags & NVK_DEBUG_PUSH_SYNC;
result = nvk_queue_submit_simple_drm_nouveau(queue, dw_count, push_bo,
extra_bo_count, extra_bos,
sync || debug_sync);
extra_bo_count, extra_bos);
const bool debug_sync = dev->ws_dev->debug_flags & NVK_DEBUG_PUSH_SYNC;
if ((debug_sync && result != VK_SUCCESS) ||
(dev->ws_dev->debug_flags & NVK_DEBUG_PUSH_DUMP)) {
struct nv_push push = {
+3 -4
View File
@@ -63,18 +63,17 @@ void nvk_queue_finish(struct nvk_device *dev, struct nvk_queue *queue);
VkResult nvk_queue_init_context_draw_state(struct nvk_queue *queue);
/* this always syncs, so only use when that doesn't matter */
VkResult nvk_queue_submit_simple(struct nvk_queue *queue,
uint32_t dw_count, const uint32_t *dw,
uint32_t extra_bo_count,
struct nouveau_ws_bo **extra_bos,
bool sync);
struct nouveau_ws_bo **extra_bos);
VkResult nvk_queue_submit_simple_drm_nouveau(struct nvk_queue *queue,
uint32_t push_dw_count,
struct nouveau_ws_bo *push_bo,
uint32_t extra_bo_count,
struct nouveau_ws_bo **extra_bos,
bool sync);
struct nouveau_ws_bo **extra_bos);
VkResult nvk_queue_submit_drm_nouveau(struct nvk_queue *queue,
struct vk_queue_submit *submit,
+2 -3
View File
@@ -118,8 +118,7 @@ nvk_queue_submit_simple_drm_nouveau(struct nvk_queue *queue,
uint32_t push_dw_count,
struct nouveau_ws_bo *push_bo,
uint32_t extra_bo_count,
struct nouveau_ws_bo **extra_bos,
bool sync)
struct nouveau_ws_bo **extra_bos)
{
struct nvk_device *dev = nvk_queue_device(queue);
@@ -130,7 +129,7 @@ nvk_queue_submit_simple_drm_nouveau(struct nvk_queue *queue,
for (uint32_t i = 0; i < extra_bo_count; i++)
push_add_bo(&pb, extra_bos[i], NOUVEAU_WS_BO_RDWR);
return push_submit(&pb, queue, sync);
return push_submit(&pb, queue, true);
}
static void