summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-30 11:48:59 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-30 12:05:51 +0000
commit6f99555b6b64a0e1baad1853569f7bf521c327c3 (patch)
tree30b0c6dbb02d5962ca2ad6a23c9476c86d1b3130
parentc65ec096e79aa6bda7b2b3ef235e3fd9698b4da7 (diff)
sna: Allow the creation of render targets larger than the maximum bo cache
Given that we now handle uploads to and from bo that are larger than the aperture and that usage of such large bo is rare and so unlikely to benefit from caching, allow them to be created as render targets and destroy as soon as they become inactive. In principle, this finally enables GPU acceleration of ocitysmap on gen4+, but due to the large cost of creating and destroying large bo it is disabled on systems that require clflushing. It is, however, a pre-requisite for exploiting the enhanced capabilities of IvyBridge. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 30c46fb7..d97a6ac2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -661,7 +661,9 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
kgem->max_object_size = kgem->aperture_total / 2;
kgem->max_cpu_size = kgem->aperture_total / 2;
- kgem->max_gpu_size = MAX_CACHE_SIZE;
+ kgem->max_gpu_size = kgem->aperture_total / 2;
+ if (!kgem->has_llc)
+ kgem->max_gpu_size = MAX_CACHE_SIZE;
if (gen < 40) {
/* If we have to use fences for blitting, we have to make
* sure we can fit them into the aperture.
@@ -672,8 +674,9 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
}
if (kgem->max_gpu_size > kgem->max_cpu_size)
kgem->max_gpu_size = kgem->max_cpu_size;
+
kgem->max_tile_size = kgem->aperture_total / 4;
- if (kgem->max_tile_size < kgem->max_gpu_size / 2)
+ if (kgem->max_tile_size > kgem->max_gpu_size / 2)
kgem->max_tile_size = kgem->max_gpu_size / 2;
DBG(("%s: max object size (gpu=%d, cpu=%d, tile=%d)\n",