virgl: Introduce virgl_staging_mgr
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Mon, 24 Jun 2019 13:30:07 +0000 (16:30 +0300)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 28 Jun 2019 04:30:02 +0000 (04:30 +0000)
commit55a58dfcfbf3bf39c61ffd31401e513648262275
treeb64e5f8b47640c61f4689e2222af35817bdedaf0
parent6a03f255229b6e96d2bda0ce09bf6b260c9aa43a
virgl: Introduce virgl_staging_mgr

Add a manager for the staging buffer used in virgl. The staging manager
is heavily inspired by u_upload_mgr, but is simpler and is a better fit
for virgl's purposes. In particular, the staging manager:

* Allows concurrent staging allocations.
* Calls the virgl winsys directly to create and map resources, avoiding
  unnecessarily going through gallium resources and transfers.

olv: make virgl_staging_alloc_buffer return a bool

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/virgl/Makefile.sources
src/gallium/drivers/virgl/meson.build
src/gallium/drivers/virgl/virgl_staging_mgr.c [new file with mode: 0644]
src/gallium/drivers/virgl/virgl_staging_mgr.h [new file with mode: 0644]