diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2019-04-23 10:27:49 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-01 07:53:33 +0000 |
commit | 5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f (patch) | |
tree | 1c856e04303e3c2882a140d2be45015bdb621b2e /gpu_renderer/src/lib.rs | |
parent | 144c279d281cb2e69caeb8504ff7267d268c4561 (diff) | |
download | crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar.gz crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar.bz2 crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar.lz crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar.xz crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.tar.zst crosvm-5b636babc1e83b7187ef72bd85b3a3bdc2e5d03f.zip |
virtio-gpu: handle VIRTIO_GPU_CMD_ALLOCATION_METADATA
Designed to return metadata to the guest. BUG=chromium:924405 TEST=compile Change-Id: Ic04a0bbb6b0a5bb6d08314371181f256eb7230df Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1591464 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Diffstat (limited to 'gpu_renderer/src/lib.rs')
-rw-r--r-- | gpu_renderer/src/lib.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gpu_renderer/src/lib.rs b/gpu_renderer/src/lib.rs index c8f6f84..42df26a 100644 --- a/gpu_renderer/src/lib.rs +++ b/gpu_renderer/src/lib.rs @@ -392,6 +392,24 @@ impl Renderer { pub fn force_ctx_0(&self) { unsafe { virgl_renderer_force_ctx_0() }; } + + #[allow(unused_variables)] + pub fn allocation_metadata(&self, request: &[u8], response: &mut Vec<u8>) -> Result<()> { + #[cfg(feature = "virtio-gpu-next")] + { + let ret = unsafe { + virgl_renderer_allocation_metadata( + request.as_ptr() as *const c_void, + response.as_mut_ptr() as *mut c_void, + request.len() as u32, + response.len() as u32, + ) + }; + ret_to_res(ret) + } + #[cfg(not(feature = "virtio-gpu-next"))] + Err(Error::Unsupported) + } } /// A context in which resources can be attached/detached and commands can be submitted. |