diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs index c8d4dcd067..0047bbd0be 100644 --- a/devices/src/virtio/gpu/mod.rs +++ b/devices/src/virtio/gpu/mod.rs @@ -36,6 +36,7 @@ use super::{ use self::backend::Backend; use self::protocol::*; +use pci::{PciBarConfiguration, PciBarPrefetchable, PciBarRegionType}; // First queue is for virtio gpu commands. Second queue is for cursor commands, which we expect // there to be fewer of. @@ -809,4 +810,16 @@ impl VirtioDevice for Gpu { return; } } + + // Require 1 BAR for mapping 3D buffers + fn get_device_bars(&self) -> Option> { + let mut bars = Vec::new(); + bars.push(PciBarConfiguration::new( + 4, + 1 << 33, + PciBarRegionType::Memory64BitRegion, + PciBarPrefetchable::NotPrefetchable, + )); + Some(bars) + } }