From 1b6feeb7c7f0da84ea22c7fa3168efa8653a9006 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 26 Dec 2024 20:59:08 +0100 Subject: [PATCH] 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. --- graphics/virtio-gpud/src/scheme.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/graphics/virtio-gpud/src/scheme.rs b/graphics/virtio-gpud/src/scheme.rs index b72f1aa5f6..e9c1bef067 100644 --- a/graphics/virtio-gpud/src/scheme.rs +++ b/graphics/virtio-gpud/src/scheme.rs @@ -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 { 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)