From e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 5 Feb 2017 22:24:04 +0000 Subject: [PATCH] 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 --- src/sna/gen2_render.c | 11 +++++++---- 1 file 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;