virgl: add virgl_resource_transfer_prepare
authorChia-I Wu <olvaffe@gmail.com>
Thu, 9 May 2019 20:27:34 +0000 (13:27 -0700)
committerChia-I Wu <olvaffe@gmail.com>
Wed, 15 May 2019 20:51:28 +0000 (20:51 +0000)
commite87186fc679c146c5d521139bb79c8eafa0a22f0
tree65f7d2d6e3ab2ad19f02a633faf5e56c797521bb
parentcdcf38b98a7bfdfda5836d6a4cebb6cca074e5ff
virgl: add virgl_resource_transfer_prepare

virgl_resource_transfer_prepare should be called before mapping to
prepare the resource.  It does flush, readback, and wait as needed.
virgl_res_needs_flush and virgl_res_needs_readback become internal
helpers to the new function.

There should be no externally visible change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
src/gallium/drivers/virgl/virgl_buffer.c
src/gallium/drivers/virgl/virgl_resource.c
src/gallium/drivers/virgl/virgl_resource.h
src/gallium/drivers/virgl/virgl_texture.c