vulkan/wsi: Use sync files to directly signal dma-bufs

This adds a new mechanism to Vulkan WSI for transforming Vulkan's
explicit sync model into the implicit sync model required by X11 and
Wayland today.  It does this using a new set of ioctls on dma-buf which
allow you to export a sync_file from the fence on the dma-buf and allow
you to signal the dma-buf using the fence in a sync_file.  In order to
do this, it makes two assumptions about drivers:

 1. Drivers implement sync_file import/export for fences and semaphores.

 2. Sync files can be exported from or imported into semaphores and
    fences regardless of whether they were created with SYNC_FILE among
    the supported handle types.

The primary advantage of the new approach is that it does even less
over-synchronization than the previous approaches.  Every approach we've
used in the past requires that vkQueuePresent do a vkQueueSubmit so that
it can signal the dma-buf implicitly as of the kernel exec call.  In
778b51f4, we improved the situation a bit by only signaling the
dma-buf in the vkQueueSubmit in vkQueuePresent rather than signaling on
every vkQueueSubmit which touchs it (all of them if descriptor_indexing
is enabled).  With this new approach, we can do the minimal amount of
synchronization so if the client does extra vkQueueSubmits between the
final draw to the WSI image and the vkQueuePresent, we don't force the
presentation engine to wait any longer than it has to.

A secondary advantage is that we can now completely separate command
submission from synchronization.  Assuming the driver uses syncobj or
similar for implementing VkSemaphore, we no longer need to do any
synchronization with dma-buf via exec calls to the kernel.  Of course,
the kernel may still need to do some synchronization internally for the
purposes of paging and the like.
43 jobs for !4037 with wip/anv-dma-buf-sync-file in 27 minutes and 23 seconds (queued for 5 seconds)
detached
Status Job ID Name Coverage
  Container
passed #1804606
aarch64
arm_build

00:00:19

passed #1804607
aarch64
arm_test

00:00:20

passed #1804603
x86_build

00:00:15

passed #1804605
x86_build_old

00:00:14

passed #1804604
x86_test-gl

00:00:15

 
  Build
passed #1804611
aarch64
meson-arm64

00:08:27

passed #1804612
aarch64
meson-arm64-build-test

00:08:14

passed #1804610
aarch64
meson-armhf

00:10:16

passed #1804613
meson-clang

00:06:20

passed #1804616
meson-clover

00:06:41

passed #1804617
meson-clover-old-llvm

00:05:47

passed #1804619
meson-i386

00:03:35

passed #1804609
meson-main

00:07:19

passed #1804622
meson-mingw32-x86_64

00:04:25

passed #1804621
gstreamer
meson-ppc64el

00:05:23

passed #1804620
gstreamer
meson-s390x

00:04:46

passed #1804608
meson-testing

00:05:56

passed #1804618
meson-vulkan

00:04:02

passed #1804623
scons

00:05:08

passed #1804624
scons-old-llvm

00:04:35

passed #1804614
scons-swr

00:06:00

passed #1804615
scons-win64

00:06:36

 
  Test
passed #1804644
db410c
arm64_a306_gles2

00:05:33

passed #1804641
mesa-cheza
arm64_a630_gles2

00:01:37

passed #1804643
mesa-cheza
arm64_a630_gles3

00:06:02

passed #1804642
mesa-cheza
arm64_a630_gles31

00:04:07

passed #1804629
lava-meson-gxl-s905x-libretech-cc
lima-mali450-test:arm64

00:05:37

passed #1804645
llvmpipe-traces

00:00:34

passed #1804625
lava-sun50i-h6-pine-h64
panfrost-t720-gles2:arm64

00:07:22

passed #1804626
lava-rk3288-veyron-jaq
panfrost-t760-gles2:armhf

00:05:05

passed #1804627
lava-rk3399-gru-kevin
panfrost-t860-gles2:arm64

00:06:29

passed #1804628
lava-rk3399-gru-kevin
panfrost-t860-gles3:arm64

00:10:47

passed #1804631
piglit-glslparser

00:03:38

passed #1804630
piglit-quick_gl

00:08:22

passed #1804632
piglit-quick_shader

00:07:30

passed #1804633
test-llvmpipe-gles2

00:04:18

passed #1804634
test-softpipe-gles2

00:01:40

passed #1804637
test-softpipe-gles31 1/4

00:03:01

passed #1804635
test-softpipe-gles3 1/2

00:05:10

passed #1804638
test-softpipe-gles31 2/4

00:04:14

passed #1804639
test-softpipe-gles31 3/4

00:05:08

passed #1804640
test-softpipe-gles31 4/4

00:03:31

passed #1804636
test-softpipe-gles3 2/2

00:04:09