summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-11-17 15:10:56 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-11-17 15:12:15 +0000
commite628d22673dfa494230e6f79ceff7d178137c71a (patch)
tree562c827946754e9b8f7313a5b374a526d5918cd0
parentcb6bff95ed900ffed99750dba9b9605581805904 (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 03509f03..de5ac5e6 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -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);