vrend: Fence before transfering from host if necessary

Fix cases where trying to transfer from host directly after submitting
command buffer (eg when trying to run
dEQP-GLES2.functional.read_pixels.* or crosvm gpu_renderer::simple_clear
tests) would fail non-deterministically due to the mapping occuring
prior to the rendering completing by forcing a fence.

In particular Mali platforms are highly susceptible to synchronization
issues and also require setting the context prior to fencing.

Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
David Riley 5 years ago committed by Gurchetan Singh
parent 752fb7c149
commit c529faf1ba
  1. 10
      src/vrend_renderer.c

@ -7597,6 +7597,16 @@ int vrend_renderer_transfer_iov(const struct vrend_transfer_info *info,
return EINVAL; return EINVAL;
} }
#ifdef HAVE_EPOXY_EGL_H
// Some platforms require extra synchronization before transferring.
if (transfer_mode == VIRGL_TRANSFER_FROM_HOST) {
if (virgl_egl_need_fence_and_wait_external(egl)) {
vrend_hw_switch_context(ctx, true);
virgl_egl_fence_and_wait_external(egl);
}
}
#endif
iov = info->iovec; iov = info->iovec;
num_iovs = info->iovec_cnt; num_iovs = info->iovec_cnt;

Loading…
Cancel
Save