summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-03-31 22:08:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-03-31 23:09:43 +0100
commit61f8dcdfa5972cfd918fc60504345482fedd1a65 (patch)
treeba203601e995665480a4dd271516191ec41e1d0c /src/sna/kgem.h
parent56f9d2c1d9770437e82f07f5a40b52940a2e8ef7 (diff)
sna: Consider idleness of both rings if we need a semaphore
When emitting batches early for improved GPU/CPU concurrency, we only want to do so if the target ring is not busy. However, if the batch requires a semaphore, we also need to consider the other ring as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r--src/sna/kgem.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 51072e29..f1042a02 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -344,6 +344,11 @@ static inline bool kgem_ring_is_idle(struct kgem *kgem, int ring)
{
ring = ring == KGEM_BLT;
+ if (kgem->needs_semaphore &&
+ !list_is_empty(&kgem->requests[!ring]) &&
+ !__kgem_ring_is_idle(kgem, !ring))
+ return false;
+
if (list_is_empty(&kgem->requests[ring]))
return true;