xf86-video-intel: src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Dec 3 01:39:45 PST 2013


 src/sna/kgem.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 33f3ddd73da5f553accf78ce7e03a76b12f71393
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Dec 3 09:37:37 2013 +0000

    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 at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 4305c76..0d1368c 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;


More information about the xorg-commit mailing list