From 6848fb235b1bac84e91d1efde4094540180c4d48 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 23 Jun 2014 11:27:20 +0100 Subject: [PATCH] sna: Fix flushing empty batches A logic inversion in commit 1909910fdf89216d18703e50728f4604f75d5d66 Author: Chris Wilson Date: Sun Jun 22 20:19:22 2014 +0100 sna: Inject a batch flush before adding a fresh bo also applied the injection to when the batch was empty. Reported-by: Jiri Slaby References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c48 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index b54084ce..dfaf878e 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -5217,7 +5217,7 @@ inline static bool needs_reservation(struct kgem *kgem, struct kgem_bo *bo) inline static bool needs_batch_flush(struct kgem *kgem, struct kgem_bo *bo) { - if (kgem->nreloc) + if (kgem->nreloc == 0) return false; if (needs_semaphore(kgem, bo)) {