gpu: Expose Venus capset for virglrenderer backend
Expose Venus capability set support using the virglrenderer backend, enabled by the new blob resource support. Signed-off-by: Matej Hrica <mhrica@redhat.com> (cherry picked from commit 6dcc71ef1644d565542a9dbd6601192383d27a96)
This commit is contained in:
parent
b783086a78
commit
03967ec5e1
3 changed files with 14 additions and 4 deletions
|
|
@ -173,10 +173,12 @@ impl VirglRendererAdapter {
|
|||
gpu_backend: Option<GpuBackend>,
|
||||
) -> io::Result<Self> {
|
||||
let capsets = config.capsets();
|
||||
let venus_enabled = capsets.contains(GpuCapset::VENUS);
|
||||
|
||||
let virglrenderer_flags = VirglRendererFlags::new()
|
||||
.use_virgl(true)
|
||||
.use_venus(true)
|
||||
.use_venus(venus_enabled)
|
||||
.use_render_server(venus_enabled)
|
||||
.use_egl(config.flags().use_egl)
|
||||
.use_gles(config.flags().use_gles)
|
||||
.use_glx(config.flags().use_glx)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ use log::info;
|
|||
#[cfg(feature = "backend-gfxstream")]
|
||||
use rutabaga_gfx::{RUTABAGA_CAPSET_GFXSTREAM_GLES, RUTABAGA_CAPSET_GFXSTREAM_VULKAN};
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
use rutabaga_gfx::{RUTABAGA_CAPSET_VIRGL, RUTABAGA_CAPSET_VIRGL2};
|
||||
use rutabaga_gfx::{RUTABAGA_CAPSET_VENUS, RUTABAGA_CAPSET_VIRGL, RUTABAGA_CAPSET_VIRGL2};
|
||||
use thiserror::Error as ThisError;
|
||||
use vhost_user_backend::VhostUserDaemon;
|
||||
use vm_memory::{GuestMemoryAtomic, GuestMemoryMmap};
|
||||
|
|
@ -78,7 +78,9 @@ bitflags! {
|
|||
#[cfg(feature = "backend-virgl")]
|
||||
const VIRGL2 = 1 << RUTABAGA_CAPSET_VIRGL2 as u64;
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
const ALL_VIRGLRENDERER_CAPSETS = Self::VIRGL.bits() | Self::VIRGL2.bits();
|
||||
const VENUS = 1 << RUTABAGA_CAPSET_VENUS as u64;
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
const ALL_VIRGLRENDERER_CAPSETS = Self::VIRGL.bits() | Self::VIRGL2.bits() | Self::VENUS.bits();
|
||||
|
||||
#[cfg(feature = "backend-gfxstream")]
|
||||
const GFXSTREAM_VULKAN = 1 << RUTABAGA_CAPSET_GFXSTREAM_VULKAN as u64;
|
||||
|
|
@ -108,6 +110,8 @@ impl Display for GpuCapset {
|
|||
Self::VIRGL => write!(f, "virgl")?,
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
Self::VIRGL2 => write!(f, "virgl2")?,
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
Self::VENUS => write!(f, "venus")?,
|
||||
#[cfg(feature = "backend-gfxstream")]
|
||||
Self::GFXSTREAM_VULKAN => write!(f, "gfxstream-vulkan")?,
|
||||
#[cfg(feature = "backend-gfxstream")]
|
||||
|
|
@ -432,7 +436,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_default_num_capsets() {
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
assert_eq!(DEFAULT_VIRGLRENDER_CAPSET_MASK.num_capsets(), 2);
|
||||
assert_eq!(DEFAULT_VIRGLRENDER_CAPSET_MASK.num_capsets(), 3);
|
||||
#[cfg(feature = "backend-gfxstream")]
|
||||
assert_eq!(DEFAULT_GFXSTREAM_CAPSET_MASK.num_capsets(), 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ pub enum CapsetName {
|
|||
#[cfg(feature = "backend-virgl")]
|
||||
Virgl2 = GpuCapset::VIRGL2.bits(),
|
||||
|
||||
/// [virglrenderer] Venus (Vulkan) implementation
|
||||
#[cfg(feature = "backend-virgl")]
|
||||
Venus = GpuCapset::VENUS.bits(),
|
||||
|
||||
/// [gfxstream] Vulkan implementation (partial support only){n}
|
||||
/// NOTE: Can only be used for 2D display output for now, there is no
|
||||
/// hardware acceleration yet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue