summaryrefslogtreecommitdiff
path: root/src/sna/gen4_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-07 08:58:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-07 08:58:52 +0100
commitc9c1833c30421e1461f6b03b858bbc187068eb0c (patch)
tree66b0913c705bb16f4f1133e7031872114da77e95 /src/sna/gen4_render.c
parent368c909b29758f996dbbdbec4d471df23f60bc04 (diff)
sna/gen4: Tighten FORCE_FLUSH w/a to spot amalgamation of primitives
Inspect whether this rectangle will be added to the previous primitive and so charge it against the current number of inflight rectangles. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen4_render.c')
-rw-r--r--src/sna/gen4_render.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index a5e49e5f..d8cdb36a 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -648,13 +648,18 @@ inline static int gen4_get_rectangles(struct sna *sna,
assert(want);
#if FORCE_FLUSH
- if (sna->render.vertex_offset) {
+ rem = sna->render.vertex_offset;
+ if (sna->kgem.nbatch == sna->render_state.gen4.last_primitive)
+ rem = sna->kgem.nbatch - 5;
+ if (rem) {
rem = 16 - (sna->render.vertex_index - sna->render.vertex_start) / 3;
if (rem <= 0) {
- gen4_vertex_flush(sna);
- if (gen4_magic_ca_pass(sna, op))
- gen4_emit_pipelined_pointers(sna, op, op->op,
- op->u.gen4.wm_kernel);
+ if (sna->render.vertex_offset) {
+ gen4_vertex_flush(sna);
+ if (gen4_magic_ca_pass(sna, op))
+ gen4_emit_pipelined_pointers(sna, op, op->op,
+ op->u.gen4.wm_kernel);
+ }
OUT_BATCH(MI_FLUSH | MI_INHIBIT_RENDER_CACHE_FLUSH);
rem = 16;
}
@@ -2455,8 +2460,7 @@ fallback_blt:
box++;
} while (--n);
- if (!FORCE_FLUSH || sna->render.vertex_offset)
- gen4_vertex_flush(sna);
+ gen4_vertex_flush(sna);
sna_render_composite_redirect_done(sna, &tmp);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
@@ -2694,8 +2698,7 @@ gen4_render_fill_boxes(struct sna *sna,
box++;
} while (--n);
- if (!FORCE_FLUSH || sna->render.vertex_offset)
- gen4_vertex_flush(sna);
+ gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;
}
@@ -2878,8 +2881,7 @@ gen4_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
gen4_render_fill_rectangle(sna, &tmp, x1, y1, x2 - x1, y2 - y1);
- if (!FORCE_FLUSH || sna->render.vertex_offset)
- gen4_vertex_flush(sna);
+ gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
return true;