From: Rob Clark Date: Sun, 19 Nov 2017 21:45:04 +0000 (-0500) Subject: freedreno: avoid unneccessary batch flush X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91730fb0ffc77682cfd5cebbefdad2f8f92f2431;p=mesa.git 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 --- diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c index eff5e8dc359..9c66dc98bc7 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()