diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-21 21:26:29 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-21 23:24:57 +0000 |
commit | 6038cede83e7f360428b4625d288411794f9d052 (patch) | |
tree | 8bec15da8061a396330611c3ae83cfe27e51574d /src | |
parent | fe6602cbbc4eed1b88ac731a30b46cc970ea444f (diff) |
sna/gen3+: Re-emit composite state after flushing CA vertices
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42891
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/gen3_render.c | 15 | ||||
-rw-r--r-- | src/sna/gen4_render.c | 12 | ||||
-rw-r--r-- | src/sna/gen5_render.c | 15 | ||||
-rw-r--r-- | src/sna/gen6_render.c | 15 | ||||
-rw-r--r-- | src/sna/gen7_render.c | 15 |
5 files changed, 30 insertions, 42 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 189653d0..3c3de12e 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -1566,8 +1566,7 @@ static void gen3_vertex_flush(struct sna *sna) sna->render_state.gen3.vertex_offset = 0; } -static int gen3_vertex_finish(struct sna *sna, - const struct sna_composite_op *op) +static int gen3_vertex_finish(struct sna *sna) { struct kgem_bo *bo; @@ -1575,11 +1574,6 @@ static int gen3_vertex_finish(struct sna *sna, bo = sna->render.vbo; if (bo) { - if (sna->render_state.gen3.vertex_offset) { - gen3_vertex_flush(sna); - gen3_magic_ca_pass(sna, op); - } - DBG(("%s: reloc = %d\n", __FUNCTION__, sna->render.vertex_reloc[0])); @@ -1722,7 +1716,10 @@ static int gen3_get_rectangles__flush(struct sna *sna, if (sna->kgem.nreloc > KGEM_RELOC_SIZE(&sna->kgem) - 1) return 0; - return gen3_vertex_finish(sna, op); + if (op->need_magic_ca_pass && sna->render.vbo) + return 0; + + return gen3_vertex_finish(sna); } inline static int gen3_get_rectangles(struct sna *sna, @@ -2318,7 +2315,7 @@ gen3_align_vertex(struct sna *sna, { if (op->floats_per_vertex != sna->render_state.gen3.last_floats_per_vertex) { if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect) - gen3_vertex_finish(sna, op); + gen3_vertex_finish(sna); DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n", sna->render_state.gen3.last_floats_per_vertex, diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index 24de833e..c9f10a8a 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -364,8 +364,7 @@ static void gen4_vertex_flush(struct sna *sna, gen4_magic_ca_pass(sna, op); } -static int gen4_vertex_finish(struct sna *sna, - const struct sna_composite_op *op) +static int gen4_vertex_finish(struct sna *sna) { struct kgem_bo *bo; unsigned int i; @@ -376,8 +375,6 @@ static int gen4_vertex_finish(struct sna *sna, bo = sna->render.vbo; if (bo) { - gen4_vertex_flush(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__, @@ -1154,7 +1151,10 @@ static int gen4_get_rectangles__flush(struct sna *sna, if (sna->kgem.nreloc > KGEM_RELOC_SIZE(&sna->kgem) - 1) return 0; - return gen4_vertex_finish(sna, op); + if (op->need_magic_ca_pass && sna->render.vbo) + return 0; + + return gen4_vertex_finish(sna); } inline static int gen4_get_rectangles(struct sna *sna, @@ -1306,7 +1306,7 @@ gen4_align_vertex(struct sna *sna, const struct sna_composite_op *op) { if (op->floats_per_vertex != sna->render_state.gen4.floats_per_vertex) { if (sna->render.vertex_size - sna->render.vertex_used < 6*op->floats_per_vertex) - gen4_vertex_finish(sna, op); + gen4_vertex_finish(sna); DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n", sna->render_state.gen4.floats_per_vertex, diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index d4b63137..251eb392 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -347,8 +347,7 @@ static void gen5_vertex_flush(struct sna *sna) sna->render_state.gen5.vertex_offset = 0; } -static int gen5_vertex_finish(struct sna *sna, - const struct sna_composite_op *op) +static int gen5_vertex_finish(struct sna *sna) { struct kgem_bo *bo; unsigned int i; @@ -359,11 +358,6 @@ static int gen5_vertex_finish(struct sna *sna, bo = sna->render.vbo; if (bo) { - if (sna->render_state.gen5.vertex_offset) { - gen5_vertex_flush(sna); - gen5_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__, @@ -1157,7 +1151,10 @@ static int gen5_get_rectangles__flush(struct sna *sna, if (sna->kgem.nreloc > KGEM_RELOC_SIZE(&sna->kgem) - 2) return 0; - return gen5_vertex_finish(sna, op); + if (op->need_magic_ca_pass && sna->render.vbo) + return 0; + + return gen5_vertex_finish(sna); } inline static int gen5_get_rectangles(struct sna *sna, @@ -1312,7 +1309,7 @@ gen5_align_vertex(struct sna *sna, const struct sna_composite_op *op) { if (op->floats_per_vertex != sna->render_state.gen5.floats_per_vertex) { if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect) - gen5_vertex_finish(sna, op); + gen5_vertex_finish(sna); DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n", sna->render_state.gen5.floats_per_vertex, diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 56a0f4a8..e2c78e1d 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -919,8 +919,7 @@ static void gen6_vertex_flush(struct sna *sna) sna->render_state.gen6.vertex_offset = 0; } -static int gen6_vertex_finish(struct sna *sna, - const struct sna_composite_op *op) +static int gen6_vertex_finish(struct sna *sna) { struct kgem_bo *bo; unsigned int i; @@ -933,11 +932,6 @@ static int gen6_vertex_finish(struct sna *sna, bo = sna->render.vbo; if (bo) { - if (sna->render_state.gen6.vertex_offset) { - gen6_vertex_flush(sna); - gen6_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__, @@ -1625,7 +1619,10 @@ static int gen6_get_rectangles__flush(struct sna *sna, if (sna->kgem.nreloc > KGEM_RELOC_SIZE(&sna->kgem) - 2) return 0; - return gen6_vertex_finish(sna, op); + if (op->need_magic_ca_pass && sna->render.vbo) + return 0; + + return gen6_vertex_finish(sna); } inline static int gen6_get_rectangles(struct sna *sna, @@ -1751,7 +1748,7 @@ gen6_align_vertex(struct sna *sna, const struct sna_composite_op *op) if (op->floats_per_vertex != sna->render_state.gen6.floats_per_vertex) { if (sna->render.vertex_size - sna->render.vertex_used < 2*op->floats_per_rect) /* XXX propagate failure */ - gen6_vertex_finish(sna, op); + gen6_vertex_finish(sna); DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n", sna->render_state.gen6.floats_per_vertex, diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index fce19feb..faeedf06 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -1022,8 +1022,7 @@ static void gen7_vertex_flush(struct sna *sna) sna->render_state.gen7.vertex_offset = 0; } -static int gen7_vertex_finish(struct sna *sna, - const struct sna_composite_op *op) +static int gen7_vertex_finish(struct sna *sna) { struct kgem_bo *bo; unsigned int i; @@ -1034,11 +1033,6 @@ 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__, @@ -1659,7 +1653,10 @@ 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, op); + if (op->need_magic_ca_pass && sna->render.vbo) + return 0; + + return gen7_vertex_finish(sna); } inline static int gen7_get_rectangles(struct sna *sna, @@ -1780,7 +1777,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, op); + gen7_vertex_finish(sna); DBG(("aligning vertex: was %d, now %d floats per vertex, %d->%d\n", sna->render_state.gen7.floats_per_vertex, |