diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-12-03 09:37:37 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-12-03 09:37:37 +0000 |
commit | 33f3ddd73da5f553accf78ce7e03a76b12f71393 (patch) | |
tree | 1e6cc4dd2b94b72801719f4237158293e1899da4 /src/sna | |
parent | 9a8478dae681212bd7a86640f90e6d47c9393b1a (diff) |
sna: Include Pineview in fence over-allocation checks
When creating the object, we need to take account that fenced regions
in the aperture are in power-of-two sizes and so can be much larger than
the actual object. This includes Pineview, which although is more
relaxed with regards to fence alignment of GPU operations, still imposes
the same restrictions on the fence registers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 4305c761..0d1368cc 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3933,13 +3933,6 @@ unsigned kgem_can_create_2d(struct kgem *kgem, flags |= KGEM_CAN_CREATE_GPU; if (size > kgem->max_gpu_size) flags &= ~KGEM_CAN_CREATE_GPU; - if (kgem->gen < 033) { - int fence_size = 1024 * 1024; - while (fence_size < size) - fence_size <<= 1; - if (fence_size > kgem->max_gpu_size) - flags &= ~KGEM_CAN_CREATE_GPU; - } if (size > 0 && size <= PAGE_SIZE*kgem->aperture_mappable/4) flags |= KGEM_CAN_CREATE_GTT; if (size > PAGE_SIZE*kgem->aperture_mappable/4) @@ -3951,6 +3944,15 @@ unsigned kgem_can_create_2d(struct kgem *kgem, __FUNCTION__, size, kgem->max_object_size)); return 0; } + if (kgem->gen < 040) { + int fence_size = 1024 * 1024; + while (fence_size < size) + fence_size <<= 1; + if (fence_size > kgem->max_gpu_size) + flags &= ~KGEM_CAN_CREATE_GPU; + if (fence_size > PAGE_SIZE*kgem->aperture_mappable/4) + flags &= ~KGEM_CAN_CREATE_GTT; + } } return flags; |