virgl: Pass resource size and transfer offsets

Graphics / Mesa 3D Graphics Library / Mesa - Tomeu Vizoso [collabora.com] - 6 October 2018 11:12 EDT

Pass the size of a resource when creating it so a backing can be kept in the other side.

Also pass the required offset to transfer commands.

This moves vtest closer to how virtio-gpu works, making it more useful for testing.

v2: - Use new messages for creation and transfers, as changing the behavior of the existing messages would be messy given that we don't want to break compatibility with older servers.

v3: - Use correct strides: The resource corresponding to the output display might have a differnt line stride then the IOVs, so when reading back to this resource take the resource stride and the the IOV stride into account.

v4: Fix transfer size calculation (Andrey Simiklit)

v5: Add comment about transfer size value in the PUT commend (Gurchetan). Add a comment about the size correction for transfers for reading and writing the resource. Fixing this by correctly evaluating the size upfront will need some work also on the virglrenderer side.

9d81cd8e7c virgl: Pass resource size and transfer offsets
.../winsys/virgl/vtest/virgl_vtest_socket.c | 144 +++++++++++++++++++--
.../winsys/virgl/vtest/virgl_vtest_winsys.c | 44 +++++--
.../winsys/virgl/vtest/virgl_vtest_winsys.h | 19 ++-
src/gallium/winsys/virgl/vtest/vtest_protocol.h | 29 +++++
4 files changed, 208 insertions(+), 28 deletions(-)

Upstream: cgit.freedesktop.org


  • Share