From 57812e6089228f6995cd780c160bc372ac953e3d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 26 Jun 2014 20:19:52 +0100 Subject: [PATCH] sna: Only reuse pinned batches for 830/845 Trying to fly too close to the sun. :( Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80558 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index f914414..791cf95 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3102,29 +3102,33 @@ out_16384: } } - if (kgem->gen == 020 && !kgem->has_pinned_batches) { - assert(size <= 16384); + if (kgem->gen == 020) { + bo = kgem_create_linear(kgem, size, CREATE_CACHED | CREATE_TEMPORARY); + if (bo) + return bo; - bo = list_first_entry(&kgem->pinned_batches[size > 4096], - struct kgem_bo, - list); - list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]); + if (size < 16384) { + bo = list_first_entry(&kgem->pinned_batches[size > 4096], + struct kgem_bo, + list); + list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]); - DBG(("%s: syncing due to busy batches\n", __FUNCTION__)); + DBG(("%s: syncing due to busy batches\n", __FUNCTION__)); - VG_CLEAR(set_domain); - set_domain.handle = bo->handle; - set_domain.read_domains = I915_GEM_DOMAIN_GTT; - set_domain.write_domain = I915_GEM_DOMAIN_GTT; - if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { - DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); - kgem_throttle(kgem); - return NULL; - } + VG_CLEAR(set_domain); + set_domain.handle = bo->handle; + set_domain.read_domains = I915_GEM_DOMAIN_GTT; + set_domain.write_domain = I915_GEM_DOMAIN_GTT; + if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { + DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); + kgem_throttle(kgem); + return NULL; + } - kgem_retire(kgem); - assert(bo->rq == NULL); - return kgem_bo_reference(bo); + kgem_retire(kgem); + assert(bo->rq == NULL); + return kgem_bo_reference(bo); + } } return kgem_create_linear(kgem, size, CREATE_NO_THROTTLE); -- 1.9.1