From 4e4e10935d2815fb62aeaedbfffe10aad115ec0b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 8 Dec 2012 22:39:32 +0000 Subject: sna: Flush upon change of target if GPU is idle The aim is to improve GPU concurrency by keeping it busy. The possible complication is that we incur more overhead due to small batches. Signed-off-by: Chris Wilson --- src/sna/kgem.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sna/kgem.h') diff --git a/src/sna/kgem.h b/src/sna/kgem.h index e7e53af5..5cd22ccf 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -347,7 +347,9 @@ static inline void kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo) void kgem_clear_dirty(struct kgem *kgem); -static inline void kgem_set_mode(struct kgem *kgem, enum kgem_mode mode) +static inline void kgem_set_mode(struct kgem *kgem, + enum kgem_mode mode, + struct kgem_bo *bo) { assert(!kgem->wedged); @@ -355,6 +357,9 @@ static inline void kgem_set_mode(struct kgem *kgem, enum kgem_mode mode) kgem_submit(kgem); #endif + if (kgem->mode && bo->exec == NULL && kgem_ring_is_idle(kgem, kgem->ring)) + kgem_submit(kgem); + if (kgem->mode == mode) return; -- cgit v1.2.3