Draft: [wip] [wip]: gfxstream in Mesa
This adds the gfxstream vk virtualization solution to Mesa.
It should build just like any another vulkan drivers, via -Dvulkan-drivers=gfxstream-experimental
. The gfxstream backend code does AEMU base dependency (packaged in Fedora, BTW), and directions of how to acquire it are here:
https://crosvm.dev/book/appendix/rutabaga_gfx.html#build-aemu-base
Socialization:
https://lists.freedesktop.org/archives/mesa-dev/2024-January/226123.html
Status:
Very rough, maybe we'll want a history preserving method
Technical overview:
Graphics Streaming Kit is a code generator that makes it easier to serialize and forward graphics API calls from one place to another.
- 1:1 threading model - each guest Vulkan encoder thread gets host side decoding thread
- Support for both virtio-gpu, goldish and testing transports.
- Support for Android, Fuchsia, and Linux guests.
- Ring Buffer to stream commands, in the style of io_uring.
- Currently, there are a set of Mesa objects and gfxstream objects. For example,
struct gfxstream_vk_device
and the gfxstream objectgoldfish_device
both are internal representations of Vulkan opaque handleVkDevice
. The Mesa object is used first, since Mesa provides dispatch. The Mesa object contains a key to the hash table to get a gfxstream internal object (for example,gfxstream_vk_device::internal_object
). Eventually, gfxstream objects will be phased out and Mesa objects used exclusively. - Codegen is done in the codgen directory. It adds another generator to Vulkan-Docs generator, and our goal has been to upstream it eventually.