From 9df9585cb00958b42461b3139bb7aec32090a869 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 14 Dec 2012 15:37:56 +0000 Subject: sna: Reduce fence watermarks Further restrict the amount of fenced bo we try to fit into the batch to make it easier for the kernel to accommodate the request. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index f8b3cff2a..66bf473c4 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3906,9 +3906,12 @@ bool kgem_check_bo_fenced(struct kgem *kgem, struct kgem_bo *bo) if (kgem->nfence >= kgem->fence_max) return false; + if (3*kgem->aperture_fenced > kgem->aperture_mappable) + return false; + size = kgem->aperture_fenced; size += kgem_bo_fenced_size(kgem, bo); - if (4*size > 3*kgem->aperture_mappable) + if (3*size > 2*kgem->aperture_mappable) return false; } @@ -3932,12 +3935,12 @@ bool kgem_check_bo_fenced(struct kgem *kgem, struct kgem_bo *bo) if (kgem->nfence >= kgem->fence_max) return false; - if (2*kgem->aperture_fenced > kgem->aperture_mappable) + if (3*kgem->aperture_fenced > kgem->aperture_mappable) return false; size = kgem->aperture_fenced; size += kgem_bo_fenced_size(kgem, bo); - if (4*size > 3*kgem->aperture_mappable) + if (3*size > 2*kgem->aperture_mappable) return false; } @@ -3982,10 +3985,10 @@ bool kgem_check_many_bo_fenced(struct kgem *kgem, ...) if (kgem->nfence + num_fence > kgem->fence_max) return false; - if (2*kgem->aperture_fenced > kgem->aperture_mappable) + if (3*kgem->aperture_fenced > kgem->aperture_mappable) return false; - if (4*(fenced_size + kgem->aperture_fenced) > 3*kgem->aperture_mappable) + if (3*(fenced_size + kgem->aperture_fenced) > 2*kgem->aperture_mappable) return false; } -- cgit v1.2.3