freedreno/batch: fix dependency loop detection
authorRob Clark <robdclark@chromium.org>
Wed, 31 Jul 2019 19:30:24 +0000 (12:30 -0700)
committerRob Clark <robdclark@chromium.org>
Fri, 2 Aug 2019 17:24:14 +0000 (10:24 -0700)
commit9d5beab4414f483ad94372d36c2c6f23f6c1ca41
tree6ed8e75a42a964f530f33355e9f2fe86cd881fbf
parente1790c532a431ad3f8abe36175613f4b5f48fa3f
freedreno/batch: fix dependency loop detection

We can have a scenario like:

  A -> B
  A -> C -> B

When adding the A->C dependency, it doesn't really matter that C depends
on something that A depends on, that isn't a necessary condition for a
dependency loop.

Instead what we want to know is that nothing C depends on, directly or
indirectly, depends on A.  We can detect this by recursively OR'ing the
dependents_mask of C and all it's dependencies.

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/freedreno_batch.c