summaryrefslogtreecommitdiff
path: root/src/sna/gen7_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-10 12:42:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-10 13:24:46 +0100
commit79f8ff4bbb2f723ec21c150c0775e706bc00a834 (patch)
tree434644c84ee85bdb71396b17e02e3ae503ab9300 /src/sna/gen7_render.c
parent8bd9d63a863b88ecd6f72c11468e0940f3bcd9fc (diff)
sna/gen4+: Share a few common routines
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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index f6eef4aa..d597e17c 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -42,6 +42,7 @@
#include "brw/brw.h"
#include "gen7_render.h"
+#include "gen4_common.h"
#include "gen4_source.h"
#include "gen4_vertex.h"
#include "gen6_common.h"
@@ -3709,6 +3710,12 @@ static void gen7_render_reset(struct sna *sna)
sna->render_state.gen7.drawrect_limit = -1;
sna->render_state.gen7.surface_table = -1;
+ if (sna->render.vbo &&
+ !kgem_bo_is_mappable(&sna->kgem, sna->render.vbo)) {
+ 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;
@@ -3837,7 +3844,7 @@ const char *gen7_render_init(struct sna *sna, const char *backend)
sna->kgem.context_switch = gen6_render_context_switch;
sna->kgem.retire = gen6_render_retire;
- sna->kgem.expire = gen6_render_expire;
+ sna->kgem.expire = gen4_render_expire;
#if !NO_COMPOSITE
sna->render.composite = gen7_render_composite;
@@ -3871,7 +3878,7 @@ const char *gen7_render_init(struct sna *sna, const char *backend)
sna->render.clear = gen7_render_clear;
#endif
- sna->render.flush = gen6_render_flush;
+ sna->render.flush = gen4_render_flush;
sna->render.reset = gen7_render_reset;
sna->render.fini = gen7_render_fini;