panfrost: Fix formats converting uninit from AFBC

If no slices were valid (the resource is uninitialized), we were reading
a bogus PIPE_FORMAT_NONE format from the blit.dst.format. Fix this --
and guard against scope similar issues -- by hoisting the blit
assignments out of the loop so they're valid.

Fixes: 9d0ad7fd ("panfrost: Patch the gallium driver to use pan_image_layout_init()")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <!10415>
44 jobs for !10415 with afbc-fix in 15 minutes and 37 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Sanity
passed #9163425
sanity

00:00:37

 
  Container
passed #9163430
aarch64
arm_build

00:00:18

passed #9163432
windows shell 1809 mesa
windows_build_vs2019

00:00:14

passed #9163427
x86_build-base

00:01:00

passed #9163429
x86_test-base

00:00:16

 
  Container 2
passed #9163442
android_build

00:00:25

passed #9163437
i386_build

00:00:22

passed #9163447
kernel+rootfs_amd64

00:00:18

passed #9163449
aarch64
kernel+rootfs_arm64

00:00:12

passed #9163451
aarch64
kernel+rootfs_armhf

00:00:12

passed #9163439
ppc64el_build

00:00:22

passed #9163440
s390x_build

00:00:22

passed #9163435
x86_build

00:00:21

passed #9163444
x86_test-gl

00:00:19

passed #9163446
x86_test-vk

00:00:18

 
  Meson X86 64
passed #9163462
meson-clang

00:08:02

passed #9163464
meson-clover

00:02:40

passed #9163457
meson-clover-testing

00:02:08

passed #9163459
meson-gallium

00:05:55

passed #9163461
meson-release

00:03:20

passed #9163454
meson-testing

00:02:55

passed #9163456
meson-testing-asan

00:02:47

passed #9163466
meson-vulkan

00:01:47

 
  Build Misc
passed #9163467
arm_test

00:00:38

passed #9163469
meson-android

00:01:10

passed #9163473
aarch64
meson-arm64

00:01:21

passed #9163475
aarch64
meson-arm64-asan

00:03:35

passed #9163477
aarch64
meson-arm64-build-test

00:01:24

passed #9163471
aarch64
meson-armhf

00:02:34

passed #9163479
meson-i386

00:01:47

passed #9163484
meson-mingw32-x86_64

00:01:15

passed #9163482
meson-ppc64el

00:02:08

passed #9163480
kvm
meson-s390x

00:03:25

 
  Arm
passed #9163502
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles2:arm64

00:04:57

passed #9163506
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles31:arm64

00:10:01

passed #9163504
mesa-ci-aarch64-lava-collabora
panfrost-g52-gles3:arm64

00:07:43

passed #9163486
mesa-ci-aarch64-lava-collabora
panfrost-t720-gles2:arm64

00:11:13

passed #9163488
mesa-ci-aarch64-lava-collabora
panfrost-t760-gles2:armhf

00:05:05

passed #9163490
mesa-ci-aarch64-lava-collabora
panfrost-t760-traces:armhf

00:07:24

passed #9163492
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles2:arm64

00:04:59

passed #9163498
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles31:arm64

00:05:47

passed #9163494
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 1/2

00:07:17

passed #9163496
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 2/2

00:07:45

passed #9163500
mesa-ci-aarch64-lava-collabora
panfrost-t860-traces:arm64

00:13:13