diff --git a/src/nouveau/vulkan/nvkmd/nouveau/nvkmd_nouveau_ctx.c b/src/nouveau/vulkan/nvkmd/nouveau/nvkmd_nouveau_ctx.c index b416b9b13b6..ee5db423183 100644 --- a/src/nouveau/vulkan/nvkmd/nouveau/nvkmd_nouveau_ctx.c +++ b/src/nouveau/vulkan/nvkmd/nouveau/nvkmd_nouveau_ctx.c @@ -165,7 +165,19 @@ nvkmd_nouveau_exec_ctx_exec(struct nvkmd_ctx *_ctx, struct nvkmd_nouveau_exec_ctx *ctx = nvkmd_nouveau_exec_ctx(_ctx); for (uint32_t i = 0; i < exec_count; i++) { - if (unlikely(ctx->req.push_count >= ctx->max_push)) { + uint32_t incomplete_count = 0; + for (uint32_t j = i; j < exec_count; j++) { + if (!execs[j].incomplete) + break; + + /* The last exec cannot be incomplete */ + assert(j < exec_count - 1); + + incomplete_count++; + } + assert(incomplete_count < ctx->max_push); + + if (unlikely(ctx->req.push_count + incomplete_count >= ctx->max_push)) { VkResult result = nvkmd_nouveau_exec_ctx_flush(&ctx->base, log_obj); if (result != VK_SUCCESS) return result; diff --git a/src/nouveau/vulkan/nvkmd/nvkmd.h b/src/nouveau/vulkan/nvkmd/nvkmd.h index 6296c316057..e6ef8296e08 100644 --- a/src/nouveau/vulkan/nvkmd/nvkmd.h +++ b/src/nouveau/vulkan/nvkmd/nvkmd.h @@ -284,6 +284,11 @@ struct nvkmd_va { struct nvkmd_ctx_exec { uint64_t addr; uint32_t size_B; + /* True if this push ends in an incomplete method and requires the next + * push to provide the method data. In this case, this push and the next + * one must be in the same submit ioctl. + */ + bool incomplete; bool no_prefetch; };