summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-20 15:22:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-20 15:42:55 +0100
commit88d840b53d64e67cfee14cc4cef8da46d716c401 (patch)
treea21ddfef6266da22eea20c9b58d2f574f55c0926
parent84bd6e51199bf8b49e6f6e0c29a1d71c89f6996f (diff)
sna/gen4: Check for sufficient batch space before emitting pipelined pointers
For the broken shader workaround, we need to reset the pipeline state before every blt as the state is changed by the magic CA pass. So we need to check that we actually have sufficient space to emit the pipelined pointers before doing so. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen4_render.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 0412f813..20f8bf09 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1453,10 +1453,14 @@ gen4_render_composite_blt(struct sna *sna,
r->dst.x, r->dst.y, op->dst.x, op->dst.y,
r->width, r->height));
- if (FLUSH_EVERY_VERTEX && op->need_magic_ca_pass)
+ if (FLUSH_EVERY_VERTEX && op->need_magic_ca_pass) {
/* We have to reset the state after every FLUSH */
- gen4_emit_pipelined_pointers(sna, op,
- op->op, op->u.gen4.wm_kernel);
+ if (kgem_check_batch(&sna->kgem, 20)) {
+ gen4_emit_pipelined_pointers(sna, op, op->op,
+ op->u.gen4.wm_kernel);
+ } else
+ gen4_bind_surfaces(sna, op);
+ }
if (!gen4_get_rectangles(sna, op, 1)) {
gen4_bind_surfaces(sna, op);