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>
This commit is contained in:
Chris Wilson 2012-01-17 00:23:04 +00:00
parent b9f59b1099
commit 3620f9ca45
1 changed files with 3 additions and 1 deletions

View File

@ -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) {