summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-20 14:58:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-20 15:00:50 +0000
commit650c9d5ce80afc1d4c8d9f77f6679f085fa4dc9d (patch)
tree895513081af928aed1971aa8531129fd59c5bb43
parent492952e0d6362a046a666956afdf8f9bc0f2b7e7 (diff)
sna/gen3+: Reset vertex relocation state after discarding the batch
Fixes a regression from commit a6ecb6d31d8c543f38fca0be6b0ec82e59dcd8d2 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jan 16 09:14:40 2013 +0000 sna: Discard the batch if we are discarding the only buffer in it as we may keep a stale relocation for the vertex buffer alive if we attempt to clear the bo using the render engine before discarding it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c3
-rw-r--r--src/sna/gen4_render.c4
-rw-r--r--src/sna/gen5_render.c4
-rw-r--r--src/sna/gen6_render.c4
-rw-r--r--src/sna/gen7_render.c4
5 files changed, 19 insertions, 0 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 44038616..270bca5d 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1970,6 +1970,9 @@ gen3_render_reset(struct sna *sna)
__FUNCTION__, sna->render.vbo->presumed_offset));
discard_vbo(sna);
}
+
+ sna->render.vertex_reloc[0] = 0;
+ sna->render.vertex_offset = 0;
}
static void
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index a27d3e4a..e1f45281 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2789,6 +2789,10 @@ static void gen4_render_reset(struct sna *sna)
DBG(("%s: discarding unmappable vbo\n", __FUNCTION__));
discard_vbo(sna);
}
+
+ sna->render.vertex_offset = 0;
+ sna->render.nvertex_reloc = 0;
+ sna->render.vb_id = 0;
}
static void gen4_render_fini(struct sna *sna)
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 60ead0e3..695ec331 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2916,6 +2916,10 @@ static void gen5_render_reset(struct sna *sna)
DBG(("%s: discarding unmappable vbo\n", __FUNCTION__));
discard_vbo(sna);
}
+
+ sna->render.vertex_offset = 0;
+ sna->render.nvertex_reloc = 0;
+ sna->render.vb_id = 0;
}
static void gen5_render_fini(struct sna *sna)
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 2cd1b841..82e9d42f 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -3424,6 +3424,10 @@ static void gen6_render_reset(struct sna *sna)
sna->render_state.gen6.drawrect_offset = -1;
sna->render_state.gen6.drawrect_limit = -1;
sna->render_state.gen6.surface_table = -1;
+
+ sna->render.vertex_offset = 0;
+ sna->render.nvertex_reloc = 0;
+ sna->render.vb_id = 0;
}
static void gen6_render_fini(struct sna *sna)
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 79ca5941..d8ad648b 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -3505,6 +3505,10 @@ static void gen7_render_reset(struct sna *sna)
sna->render_state.gen7.drawrect_offset = -1;
sna->render_state.gen7.drawrect_limit = -1;
sna->render_state.gen7.surface_table = -1;
+
+ sna->render.vertex_offset = 0;
+ sna->render.nvertex_reloc = 0;
+ sna->render.vb_id = 0;
}
static void gen7_render_fini(struct sna *sna)