summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-17 00:23:04 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-17 00:24:16 +0000
commit3620f9ca459f7bbbb01786c95b5583023b6d870c (patch)
tree3314d071ccbba7358e49e69a31c5ed2f9d296e6c /src
parentb9f59b1099eeba3fb8b25693d4f37dd13267d8a3 (diff)
sna: Cap pwrite buffer alignment to 64k
We only want to create huge pwrite buffers when populating the inactive cache for mmapped uploads. In the absence of using mmap for upload, be more conservative with the alignment value so as not to simply waste valuable aperture and memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 48f8182a..970e462f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2966,10 +2966,10 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
}
/* Be a little more generous and hope to hold fewer mmappings */
- alloc = ALIGN(size, kgem->partial_buffer_size);
bo = NULL;
#if !DBG_NO_MAP_UPLOAD
+ alloc = ALIGN(size, kgem->partial_buffer_size);
if (kgem->has_cpu_bo) {
struct kgem_bo *old;
@@ -3084,6 +3084,8 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
}
}
}
+#else
+ alloc = ALIGN(size, 64*1024);
#endif
if (bo == NULL) {