summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-26 20:19:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-27 07:40:48 +0100
commit157e22cb8e96b0a9ffa7d58625fe2396f6084ff9 (patch)
tree8fe9afd756accbb18b8b053ac56253bbcfdb20ad
parentf027b4f628b6d0f4c00f8aba7b27dcf51f91211d (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6556d126..898f9435 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);