aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2020-12-14 15:20:45 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-17 01:18:00 +0000
commit028b8044bc67ec8eeb4749ec10653273062ede1a (patch)
tree20e80371093782b47ff145466fa3af2b1bccd0e6
parentfb54f3ccd933fb3eb0265f7843b97cc9a0ea08c2 (diff)
downloadplatform_external_crosvm-upstream-master.tar.gz
platform_external_crosvm-upstream-master.tar.bz2
platform_external_crosvm-upstream-master.zip
crosvm: clearer naming about GPU featuresupstream-master
It's possible to compile the gpu device without virgl_renderer. In fact, in many instances, this may be required. This builds the gpu device default, but only with --gpu do I see /dev/dri/renderN128, so this should be safe. BUG=b:173630595 TEST=compile and run Cq-Depend: chromium:2592111 Change-Id: I5fbf2de8a2f818a9ca2e5ac4a1a02c7797cff927 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2592089 Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
-rw-r--r--Cargo.toml5
-rw-r--r--devices/Cargo.toml3
-rw-r--r--rutabaga_gfx/Cargo.toml4
-rw-r--r--rutabaga_gfx/src/virgl_renderer.rs22
4 files changed, 18 insertions, 16 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 4a2eccdc..be8e5e46 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,7 +31,7 @@ exclude = [
]
[features]
-default = ["audio"]
+default = ["audio", "gpu"]
chromeos = ["base/chromeos"]
default-no-sandbox = []
audio = ["devices/audio"]
@@ -43,8 +43,9 @@ video-decoder = ["devices/video-decoder"]
video-encoder = ["devices/video-encoder"]
wl-dmabuf = ["devices/wl-dmabuf", "gpu_buffer", "resources/wl-dmabuf"]
x = ["devices/x"]
-virtio-gpu-next = ["rutabaga_gfx/virtio-gpu-next"]
+virgl_renderer_next = ["rutabaga_gfx/virgl_renderer_next"]
composite-disk = ["protos/composite-disk", "protobuf", "disk/composite-disk"]
+virgl_renderer = ["devices/virgl_renderer"]
gfxstream = ["devices/gfxstream"]
gdb = ["gdbstub", "thiserror", "arch/gdb", "vm_control/gdb", "x86_64/gdb"]
diff --git a/devices/Cargo.toml b/devices/Cargo.toml
index 66aa19b2..8c35682f 100644
--- a/devices/Cargo.toml
+++ b/devices/Cargo.toml
@@ -6,12 +6,13 @@ edition = "2018"
[features]
audio = []
-gpu = ["gpu_buffer", "gpu_display", "rutabaga_gfx/virgl_renderer"]
+gpu = ["gpu_buffer", "gpu_display","rutabaga_gfx"]
tpm = ["protos/trunks", "tpm2"]
video-decoder = ["libvda"]
video-encoder = ["libvda"]
wl-dmabuf = []
x = ["gpu_display/x"]
+virgl_renderer = ["gpu", "rutabaga_gfx/virgl_renderer"]
gfxstream = ["gpu", "rutabaga_gfx/gfxstream"]
[dependencies]
diff --git a/rutabaga_gfx/Cargo.toml b/rutabaga_gfx/Cargo.toml
index bde3d825..14aed810 100644
--- a/rutabaga_gfx/Cargo.toml
+++ b/rutabaga_gfx/Cargo.toml
@@ -5,9 +5,9 @@ authors = ["The Chromium OS Authors"]
edition = "2018"
[features]
-virgl_renderer = []
-virtio-gpu-next = []
gfxstream = []
+virgl_renderer = []
+virgl_renderer_next = []
[dependencies]
data_model = { path = "../data_model" }
diff --git a/rutabaga_gfx/src/virgl_renderer.rs b/rutabaga_gfx/src/virgl_renderer.rs
index 95c476af..fa084c83 100644
--- a/rutabaga_gfx/src/virgl_renderer.rs
+++ b/rutabaga_gfx/src/virgl_renderer.rs
@@ -134,7 +134,7 @@ fn export_query(resource_id: u32, export_fd: bool) -> RutabagaResult<Query> {
#[allow(unused_variables)]
fn map_func(resource_id: u32) -> ExternalMappingResult<(u64, usize)> {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
let mut map: *mut c_void = null_mut();
let map_ptr: *mut *mut c_void = &mut map;
@@ -147,13 +147,13 @@ fn map_func(resource_id: u32) -> ExternalMappingResult<(u64, usize)> {
Ok((map as u64, size as usize))
}
- #[cfg(not(feature = "virtio-gpu-next"))]
+ #[cfg(not(feature = "virgl_renderer_next"))]
Err(ExternalMappingError::Unsupported)
}
#[allow(unused_variables)]
fn unmap_func(resource_id: u32) {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
unsafe {
// Usually, process_gpu_command forces ctx0 when processing a virtio-gpu command.
@@ -412,7 +412,7 @@ impl RutabagaComponent for VirglRenderer {
resource_create_blob: ResourceCreateBlob,
mut iovecs: Vec<RutabagaIovec>,
) -> RutabagaResult<RutabagaResource> {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
let resource_create_args = virgl_renderer_resource_create_blob_args {
res_handle: resource_id,
@@ -436,7 +436,7 @@ impl RutabagaComponent for VirglRenderer {
resource_2d: None,
})
}
- #[cfg(not(feature = "virtio-gpu-next"))]
+ #[cfg(not(feature = "virgl_renderer_next"))]
Err(RutabagaError::Unsupported)
}
@@ -450,7 +450,7 @@ impl RutabagaComponent for VirglRenderer {
#[allow(unused_variables)]
fn map_info(&self, resource_id: u32) -> RutabagaResult<u32> {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
let mut map_info = 0;
let ret =
@@ -459,7 +459,7 @@ impl RutabagaComponent for VirglRenderer {
Ok(map_info)
}
- #[cfg(not(feature = "virtio-gpu-next"))]
+ #[cfg(not(feature = "virgl_renderer_next"))]
Err(RutabagaError::Unsupported)
}
@@ -482,7 +482,7 @@ impl RutabagaComponent for VirglRenderer {
#[allow(unused_variables)]
fn export_blob(&self, resource_id: u32) -> RutabagaResult<Arc<RutabagaHandle>> {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
let mut fd_type = 0;
let mut fd = 0;
@@ -505,13 +505,13 @@ impl RutabagaComponent for VirglRenderer {
handle_type: RUTABAGA_MEM_HANDLE_TYPE_DMABUF,
}))
}
- #[cfg(not(feature = "virtio-gpu-next"))]
+ #[cfg(not(feature = "virgl_renderer_next"))]
Err(RutabagaError::Unsupported)
}
#[allow(unused_variables)]
fn export_fence(&self, fence_id: u32) -> RutabagaResult<RutabagaHandle> {
- #[cfg(feature = "virtio-gpu-next")]
+ #[cfg(feature = "virgl_renderer_next")]
{
// Safe because the parameters are stack variables of the correct type.
let mut fd: i32 = 0;
@@ -526,7 +526,7 @@ impl RutabagaComponent for VirglRenderer {
handle_type: RUTABAGA_FENCE_HANDLE_TYPE_SYNC_FD,
})
}
- #[cfg(not(feature = "virtio-gpu-next"))]
+ #[cfg(not(feature = "virgl_renderer_next"))]
Err(RutabagaError::Unsupported)
}