Commit e628d226 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

sna: Fix overflow calculation for number of boxes that fit

We detect when the number of boxes we wished to emit into the batch
would overflow, but then miscalculated the number that would actually fit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=112296

Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent cb6bff95
......@@ -491,7 +491,7 @@ fallback:
nbox_this_time = tmp_nbox;
rem = kgem_batch_space(kgem);
if (10*nbox_this_time > rem)
nbox_this_time = rem / 8;
nbox_this_time = rem / 10;
if (2*nbox_this_time > KGEM_RELOC_SIZE(kgem) - kgem->nreloc)
nbox_this_time = (KGEM_RELOC_SIZE(kgem) - kgem->nreloc) / 2;
assert(nbox_this_time);
......@@ -1061,7 +1061,7 @@ tile:
nbox_this_time = nbox;
rem = kgem_batch_space(kgem);
if (10*nbox_this_time > rem)
nbox_this_time = rem / 8;
nbox_this_time = rem / 10;
if (2*nbox_this_time > KGEM_RELOC_SIZE(kgem) - kgem->nreloc)
nbox_this_time = (KGEM_RELOC_SIZE(kgem) - kgem->nreloc) / 2;
assert(nbox_this_time);
......@@ -1563,7 +1563,7 @@ tile:
nbox_this_time = nbox;
rem = kgem_batch_space(kgem);
if (10*nbox_this_time > rem)
nbox_this_time = rem / 8;
nbox_this_time = rem / 10;
if (2*nbox_this_time > KGEM_RELOC_SIZE(kgem) - kgem->nreloc)
nbox_this_time = (KGEM_RELOC_SIZE(kgem) - kgem->nreloc) / 2;
assert(nbox_this_time);
......
Markdown is supported
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