From 33f3ddd73da5f553accf78ce7e03a76b12f71393 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Dec 2013 09:37:37 +0000 Subject: 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 --- src/sna/kgem.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/sna/kgem.c') 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; -- cgit v1.2.3