From e13b180f74ad6d0b1cb1db2a198e294da97e526c Mon Sep 17 00:00:00 2001 From: Jingkui Wang Date: Wed, 3 Oct 2018 13:04:47 -0700 Subject: crosvm: use msg_socket in vm_control Refactor existing code to use msg_socket. BUG=None TEST=local build and run Change-Id: Iee72326b330e035303f679e1aedd6e5d18ad4f8a Reviewed-on: https://chromium-review.googlesource.com/1260260 Commit-Ready: Jingkui Wang Tested-by: Jingkui Wang Reviewed-by: Zach Reizner --- resources/Cargo.toml | 1 + resources/src/gpu_allocator.rs | 5 +++-- resources/src/lib.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'resources') diff --git a/resources/Cargo.toml b/resources/Cargo.toml index 29fc38a..c563d20 100644 --- a/resources/Cargo.toml +++ b/resources/Cargo.toml @@ -11,3 +11,4 @@ data_model = { path = "../data_model" } gpu_buffer = { path = "../gpu_buffer", optional = true } libc = "*" sys_util = { path = "../sys_util" } +msg_socket = { path = "../msg_socket" } diff --git a/resources/src/gpu_allocator.rs b/resources/src/gpu_allocator.rs index 9f98bcf..16dc944 100644 --- a/resources/src/gpu_allocator.rs +++ b/resources/src/gpu_allocator.rs @@ -9,6 +9,7 @@ use libc::EINVAL; #[cfg(feature = "wl-dmabuf")] use gpu_buffer; +use msg_socket::MsgOnSocket; use sys_util; #[derive(Debug)] @@ -18,14 +19,14 @@ pub enum GpuAllocatorError { } /// Struct that describes the offset and stride of a plane located in GPU memory. -#[derive(Clone, Copy, Debug, PartialEq, Default)] +#[derive(Clone, Copy, Debug, PartialEq, Default, MsgOnSocket)] pub struct GpuMemoryPlaneDesc { pub stride: u32, pub offset: u32, } /// Struct that describes a GPU memory allocation that consists of up to 3 planes. -#[derive(Clone, Copy, Debug, Default)] +#[derive(Clone, Copy, Debug, Default, MsgOnSocket)] pub struct GpuMemoryDesc { pub planes: [GpuMemoryPlaneDesc; 3], } diff --git a/resources/src/lib.rs b/resources/src/lib.rs index 5d12cfc..e19ac7c 100644 --- a/resources/src/lib.rs +++ b/resources/src/lib.rs @@ -8,6 +8,8 @@ extern crate gpu_buffer; extern crate libc; extern crate sys_util; +#[macro_use] +extern crate msg_socket; mod address_allocator; mod gpu_allocator; -- cgit 1.4.1