From 144c279d281cb2e69caeb8504ff7267d268c4561 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Mon, 9 Sep 2019 14:40:11 -0700 Subject: crosvm: add 'virtio-gpu-next' feature flag With this, crosvm builds that don't have the CrOS version of virglrenderer can build against master without adjustments. BUG=chromium:924405 TEST=compile Change-Id: Iee27c003bee1eb8947cb048dc16e2da6c68af11e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1797067 Tested-by: kokoro Tested-by: Gurchetan Singh Commit-Queue: Gurchetan Singh Reviewed-by: Zach Reizner --- Cargo.lock | 1 + Cargo.toml | 2 ++ gpu_renderer/Cargo.toml | 3 +++ gpu_renderer/src/lib.rs | 3 +++ 4 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 968416a..8017a34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,6 +88,7 @@ dependencies = [ "disk 0.1.0", "enumn 0.1.0", "gpu_buffer 0.1.0", + "gpu_renderer 0.1.0", "io_jail 0.1.0", "kernel_cmdline 0.1.0", "kernel_loader 0.1.0", diff --git a/Cargo.toml b/Cargo.toml index ec0d12b..13a3047 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ sandboxed-libusb = ["devices/sandboxed-libusb", "vm_control/sandboxed-libusb"] tpm = ["devices/tpm"] wl-dmabuf = ["devices/wl-dmabuf", "gpu_buffer", "resources/wl-dmabuf"] x = ["devices/x"] +virtio-gpu-next = ["gpu_renderer/virtio-gpu-next"] [dependencies] arch = { path = "arch" } @@ -48,6 +49,7 @@ devices = { path = "devices" } disk = { path = "disk" } enumn = { path = "enumn" } gpu_buffer = { path = "gpu_buffer", optional = true } +gpu_renderer = { path = "gpu_renderer", optional = true } io_jail = { path = "io_jail" } kernel_cmdline = { path = "kernel_cmdline" } kernel_loader = { path = "kernel_loader" } diff --git a/gpu_renderer/Cargo.toml b/gpu_renderer/Cargo.toml index 6fcd22e..c15e6df 100644 --- a/gpu_renderer/Cargo.toml +++ b/gpu_renderer/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" authors = ["The Chromium OS Authors"] edition = "2018" +[features] +virtio-gpu-next = [] + [dependencies] data_model = { path = "../data_model" } libc = "*" diff --git a/gpu_renderer/src/lib.rs b/gpu_renderer/src/lib.rs index eae9f8a..c8f6f84 100644 --- a/gpu_renderer/src/lib.rs +++ b/gpu_renderer/src/lib.rs @@ -48,6 +48,8 @@ pub enum Error { InvalidIovec, /// A command size was submitted that was invalid. InvalidCommandSize(usize), + /// The command is unsupported. + Unsupported, } impl Display for Error { @@ -60,6 +62,7 @@ impl Display for Error { ExportedResourceDmabuf => write!(f, "failed to export dmabuf"), InvalidIovec => write!(f, "an iovec is outside of guest memory's range"), InvalidCommandSize(s) => write!(f, "command buffer submitted with invalid size: {}", s), + Unsupported => write!(f, "gpu renderer function unsupported"), } } } -- cgit 1.4.1