From b5eeaed9e17ce2acaf4a50f01c4e90718d62516f Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 28 Dec 2024 14:31:03 +0100 Subject: [PATCH] graphics/virtio-gpud: Use resource size rather than display size in set_scanout This ensures we use the right size if the display got resized but the resource hasn't been resized yet. --- graphics/virtio-gpud/src/scheme.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/graphics/virtio-gpud/src/scheme.rs b/graphics/virtio-gpud/src/scheme.rs index 82809cad41..3f140fb8f3 100644 --- a/graphics/virtio-gpud/src/scheme.rs +++ b/graphics/virtio-gpud/src/scheme.rs @@ -125,7 +125,7 @@ impl GraphicsAdapter for VirtGpuAdapter<'_> { let header = self.send_request(request).await.unwrap(); assert_eq!(header.ty, CommandTy::RespOkNodata); - // Use the allocated framebuffer from tthe guest ram, and attach it as backing + // Use the allocated framebuffer from the guest ram, and attach it as backing // storage to the resource just created, using `VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING`. let mut mem_entries = @@ -168,12 +168,7 @@ impl GraphicsAdapter for VirtGpuAdapter<'_> { let scanout_request = Dma::new(SetScanout::new( display_id as u32, resource.id, - GpuRect::new( - 0, - 0, - self.displays[display_id].width, - self.displays[display_id].height, - ), + GpuRect::new(0, 0, resource.width, resource.height), )) .unwrap(); let header = self.send_request(scanout_request).await.unwrap();