graphics/virtio-gpud: Use VM window size as display size

Rather than hard coding 1920x1080. This doesn't yet handle resizing the
VM window at runtime though.
This commit is contained in:
bjorn3
2024-12-26 20:59:08 +01:00
parent 3ed3ff2edb
commit 1b6feeb7c7
+4 -9
View File
@@ -38,14 +38,6 @@ pub struct Display {
}
impl Display {
pub fn new() -> Self {
Self {
// FIXME use the actual screen size
width: 1920,
height: 1080,
}
}
async fn get_fpath(&self, buffer: &mut [u8]) -> Result<usize, Error> {
let path = format!("display.virtio-gpu:3.0/{}/{}", self.width, self.height);
@@ -271,7 +263,10 @@ impl<'a> GpuScheme<'a> {
info.rect().height
);
result.push(Display::new());
result.push(Display {
width: info.rect().width,
height: info.rect().height,
});
}
Ok(result)