summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-07 13:32:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-07 17:26:33 +0100
commitaca0bf6387c159a3d54dbbe52dd65fd92df98216 (patch)
treeb343096ee60f5032f33858c2ca3bf6d29b5b9b95
parent57bf3d5f0fb4429b0991ad6f22000348820f5bd1 (diff)
sna/gen2: Fallback to kernel batch w/a rather than incur a stall
If we have no pinned batches available, use the kernel w/a if available rather than stall waiting for an active batch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6d4e074d..aff08931 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3118,6 +3118,15 @@ out_16384:
if (bo)
return bo;
+ /* Nothing available for reuse, rely on the kernel wa */
+ if (kgem->has_pinned_batches) {
+ bo = kgem_create_linear(kgem, size, CREATE_CACHED | CREATE_TEMPORARY);
+ if (bo) {
+ kgem->batch_flags &= ~LOCAL_I915_EXEC_IS_PINNED;
+ return bo;
+ }
+ }
+
if (size < 16384) {
bo = list_first_entry(&kgem->pinned_batches[size > 4096],
struct kgem_bo,