From c5313620a2f66bc8daf211fc77a9c480a79ea271 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 31 May 2012 15:06:16 +0100 Subject: [PATCH] sna: Suppress flushes once we have cleared the kernel dirtiness Signed-off-by: Chris Wilson --- src/sna/kgem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 15261b6c..537a6b04 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -2954,7 +2954,11 @@ void _kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo) bool __kgem_flush(struct kgem *kgem, struct kgem_bo *bo) { /* The kernel will emit a flush *and* update its own flushing lists. */ - return kgem_busy(kgem, bo->handle); + if (!bo->needs_flush) + return false; + + bo->needs_flush = kgem_busy(kgem, bo->handle); + return bo->needs_flush; } bool kgem_check_bo(struct kgem *kgem, ...)