freedreno: handle batch flush in resource tracking
authorRob Clark <robdclark@chromium.org>
Wed, 24 Jun 2020 18:28:32 +0000 (11:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 25 Jun 2020 00:55:24 +0000 (00:55 +0000)
commit7c008c293d7b220eec0c98cefb794cab95ee344e
tree686df7cc1c3ad214c9d4f1c3bc7d80945e83138a
parent16b4da3ba3117e69d9bd7519f57ae5f970fc48f7
freedreno: handle batch flush in resource tracking

In rare cases, we can get into situations where the tracking of read/
written resources triggers a flush of the current batch.

To handle that, (1) take a reference to the current batch, so it doesn't
disappear under us, and (2) check after resource tracking whether the
current batch was flushed.  If it is, we have to re-do the resource
tracking, but since we have a fresh batch, it should not get flushed the
second time around.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3160
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5634>
src/gallium/drivers/freedreno/freedreno_draw.c