diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-31 22:08:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-03-31 23:09:43 +0100 |
commit | 61f8dcdfa5972cfd918fc60504345482fedd1a65 (patch) | |
tree | ba203601e995665480a4dd271516191ec41e1d0c /src | |
parent | 56f9d2c1d9770437e82f07f5a40b52940a2e8ef7 (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')
-rw-r--r-- | src/sna/kgem.h | 5 |
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; |