zink: fix destroy batch

Extract batch destruction in its own function, then make sure to
release fence, framebuffer cache and surface cache.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
35 jobs for !6188 with zink-surface-cache in 52 seconds (queued for 5 seconds)
latest detached
Status Job ID Name Coverage
  Container
manual #5600451
aarch64 manual
arm_build
manual #5600453
manual
arm_test-base
passed #5600456
git_archive

00:00:35

manual #5600445
manual
x86_build-base
manual #5600449
manual
x86_build_old
manual #5600448
manual
x86_test-base
 
  Container 2
created #5600482
android_build
created #5600491
arm64_test
created #5600473
i386_build
created #5600460
kernel+rootfs_amd64
created #5600463
aarch64
kernel+rootfs_arm64
created #5600466
aarch64
kernel+rootfs_armhf
created #5600476
ppc64el_build
created #5600479
s390x_build
created #5600469
x86_build
created #5600485
x86_test-gl
created #5600488
x86_test-vk
 
  Sanity
passed #5600494
check mr

00:00:17

 
  Meson X86 64
created #5600512
meson-clang
created #5600509
meson-classic
created #5600513
meson-clover
created #5600500
meson-clover-testing
created #5600503
meson-gallium
created #5600506
meson-release
created #5600497
meson-testing
created #5600516
meson-vulkan
 
  Scons
created #5600519
allowed to fail
scons-win64
 
  Meson Misc
created #5600521
meson-android
created #5600527
aarch64
meson-arm64
created #5600530
aarch64
meson-arm64-build-test
created #5600523
aarch64
meson-armhf
created #5600532
meson-i386
created #5600543
meson-mingw32-x86_64
created #5600539
kvm
meson-ppc64el
created #5600535
kvm
meson-s390x