Commit a81063d2 authored by Iago Toral's avatar Iago Toral Committed by Marge Bot
Browse files

v3dv: ensure we allocate at least the requested space for a CL

While we are already ensuring we allocate at least 8192 bytes should
this not be the first allocation and our allocations are typically just
a few bytes, multilayered framebuffers with large numbers of layers may
require more space than that in a single allocation.

Fixes: 33259506

 ('v3dv: increase BO allocation size when growing CLs')
Reviewed-by: Eric Engestrom's avatarEric Engestrom <>
Part-of: <mesa/mesa!20871>
parent 0c6e56c3
Pipeline #791319 waiting for manual action with stages
......@@ -62,7 +62,10 @@ cl_alloc_bo(struct v3dv_cl *cl, uint32_t space, bool use_branch)
* of allocations with large command buffers. This has a very significant
* impact on the number of draw calls per second reported by vkoverhead.
space = cl->bo ? cl->bo->size * 2 : align(space, 4096);
space = align(space, 4096);
if (cl->bo)
space = MAX2(cl->bo->size * 2, space);
struct v3dv_bo *bo = v3dv_bo_alloc(cl->job->device, space, "CL", true);
if (!bo) {
fprintf(stderr, "failed to allocate memory for command list\n");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment