From e3732a6f7f61a959521be9a668bba045591e633c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 15 Jan 2012 11:06:59 +0000 Subject: sna: Defer ring switching until after a period of idleness Similar to the desire to flush the next batch after an overflow, we do not want to incur any lag in the midst of drawing, even if that lag is mitigated by GPU semaphores. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 32d3fa0a..fd5679ae 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1107,7 +1107,7 @@ bool kgem_retire(struct kgem *kgem) } kgem->need_retire = !list_is_empty(&kgem->requests); - if (!kgem->need_retire && kgem->ring) + if (kgem->ring && (kgem->has_semaphores || !kgem->need_retire)) kgem->ring = kgem->mode; DBG(("%s -- need_retire=%d\n", __FUNCTION__, kgem->need_retire)); @@ -1412,8 +1412,6 @@ void kgem_reset(struct kgem *kgem) kgem->nbatch = 0; kgem->surface = kgem->max_batch_size; kgem->mode = KGEM_NONE; - if (kgem->has_semaphores) - kgem->ring = KGEM_NONE; kgem->flush = 0; kgem->scanout = 0; -- cgit v1.2.3