virgl/drm: New optimization for uploading textures
- We can create resource with size of "1" on drm, because size is not passed to the renderer.
- We can't create resource with size of "1" on vtest, because shmem is created based on that.
- If renderer supports copy_transfer_from_host, then use staging buffer for transfer in both ways to and from host.
This will allow to reduce memory consumption in the guest.
- add inline function for checking if we can use this optimization
- add check in readback path. If renderer doesn't support copy transfer from host, then we need to go with previous path in readback (through transfer_get ioctl)
- fix logic for readback
- refactor the implementation to integrate it more to existing code base
- reuse COPY_TRANSFER3D in both directions
- encode direction in COPY_TRANSFER3D if host supports it
Reviewed-by: Gert Wollny firstname.lastname@example.org
virglrenderer MR: 645