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@gmail.com>
This commit is contained in:
Rob Clark 2017-11-19 16:45:04 -05:00
parent 4ab6ab8036
commit 91730fb0ff
1 changed files with 2 additions and 0 deletions

View File

@ -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()