summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-20 14:55:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-20 14:55:06 +0000
commit492952e0d6362a046a666956afdf8f9bc0f2b7e7 (patch)
treecd708f5ba21093f4e42d4127cc34e709077f2074
parentb52c921204df6b2486717fcef05b4a1993aa1071 (diff)
sna/gen3+: Handle flushing vbo for CA glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c12
-rw-r--r--src/sna/gen4_render.c5
-rw-r--r--src/sna/gen4_vertex.c4
-rw-r--r--src/sna/gen5_render.c6
-rw-r--r--src/sna/gen6_render.c6
-rw-r--r--src/sna/gen7_render.c6
6 files changed, 25 insertions, 14 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 0040c42e..44038616 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1613,15 +1613,13 @@ static int gen3_vertex_finish(struct sna *sna)
DBG(("%s: used=%d/%d, vbo active? %d\n",
__FUNCTION__, sna->render.vertex_used, sna->render.vertex_size,
sna->render.vbo ? sna->render.vbo->handle : 0));
+ assert(sna->render.vertex_offset == 0);
assert(sna->render.vertex_used);
assert(sna->render.vertex_used <= sna->render.vertex_size);
assert(sna->render.vertex_reloc[0]);
bo = sna->render.vbo;
if (bo) {
- if (sna->render.vertex_offset)
- gen3_vertex_flush(sna);
-
DBG(("%s: reloc = %d\n", __FUNCTION__,
sna->render.vertex_reloc[0]));
@@ -1785,8 +1783,10 @@ static int gen3_get_rectangles__flush(struct sna *sna,
if (!kgem_check_reloc_and_exec(&sna->kgem, 1))
return 0;
- if (op->need_magic_ca_pass && sna->render.vbo)
- return 0;
+ if (sna->render.vertex_offset) {
+ gen3_vertex_flush(sna);
+ gen3_magic_ca_pass(sna, op);
+ }
return gen3_vertex_finish(sna);
}
@@ -1832,6 +1832,8 @@ flush:
}
_kgem_submit(&sna->kgem);
gen3_emit_composite_state(sna, op);
+ assert(sna->render.vertex_offset == 0);
+ assert(sna->render.vertex_reloc[0] == 0);
goto start;
}
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 6b3f864e..a27d3e4a 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -613,6 +613,11 @@ static int gen4_get_rectangles__flush(struct sna *sna,
if (op->need_magic_ca_pass && sna->render.vbo)
return 0;
+ if (sna->render.vertex_offset) {
+ gen4_vertex_flush(sna);
+ gen4_magic_ca_pass(sna, op);
+ }
+
return gen4_vertex_finish(sna);
}
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c
index 98914531..d34d0d8c 100644
--- a/src/sna/gen4_vertex.c
+++ b/src/sna/gen4_vertex.c
@@ -55,6 +55,7 @@ int gen4_vertex_finish(struct sna *sna)
DBG(("%s: used=%d / %d\n", __FUNCTION__,
sna->render.vertex_used, sna->render.vertex_size));
+ assert(sna->render.vertex_offset == 0);
assert(sna->render.vertex_used);
assert(sna->render.nvertex_reloc);
@@ -62,9 +63,6 @@ int gen4_vertex_finish(struct sna *sna)
bo = sna->render.vbo;
if (bo) {
- if (sna->render.vertex_offset)
- gen4_vertex_flush(sna);
-
for (i = 0; i < sna->render.nvertex_reloc; i++) {
DBG(("%s: reloc[%d] = %d\n", __FUNCTION__,
i, sna->render.vertex_reloc[i]));
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index eec2f836..60ead0e3 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -599,8 +599,10 @@ static int gen5_get_rectangles__flush(struct sna *sna,
if (!kgem_check_reloc_and_exec(&sna->kgem, 2))
return 0;
- if (op->need_magic_ca_pass && sna->render.vbo)
- return 0;
+ if (sna->render.vertex_offset) {
+ gen4_vertex_flush(sna);
+ gen5_magic_ca_pass(sna, op);
+ }
return gen4_vertex_finish(sna);
}
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 7af59ae5..2cd1b841 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1145,8 +1145,10 @@ static int gen6_get_rectangles__flush(struct sna *sna,
if (!kgem_check_reloc_and_exec(&sna->kgem, 2))
return 0;
- if (op->need_magic_ca_pass && sna->render.vbo)
- return 0;
+ if (sna->render.vertex_offset) {
+ gen4_vertex_flush(sna);
+ gen6_magic_ca_pass(sna, op);
+ }
return gen4_vertex_finish(sna);
}
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 5880e7ab..79ca5941 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -1272,8 +1272,10 @@ static int gen7_get_rectangles__flush(struct sna *sna,
if (!kgem_check_reloc_and_exec(&sna->kgem, 2))
return 0;
- if (op->need_magic_ca_pass && sna->render.vbo)
- return 0;
+ if (sna->render.vertex_offset) {
+ gen4_vertex_flush(sna);
+ gen7_magic_ca_pass(sna, op);
+ }
return gen4_vertex_finish(sna);
}