This is dedicated heap memory allocations approach. This type of blob should be used in the following way: 1) Guest virtio-gpu driver on start checks for dedicated memory region. 2) On create_blob drm ioctl guest driver reserves chunk of required memory and send it to host using sg list. Heap is managed on guest. 3) Device creates dmabuf fd from this sg entry and sends it to virglrenderer on create_blob virtio-gpu command. Blob is created using virgl_renderer_resource_import_blob call. 4) On next vkAllocateMemory call from mesa, virglrenderer will allocate vk memory handle from this dmabuf fd. It will receive resource id in VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA vkAllocateMemory structure. The flow is opposite to the way it's done for HOST_3D types of blob, where vkAllocateMemory is called first, vk memory is allocated from random host place. Then create_blob is called, where dmabuf fd is exported from VkDeviceMemory. Signed-off-by: Andrii Pauk <Andrii.Pauk@opensynergy.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>macos/master
parent
da9effc518
commit
488c82568d
Loading…
Reference in new issue