diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-05 22:24:04 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-05 22:26:00 +0000 |
commit | e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1 (patch) | |
tree | f4f625d9dce6fb4f0285922cfa5f97815315933b | |
parent | 38ac6b556dae914325980d135a81719c9dfda000 (diff) |
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>
-rw-r--r-- | src/sna/gen2_render.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 11e8e52b..49ad16a3 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -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; |