From 61f8dcdfa5972cfd918fc60504345482fedd1a65 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 31 Mar 2015 22:08:55 +0100 Subject: 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 --- src/sna/kgem.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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; -- cgit v1.2.3