virgl: introduce transfer queue
authorGurchetan Singh <gurchetansingh@chromium.org>
Fri, 28 Dec 2018 19:19:03 +0000 (11:19 -0800)
committerGert Wollny <gert.wollny@collabora.com>
Fri, 15 Feb 2019 10:19:05 +0000 (11:19 +0100)
commit4a7857b377d2083f94c28fcdb85abdb8f9d12fde
tree1c3debb993b9312dad74e1945e3b289941217f28
parent9c4930946a53d4f547e3c3ee6dcf672fbf0ac3a5
virgl: introduce transfer queue

Transfers will be placed here at unmap time instead of incurring
a VM exit. There's an attempt to deduplicate intersecting 1D transfers,
which are surprisingly common.

This can also help with mipmapped texture upload and smaller
textures, where the majority of the time is spent in the guest
kernel / QEMU -- not virglrenderer.  This is shown by the GLbench
texture upload benchmark:

Before:
    texture_upload_rgba_teximage2d_32 = 64.23 mtexel_sec
After:
    texture_upload_rgba_teximage2d_32 = 367.44 mtexel_sec

v2: Split up list iteration functions (@gerddie)
v3: Support for optimizing glBufferSubData
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
src/gallium/drivers/virgl/Makefile.sources
src/gallium/drivers/virgl/meson.build
src/gallium/drivers/virgl/virgl_resource.h
src/gallium/drivers/virgl/virgl_transfer_queue.c [new file with mode: 0644]
src/gallium/drivers/virgl/virgl_transfer_queue.h [new file with mode: 0644]