virtio-gpu: add a BAR for device

BUG=chromium:924405
TEST=compile

Change-Id: I8a583df2a9db4ea7e066eb284eac54fc62580350
Reviewed-on: https://chromium-review.googlesource.com/1480744
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
Gurchetan Singh 2019-01-28 16:39:31 -08:00 committed by chrome-bot
parent 09358ef076
commit e95f4d75c0

View file

@ -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<Vec<PciBarConfiguration>> {
let mut bars = Vec::new();
bars.push(PciBarConfiguration::new(
4,
1 << 33,
PciBarRegionType::Memory64BitRegion,
PciBarPrefetchable::NotPrefetchable,
));
Some(bars)
}
}