freedreno: Don't return a flushed batch
authorRob Clark <robdclark@chromium.org>
Fri, 4 Jun 2021 23:32:30 +0000 (16:32 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 5 Jun 2021 18:51:41 +0000 (18:51 +0000)
commit80b1e042e4894b60cdc05d2357a99095168be5fb
tree547e33c522c83fbeceac729774112a0e5055fcca
parentad375d0579774934251e5e1a7fb15e7be958c082
freedreno: Don't return a flushed batch

Somehow fairly recently the traces CI job started hitting timeouts, not
all the time but enough to be inconvenient for CI.  I tracked it down to
getting into a situation where `ctx->batch->flush == true`, which causes
an infinite loop in the draw_vbo and clear paths (because
fd_batch_lock_submit() checks for flushed batch but fd_context_batch()
does not).  I'm not entirely sure how we get into that state, or what
triggered this (seems possibly triggered by !10937).  But it is easy
enough to recover.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11196>
src/gallium/drivers/freedreno/freedreno_batch_cache.c