freedreno: Fix FD_MESA_DEBUG=flush debug option

fd_batch_check_size() should be after fd_batch_unlock_submit(),
otherwise batch_flush() called from fd_batch_check_size()
would wait on mutex forever.

Fixes: 02298ed1 "freedreno: Add submit lock"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <!8205>
51 jobs for !8205 with freedreno/fix/fd-mesa-debug-flush in 10 minutes and 19 seconds (queued for 5 seconds)
detached
Status Job ID Name Coverage
  Sanity
passed #6327431
sanity

00:00:08

 
  Container
passed #6327436
aarch64
arm_build

00:00:19

passed #6327439
arm_test-base

00:00:13

passed #6327440
windows shell 1809 mesa
windows_build_vs2019

00:00:09

passed #6327433
x86_build-base

00:00:13

passed #6327434
x86_test-base

00:00:13

 
  Container 2
passed #6327456
android_build

00:00:16

passed #6327462
arm64_test

00:00:11

passed #6327463
armhf_test

00:00:16

passed #6327451
i386_build

00:00:12

passed #6327443
kernel+rootfs_amd64

00:00:16

passed #6327445
aarch64
kernel+rootfs_arm64

00:01:16

passed #6327447
aarch64
kernel+rootfs_armhf

00:00:18

passed #6327452
ppc64el_build

00:00:15

passed #6327454
s390x_build

00:00:17

passed #6327449
x86_build

00:00:16

passed #6327458
x86_test-gl

00:00:16

passed #6327460
x86_test-vk

00:00:16

 
  Meson X86 64
passed #6327474
meson-clang

00:02:14

passed #6327475
meson-clover

00:03:16

passed #6327469
meson-clover-testing

00:01:37

passed #6327470
meson-gallium

00:03:25

passed #6327472
meson-release

00:00:32

passed #6327465
meson-testing

00:02:18

passed #6327467
meson-testing-asan

00:02:25

passed #6327477
meson-vulkan

00:01:50

 
  Build Misc
passed #6327478
meson-android

00:01:41

passed #6327482
aarch64
meson-arm64

00:01:17

passed #6327484
aarch64
meson-arm64-build-test

00:01:29

passed #6327480
aarch64
meson-armhf

00:01:13

passed #6327488
meson-i386

00:02:44

passed #6327493
meson-mingw32-x86_64

00:02:33

passed #6327491
kvm
meson-ppc64el

00:01:54

passed #6327489
kvm
meson-s390x

00:02:54

passed #6327486
scons-win64

00:03:39

 
  Freedreno
passed #6327513
google-freedreno-db410c
arm64_a306_gles2

00:08:03

passed #6327515
google-freedreno-db410c
arm64_a306_gles3

00:07:42

passed #6327517
google-freedreno-db410c
arm64_a306_gles3_options

00:05:29

passed #6327519
google-freedreno-db820c
arm64_a530_gles2 1/2

00:08:17

passed #6327522
google-freedreno-db820c
arm64_a530_gles2 2/2

00:08:10

passed #6327524
google-freedreno-db820c
arm64_a530_gles3

00:04:51

passed #6327527
google-freedreno-db820c
arm64_a530_gles31

00:07:24

passed #6327503
google-freedreno-cheza
arm64_a630_gl

00:00:53

passed #6327497
google-freedreno-cheza
arm64_a630_gles2

00:01:36

passed #6327501
google-freedreno-cheza
arm64_a630_gles3

00:05:16

passed #6327499
google-freedreno-cheza
arm64_a630_gles31

00:04:04

passed #6327505
google-freedreno-cheza
arm64_a630_gles_others

00:02:52

passed #6327495
google-freedreno-cheza
arm64-a630-traces

00:06:03

passed #6327507
google-freedreno-cheza
arm64_a630_vk 1/2

00:06:03

passed #6327509
google-freedreno-cheza
arm64_a630_vk 2/2

00:07:31

passed #6327511
google-freedreno-cheza
arm64_a630_vk_sysmem

00:02:23