From 3620f9ca459f7bbbb01786c95b5583023b6d870c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 17 Jan 2012 00:23:04 +0000 Subject: [PATCH] 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 --- src/sna/kgem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {