Mesa (master): freedreno: avoid unneccessary batch flush
Rob Clark
robclark at kemper.freedesktop.org
Sun Dec 3 19:53:37 UTC 2017
Module: Mesa
Branch: master
Commit: 91730fb0ffc77682cfd5cebbefdad2f8f92f2431
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=91730fb0ffc77682cfd5cebbefdad2f8f92f2431
Author: Rob Clark <robdclark at gmail.com>
Date: Sun Nov 19 16:45:04 2017 -0500
freedreno: avoid unneccessary batch flush
In some cases we can end up trying to add a write dependency on ourself,
which shouldn't trigger a flush.
Avoids an extra couple flushes per from in stk.
Signed-off-by: Rob Clark <robdclark at gmail.com>
---
src/gallium/drivers/freedreno/freedreno_batch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c
index eff5e8dc35..9c66dc98bc 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -393,6 +393,8 @@ fd_batch_resource_used(struct fd_batch *batch, struct fd_resource *rsc, bool wri
struct fd_batch *dep;
foreach_batch(dep, cache, rsc->batch_mask) {
struct fd_batch *b = NULL;
+ if (dep == batch)
+ continue;
/* note that batch_add_dep could flush and unref dep, so
* we need to hold a reference to keep it live for the
* fd_bc_invalidate_batch()
More information about the mesa-commit
mailing list