summaryrefslogtreecommitdiff
path: root/src/sna/gen5_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-22 10:51:05 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-22 11:09:41 +0100
commit7b1a5024df96070bab70744ad7e7d78a41fb0f72 (patch)
tree8c8ef1cd6e72db3c0afc75076a32f4da0b6655d9 /src/sna/gen5_render.c
parent2737aaab77cc6233826077b90d001fe45efc376c (diff)
sna/gen5: Rework the flush after blend state changes
QA complained that the full flush to memory was too much of a performance hit, so let's try a lighter weight non-stalling pipe flush without. References: https://bugs.freedesktop.org/show_bug.cgi?id=67157 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r--src/sna/gen5_render.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 4fa44c01..85ef653a 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -858,8 +858,9 @@ gen5_emit_pipelined_pointers(struct sna *sna,
OUT_BATCH(sna->render_state.gen5.wm + sp);
OUT_BATCH(sna->render_state.gen5.cc + bp);
+ bp = (sna->render_state.gen5.last_pipelined_pointers & 0x7fff0000) != (bp << 16);
sna->render_state.gen5.last_pipelined_pointers = key;
- return true;
+ return bp;
}
static bool
@@ -1005,6 +1006,15 @@ gen5_emit_vertex_elements(struct sna *sna,
}
}
+inline static void
+gen5_emit_pipe_flush(struct sna *sna)
+{
+ OUT_BATCH(GEN5_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(GEN5_PIPE_CONTROL_WC_FLUSH);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+}
+
static void
gen5_emit_state(struct sna *sna,
const struct sna_composite_op *op,
@@ -1024,14 +1034,17 @@ gen5_emit_state(struct sna *sna,
}
gen5_emit_vertex_elements(sna, op);
- if (flush || kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
+ if (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
DBG(("%s: flushing dirty (%d, %d)\n", __FUNCTION__,
kgem_bo_is_dirty(op->src.bo),
kgem_bo_is_dirty(op->mask.bo)));
OUT_BATCH(MI_FLUSH);
kgem_clear_dirty(&sna->kgem);
kgem_bo_mark_dirty(op->dst.bo);
+ flush = false;
}
+ if (flush)
+ gen5_emit_pipe_flush(sna);
}
static void gen5_bind_surfaces(struct sna *sna,