panfrost: Protect the variants array with a lock

Without a lock, two threads may bind the same shader CSO simultaneously,
allocate the same variant simultaneously, and then race each other in
the compiler. This manifests in various ways, most commonly failing the
assertion that UBO pushing has only run once. The simple_mtx_t solution
is used in Iris. Fixes the crash in:

dEQP-EGL.functional.sharing.gles2.multithread.simple.buffers.bufferdata_render

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
171 jobs for dumb-fixes
latest
Status Name Job ID Coverage
  Container
manual debian/arm_build #12732611
aarch64 manual
manual debian/x86_build-base #12732609
manual
manual debian/x86_test-base #12732610
manual
manual fedora/x86_build #12732612
manual
manual windows_build_vs2019 #12732613
windows shell 1809 mesa manual
 
  Container 2
created debian/android_build #12732618
created debian/i386_build #12732615
created debian/ppc64el_build #12732616
created debian/s390x_build #12732617
created debian/x86_build #12732614
created debian/x86_test-gl #12732619
created debian/x86_test-vk #12732620
created kernel+rootfs_amd64 #12732621
created kernel+rootfs_arm64 #12732622
aarch64
created kernel+rootfs_armhf #12732623
aarch64
 
  Build X86 64
created debian-clang #12732630
created debian-clover #12732631
created debian-clover-testing #12732626
created debian-gallium #12732627
created debian-release #12732628
created debian-testing #12732624
created debian-testing-asan #12732625
created debian-vulkan #12732632
created fedora-release #12732629
 
  Build Misc
created debian-android #12732634
created debian-arm64 #12732636
aarch64
created debian-arm64-asan #12732637
aarch64
created debian-arm64-build-test #12732638
aarch64
created debian-armhf #12732635
aarch64
created debian/arm_test #12732633
created debian-i386 #12732640
created debian-mingw32-x86_64 #12732643
created debian-ppc64el #12732642
created debian-s390x #12732641
kvm
created windows-vs2019 #12732639
windows docker 1809 mesa
 
  Amd
created radeonsi-stoney-gles2:amd64 #12732652
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-gles31:amd64 1/2 #12732655
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-gles31:amd64 2/2 #12732656
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-gles3:amd64 1/2 #12732653
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-gles3:amd64 2/2 #12732654
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-piglit-gl:amd64 #12732658
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radeonsi-stoney-traces:amd64 #12732657
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radv-fossils #12732651
created radv-navy_flounder-traces #12732645
amdgpu:codename:NAVY_FLOUNDER manual
created radv-navy_flounder-vkd3d-proton #12732644
amdgpu:codename:NAVY_FLOUNDER manual
created radv_polaris10_vkcts #12732647
polaris10 manual
created radv-raven-traces #12732646
amdgpu:codename:RAVEN manual
created radv_stoney_vkcts:amd64 1/3 #12732648
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radv_stoney_vkcts:amd64 2/3 #12732649
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
created radv_stoney_vkcts:amd64 3/3 #12732650
mesa-ci-x86-64-lava-hp-11A-G6-EE-grunt
 
  Intel
created i915-g33-deqp #12732659
anholt-g33 manual
created i915-g33-piglit #12732660
anholt-g33 manual
created i915-g33-traces #12732661
anholt-g33 manual
created iris-apl-egl #12732666
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral
created iris-apl-gl #12732665
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral manual
created iris-apl-gles2 #12732662
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral
created iris-apl-gles3 #12732663
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral
created iris-apl-gles31 #12732664
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral
created iris-apl-traces #12732672
mesa-ci-x86-64-lava-asus-C523NA-A20057-coral
created iris-glk-egl #12732671
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-glk-gl #12732670
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-glk-gles2 #12732667
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-glk-gles3 #12732668
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-glk-gles31 #12732669
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-glk-traces #12732673
mesa-ci-x86-64-lava-hp-x360-12b-n4000-octopus manual
created iris-kbl-traces #12732674
mesa-ci-x86-64-lava-hp-x360-14-G1-sona manual
 
  Arm
