summaryrefslogtreecommitdiff
path: root/src/sna/gen7_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-21 21:26:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-21 21:40:40 +0000
commitfe6602cbbc4eed1b88ac731a30b46cc970ea444f (patch)
tree912a7e55f717d01e24f2ac794ebd824f82c98b74 /src/sna/gen7_render.c
parent168c87a340119e65b1d7ccbbf59da820044ca936 (diff)
sna/gen3+: Only flush the vertices after checking for end-of-batch
Or upon actually closing the vertex buffer. However, the underlying issue remains. That is we are failing to re-emit the first-pass for CA text after flushing the vertex buffer (and so emitting the second-pass for the flushed vertices). Reported-by: lemens Eisserer <linuxhippy@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=42891 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen7_render.c')
-rw-r--r--src/sna/gen7_render.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 5294547b..fce19feb 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -1022,7 +1022,8 @@ static void gen7_vertex_flush(struct sna *sna)
sna->render_state.gen7.vertex_offset = 0;
}
-static int gen7_vertex_finish(struct sna *sna)
+static int gen7_vertex_finish(struct sna *sna,
+ const struct sna_composite_op *op)
{
struct kgem_bo *bo;
unsigned int i;
@@ -1033,6 +1034,11 @@ static int gen7_vertex_finish(struct sna *sna)
bo = sna->render.vbo;
if (bo) {
+ if (sna->render_state.gen7.vertex_offset) {
+ gen7_vertex_flush(sna);
+ gen7_magic_ca_pass(sna, op);
+ }
+
for (i = 0; i < ARRAY_SIZE(sna->render.vertex_reloc); i++) {
if (sna->render.vertex_reloc[i]) {
DBG(("%s: reloc[%d] = %d\n", __FUNCTION__,
@@ -1646,11 +1652,6 @@ static bool gen7_rectangle_begin(struct sna *sna,
static int gen7_get_rectangles__flush(struct sna *sna,
const struct sna_composite_op *op)
{
- if (sna->render_state.gen7.vertex_offset) {
- gen7_vertex_flush(sna);
- gen7_magic_ca_pass(sna, op);
- }
-
if (!kgem_check_batch(&sna->kgem, op->need_magic_ca_pass ? 65 : 6))
return 0;
if (sna->kgem.nexec > KGEM_EXEC_SIZE(&sna->kgem) - 1)
@@ -1658,7 +1659,7 @@ static int gen7_get_rectangles__flush(struct sna *sna,
if (sna->kgem.nreloc > KGEM_RELOC_SIZE(&sna->kgem) - 2)
return 0;
- return gen7_vertex_finish(sna);
+ return gen7_vertex_finish(sna, op);
}
inline static int gen7_get_rectangles(struct sna *sna,
@@ -1671,8 +1672,13 @@ inline static int gen7_get_rectangles(struct sna *sna,
DBG(("flushing vbo for %s: %d < %d\n",
__FUNCTION__, rem, op->floats_per_rect));
rem = gen7_get_rectangles__flush(sna, op);
- if (rem == 0)
+ if (rem == 0) {
+ if (sna->render_state.gen7.vertex_offset) {
+ gen7_vertex_flush(sna);
+ gen7_magic_ca_pass(sna, op);
+ }
return 0;
+ }
}
if (sna->render_state.gen7.vertex_offset == 0 &&
@@ -1774,7 +1780,7 @@ gen7_align_vertex(struct sna *sna, const struct sna_composite_op *op)
{
if (op->floats_per_vertex != sna->render_state.gen7.floats_per_vertex) {
if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect)
- gen7_vertex_finish(sna);
+ gen7_vertex_finish(sna, op);
DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n",
sna->render_state.gen7.floats_per_vertex,