virgl: when reading back wait first, then do the transfer
authorGert Wollny <gert.wollny@collabora.com>
Thu, 25 Aug 2022 06:30:53 +0000 (08:30 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 31 Aug 2022 08:01:22 +0000 (08:01 +0000)
commit6e2b01e5b806b3b0ec9df896f4ddc842a54f4fa6
tree8cf62637d5efbba1dea5c064b4d699448a56c9a5
parent16143642812676d6eb36a88a059f355e06b4caf1
virgl: when reading back wait first, then do the transfer

Otherwise the transfer from the host might not be finished
when we try to read the data.

v2: always wait before readback, but also keep the wait after
  a possible readback, Itherwise TF fails in the CI.

Fixes: e87186fc679c146c5d521139bb79c8eafa0a22f0
    virgl: add virgl_resource_transfer_prepare

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18243>
src/gallium/drivers/virgl/ci/virpipe-gl-fails.txt
src/gallium/drivers/virgl/virgl_resource.c