created panfrost-g52-gles31:arm64 #12732684
mesa-ci-x86-64-lava-meson-g12b-a311d-khadas-vim3
created panfrost-g52-gles3:arm64 1/2 #12732682
mesa-ci-x86-64-lava-meson-g12b-a311d-khadas-vim3
created panfrost-g52-gles3:arm64 2/2 #12732683
mesa-ci-x86-64-lava-meson-g12b-a311d-khadas-vim3
created panfrost-t720-gles2:arm64 #12732675
mesa-ci-x86-64-lava-sun50i-h6-pine-h64
created panfrost-t760-gles2:armhf #12732676
mesa-ci-x86-64-lava-rk3288-veyron-jaq
created panfrost-t760-traces:armhf #12732677
mesa-ci-x86-64-lava-rk3288-veyron-jaq
created panfrost-t860-gles31:arm64 #12732680
mesa-ci-x86-64-lava-rk3399-gru-kevin
created panfrost-t860-gles3:arm64 1/2 #12732678
mesa-ci-x86-64-lava-rk3399-gru-kevin
created panfrost-t860-gles3:arm64 2/2 #12732679
mesa-ci-x86-64-lava-rk3399-gru-kevin
created panfrost-t860-traces:arm64 #12732681
mesa-ci-x86-64-lava-rk3399-gru-kevin
 
  Broadcom
created v3d-rpi4-egl:armhf #12732707
igalia-rpi4
created v3d-rpi4-gles2:armhf #12732703
igalia-rpi4
created v3d-rpi4-gles31:armhf 1/2 #12732697
igalia-rpi4
created v3d-rpi4-gles31:armhf 2/2 #12732698
igalia-rpi4
created v3d-rpi4-gles3:armhf 1/4 #12732699
igalia-rpi4
created v3d-rpi4-gles3:armhf 2/4 #12732700
igalia-rpi4
created v3d-rpi4-gles3:armhf 3/4 #12732701
igalia-rpi4
created v3d-rpi4-gles3:armhf 4/4 #12732702
igalia-rpi4
created v3d-rpi4-khr-gles2:armhf #12732706
igalia-rpi4
created v3d-rpi4-khr-gles31:armhf #12732704
igalia-rpi4
created v3d-rpi4-khr-gles3:armhf #12732705
igalia-rpi4
created v3d-rpi4-piglit:armhf 1/3 #12732708
igalia-rpi4
created v3d-rpi4-piglit:armhf 2/3 #12732709
igalia-rpi4
created v3d-rpi4-piglit:armhf 3/3 #12732710
igalia-rpi4
created v3dv-rpi4-vk:arm64 1/6 #12732711
igalia-rpi4
created v3dv-rpi4-vk:arm64 2/6 #12732712
igalia-rpi4
created v3dv-rpi4-vk:arm64 3/6 #12732713
igalia-rpi4
created v3dv-rpi4-vk:arm64 4/6 #12732714
igalia-rpi4
created v3dv-rpi4-vk:arm64 5/6 #12732715
igalia-rpi4
created v3dv-rpi4-vk:arm64 6/6 #12732716
igalia-rpi4
created vc4-rpi3-egl:armhf #12732690
igalia-rpi3
created vc4-rpi3-gles2:armhf 1/4 #12732685
igalia-rpi3
created vc4-rpi3-gles2:armhf 2/4 #12732686
igalia-rpi3
created vc4-rpi3-gles2:armhf 3/4 #12732687
igalia-rpi3
created vc4-rpi3-gles2:armhf 4/4 #12732688
igalia-rpi3
created vc4-rpi3-khr-gles2:armhf #12732689
igalia-rpi3
created vc4-rpi3-piglit-quick_gl:armhf 1/4 #12732691
igalia-rpi3 manual
created vc4-rpi3-piglit-quick_gl:armhf 2/4 #12732692
igalia-rpi3 manual
created vc4-rpi3-piglit-quick_gl:armhf 3/4 #12732693
igalia-rpi3 manual
created vc4-rpi3-piglit-quick_gl:armhf 4/4 #12732694
igalia-rpi3 manual
created vc4-rpi3-piglit-quick_shader:armhf 1/2 #12732695
igalia-rpi3 manual
created vc4-rpi3-piglit-quick_shader:armhf 2/2 #12732696
igalia-rpi3 manual
 
  Freedreno
