summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-02 14:34:23 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-02 14:34:23 +0000
commit1c653786895fc30be0e88455ce5f9caf9adc835d (patch)
tree88246622b610bb07cf47361bf49f4c383eabc28e /src/sna/gen6_render.c
parent29ec36ff063472e0744af99aa81ed5ad8e291a36 (diff)
sna: Pass usage hint for creating linear buffers
As we wish to immediate map the vertices buffers, it is beneficial to search the linear cache for an existing mapping to reuse first. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 439fb521..71c0046e 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -964,9 +964,10 @@ static int gen6_vertex_finish(struct sna *sna)
}
sna->render.vertices = NULL;
- sna->render.vbo = kgem_create_linear(&sna->kgem, 256*1024);
+ sna->render.vbo = kgem_create_linear(&sna->kgem,
+ 256*1024, CREATE_GTT_MAP);
if (sna->render.vbo)
- sna->render.vertices = kgem_bo_map__cpu(&sna->kgem, sna->render.vbo);
+ sna->render.vertices = kgem_bo_map(&sna->kgem, sna->render.vbo);
if (sna->render.vertices == NULL) {
kgem_bo_destroy(&sna->kgem, sna->render.vbo);
sna->render.vbo = NULL;
@@ -1024,7 +1025,8 @@ static void gen6_vertex_close(struct sna *sna)
bo = NULL;
sna->kgem.nbatch += sna->render.vertex_used;
} else {
- bo = kgem_create_linear(&sna->kgem, 4*sna->render.vertex_used);
+ bo = kgem_create_linear(&sna->kgem,
+ 4*sna->render.vertex_used, 0);
if (bo && !kgem_bo_write(&sna->kgem, bo,
sna->render.vertex_data,
4*sna->render.vertex_used)) {