mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 13:23:08 +00:00
2a8339f85d
When sandboxing is disabled, rutabaga.external_blob is unset and blob resources with RUTABAGA_MEM_HANDLE_TYPE_OPAQUE_FD can be mapped via rutabaga.map() as VmMemorySource::ExternalMapping. This is already implicitly allowed for the Virglrenderer component, which doesn't recognize the OPAQUE_FD handle type upon export_blob() and automatically falls back on the ExternalMapping path. Mesa CI currently relies on this for testing Venus in Crosvm with the host lavapipe driver. When sandboxing is enabled, rutabaga.external_blob is set and opaque fds MUST be mapped from the hypervisor process via Vulkano as `VmMemorySource::Vulkan` instead. This CL makes non-sandboxed OPAQUE_FD mapping explicit, documents the two mapping paths, and prepares for virglrenderer to support sandboxed OPAQUE_FD mapping. For the non-sandboxed configuration, Crosvm exports a RutabagaHandle with handle of type RUTABAGA_MEM_HANDLE_TYPE_OPAQUE_FD upon blob creation with virglrenderer. When mapped, the RutabagaHandle is dropped, closing the cloned opaque_fd, and virgl_renderer_resource_map() completes the mapping internally by looking up the resource_id and dispatching to the context type from which it was created. BUG=b:244591751 TEST=`deqp-vk -n dEQP-VK.memory.mapping.*` using venus with lavapipe host driver TEST=CQ Change-Id: I2ff32cf8868d6c9c1eb16480456cde98d376cc65 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3900320 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Ryan Neph <ryanneph@google.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> |
||
---|---|---|
.. | ||
ffi | ||
src | ||
build.rs | ||
Cargo.toml |