created a306_gles2 #12732717
google-freedreno-db410c
created a306_gles3 1/3 #12732718
google-freedreno-db410c
created a306_gles3 2/3 #12732719
google-freedreno-db410c
created a306_gles3 3/3 #12732720
google-freedreno-db410c
created a306_gles3_options #12732721
google-freedreno-db410c
created a306-traces #12732722
google-freedreno-db410c
created a530_gles2 #12732723
google-freedreno-db820c
created a530_gles31 1/2 #12732726
google-freedreno-db820c
created a530_gles3 1/2 #12732724
google-freedreno-db820c
created a530_gles31 2/2 #12732727
google-freedreno-db820c
created a530_gles3 2/2 #12732725
google-freedreno-db820c
created a530_piglit_gl #12732728
google-freedreno-db820c manual
created a530_piglit_shader 1/2 #12732729
google-freedreno-db820c
created a530_piglit_shader 2/2 #12732730
google-freedreno-db820c
created a530-traces #12732731
google-freedreno-db820c
created a630_egl #12732736
google-freedreno-cheza
created a630_gl #12732735
google-freedreno-cheza
created a630_gles2 #12732732
google-freedreno-cheza
created a630_gles3 #12732734
google-freedreno-cheza
created a630_gles31 #12732733
google-freedreno-cheza
created a630_gles_asan #12732738
google-freedreno-cheza manual
created a630_gles_others #12732737
google-freedreno-cheza
created a630_piglit #12732745
google-freedreno-cheza
created a630-traces #12732746
google-freedreno-cheza
created a630_vk 1/2 #12732739
google-freedreno-cheza
created a630_vk 2/2 #12732740
google-freedreno-cheza
created a630_vk_asan #12732743
google-freedreno-cheza manual
created a630_vk_full 1/2 #12732741
google-freedreno-cheza manual
created a630_vk_full 2/2 #12732742
google-freedreno-cheza manual
created a630_vk_sysmem #12732744
google-freedreno-cheza
 
  Software Renderer
created lavapipe-nir-stress #12732760
created lavapipe-vk #12732759
created llvmpipe-deqp 1/2 #12732752
created llvmpipe-deqp 2/2 #12732753
created llvmpipe-egl #12732754
created llvmpipe-piglit-cl #12732747
created llvmpipe-piglit-glslparser #12732749
created llvmpipe-piglit-quick_gl #12732748
created llvmpipe-piglit-quick_shader #12732750
created llvmpipe-traces #12732751
created softpipe-asan-gles31 #12732757
created softpipe-deqp 1/2 #12732755
created softpipe-deqp 2/2 #12732756
created softpipe-piglit-quick #12732758
 
  Layered Backends
created test-d3d12-windows #12732778
windows docker 1809 mesa
created virgl-on-gl 1/6 #12732761
kvm
created virgl-on-gl 2/6 #12732762
kvm
created virgl-on-gl 3/6 #12732763
kvm
created virgl-on-gl 4/6 #12732764
kvm
created virgl-on-gl 5/6 #12732765
kvm
created virgl-on-gl 6/6 #12732766
kvm
created virgl-on-gles 1/6 #12732767
kvm manual
created virgl-on-gles 2/6 #12732768
kvm manual
created virgl-on-gles 3/6 #12732769
kvm manual
created virgl-on-gles 4/6 #12732770
kvm manual
created virgl-on-gles 5/6 #12732771
kvm manual
created virgl-on-gles 6/6 #12732772
kvm manual
created virgl-traces #12732773
kvm
created zink-lvp-deqp 1/2 #12732776
created zink-lvp-deqp 2/2 #12732777
created zink-piglit-no_timelines #12732775
created zink-piglit-timelines #12732774
 
  Deploy
manual test-docs #12732779
manual