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: <!11196>
56 jobs for !11196 with fd/traces-hang in 16 minutes and 59 seconds (queued for 6 seconds)
latest detached
Status Job ID Name Coverage
  Sanity
passed #10495713
sanity

00:00:08

 
  Container
passed #10495719
aarch64
arm_build

00:00:17

passed #10495721
windows shell 1809 mesa
windows_build_vs2019

00:00:10

passed #10495715
x86_build-base

00:00:12

passed #10495717
x86_test-base

00:00:13

 
  Container 2
passed #10495731
android_build

00:00:14

passed #10495725
i386_build

00:00:14

passed #10495736
kernel+rootfs_amd64

00:01:18

passed #10495737
aarch64
kernel+rootfs_arm64

00:00:13

passed #10495739
aarch64
kernel+rootfs_armhf

00:00:12

passed #10495727
ppc64el_build

00:00:18

passed #10495729
s390x_build

00:00:12

passed #10495724
x86_build

00:00:14

passed #10495732
x86_test-gl

00:00:13

passed #10495734
x86_test-vk

00:00:13

 
  Meson X86 64
passed #10495750
meson-clang

00:08:16

passed #10495752
meson-clover

00:01:43

passed #10495745
meson-clover-testing

00:01:58

passed #10495747
meson-gallium

00:04:53

passed #10495749
meson-release

00:02:55

passed #10495742
meson-testing

00:03:45

passed #10495743
meson-testing-asan

00:02:10

passed #10495754
meson-vulkan

00:02:31

 
  Build Misc
passed #10495755
arm_test

00:00:23

passed #10495757
meson-android

00:01:02

passed #10495761
aarch64
meson-arm64

00:02:31

passed #10495763
aarch64
meson-arm64-asan

00:03:43

passed #10495765
aarch64
meson-arm64-build-test

00:01:21

passed #10495759
aarch64
meson-armhf

00:01:32

passed #10495767
meson-i386

00:03:06

passed #10495769
meson-mingw32-x86_64

00:02:01

 
  Freedreno
passed #10495771
google-freedreno-db410c
a306_gles2

00:05:30

passed #10495773
google-freedreno-db410c
a306_gles3 1/3

00:09:52

passed #10495775
google-freedreno-db410c
a306_gles3 2/3

00:09:31

passed #10495777
google-freedreno-db410c
a306_gles3 3/3

00:09:29

passed #10495779
google-freedreno-db410c
a306_gles3_options

00:04:31

passed #10495781
google-freedreno-db410c
a306-traces

00:03:39

passed #10495783
google-freedreno-db820c
a530_gles2

00:06:46

passed #10495789
google-freedreno-db820c
a530_gles31 1/2

00:07:39

passed #10495785
google-freedreno-db820c
a530_gles3 1/2

00:08:58

passed #10495791
google-freedreno-db820c
a530_gles31 2/2

00:06:38

passed #10495787
google-freedreno-db820c
a530_gles3 2/2

00:08:10

passed #10495793
google-freedreno-db820c
a530_piglit_shader 1/2

00:09:36

passed #10495795
google-freedreno-db820c
a530_piglit_shader 2/2

00:09:34

passed #10495797
google-freedreno-db820c
a530-traces

00:07:15

passed #10495807
google-freedreno-cheza
a630_egl

00:03:44

passed #10495805
google-freedreno-cheza
a630_gl

00:01:31

passed #10495799
google-freedreno-cheza
a630_gles2

00:01:53

passed #10495803
google-freedreno-cheza
a630_gles3

00:05:39

passed #10495801
google-freedreno-cheza
a630_gles31

00:04:12

passed #10495809
google-freedreno-cheza
a630_gles_others

00:02:46

passed #10495817
google-freedreno-cheza
a630_piglit

00:09:39

passed #10495819
google-freedreno-cheza
a630-traces

00:04:17

passed #10495811
google-freedreno-cheza
a630_vk 1/2

00:10:38

passed #10495813
google-freedreno-cheza
a630_vk 2/2

00:10:45

passed #10495815
google-freedreno-cheza
a630_vk_sysmem

00:02:11