CHROMIUM: Workaround arc++ sw_sync deadlock

Temporarily CP'd to arcvm to workaround an in_fence_fd handling bug in guest virtgpu
kernel driver. This will be reverted once a kernel patch lands upstream
and can be CP'd to ChromeOS.

BUG=b:265458612
TEST=Open "Among Us" 10x without black screen hangs at the menu.

Original commit message:

Somehow if we pass the in-fence from surfaceflinger (a sw_sync) fence
down to the GPU driver and pass back a new GPU out-fence before the
in-fence is signaled we end up in a deadlock situation:

  * drm gpu_scheduler kthread is waiting on sw_sync in-fence to
    fire before queuing job on GPU
  * kms atomic helper is waiting on GPU out-fence to fire
  * the sw_sync in-fence never fires

This was exposed recently by 1e25f3b2825 ("android: Push in-fence-fd down to driver")
which replaced the synchronous sync_wait() with plumbing the in-fence
down to the driver.  Turns out the exact same thing also happens with
vulkan.

BUG=b:225664897
TEST=run aztec ruins vk onscreen (with USE=vulkan build), run dEQP-EGL

Change-Id: I1e86fd58a9709864f595fd629f0ca01ae7333fcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/3546277
Tested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Tested-by: Chia-I Wu <olv@google.com>
Reviewed-by: Kristian Kristensen <hoegsberg@chromium.org>
Commit-Queue: Kristian Kristensen <hoegsberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/4166428
Reviewed-by: Rob Clark <robdclark@chromium.org>
Tested-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
2 files changed