summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-12 15:20:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-12 15:20:49 +0100
commit1af1dae1feefd6567017170bab241570fb528e5c (patch)
tree7df82353a95fe988bda5277e9936484da423fb54
parente5f137807c318588f546960668345eef34159e26 (diff)
sna: Ensure tiling upload buffers are trimmed to fit in the cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 727cb511..d6a6d283 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -947,6 +947,12 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
kgem->large_object_size = MAX_CACHE_SIZE;
if (kgem->large_object_size > kgem->max_gpu_size)
kgem->large_object_size = kgem->max_gpu_size;
+
+ if (kgem->max_upload_tile_size > kgem->large_object_size)
+ kgem->max_upload_tile_size = kgem->large_object_size;
+ if (kgem->max_copy_tile_size > kgem->large_object_size)
+ kgem->max_copy_tile_size = kgem->large_object_size;
+
if (kgem->has_llc | kgem->has_cacheing | kgem->has_userptr) {
if (kgem->large_object_size > kgem->max_cpu_size)
kgem->large_object_size = kgem->max_cpu_size;