summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-07 16:43:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-07 16:43:32 +0000
commit4b7bbb2a23b03bac63f864c33f47fab88dedbf67 (patch)
tree2099217881b851d19a131da7fba90742427537d1 /src/sna/kgem.h
parent65a8c23ca1bc8e2ebd087027a30358704d4bf11c (diff)
sna: Only flush before adding fresh surfaces to the batch
Previously, before every operation we would look to see if the GPU was idle and we were running under a DRI compositor. If the GPU was idle, we would flush the batch in the hope that we reduce the cost of the context switch and copy from the compositor (by completing the work earlier). However, we would complete the work far too earlier and as a result would need to flush the batch before every single operation resulting in extra overhead and reduced performance. For example, the gtkperf circles benchmark under gnome-shell/compiz would be 2x slower on Ivybridge. Reported-by: Michael Larabel <michael@phoronix.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r--src/sna/kgem.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 2d04b53c..8a3a4fa2 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -294,7 +294,7 @@ static inline void kgem_submit(struct kgem *kgem)
static inline bool kgem_flush(struct kgem *kgem)
{
- return kgem->flush && kgem_is_idle(kgem);
+ return kgem->flush && list_is_empty(&kgem->requests[kgem->ring]);
}
static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo)