sna/gen2: Take combined vertex arrays into account for inline limit

When extending the vertex array, we have to remove the currently used
inlined dwords from the available limit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2017-02-05 22:24:04 +00:00
parent 38ac6b556d
commit e4fe79cf0d
1 changed files with 7 additions and 4 deletions

View File

@ -1166,9 +1166,6 @@ inline static int gen2_get_rectangles(struct sna *sna,
{
int rem = batch_space(sna), size, need;
if (rem > MAX_INLINE)
rem = MAX_INLINE;
DBG(("%s: want=%d, floats_per_vertex=%d, rem=%d\n",
__FUNCTION__, want, op->floats_per_vertex, rem));
@ -1203,7 +1200,13 @@ inline static int gen2_get_rectangles(struct sna *sna,
sna->render.vertex_offset = sna->kgem.nbatch;
BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST);
}
}
need = 0;
} else
need = sna->kgem.nbatch - sna->render.vertex_offset;
if (rem > MAX_INLINE - need)
rem = MAX_INLINE -need;
if (want > 1 && want * size > rem)
want = rem / size;