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.
This commit is contained in:
bjorn3
2024-12-28 14:31:03 +01:00
parent 0b8648ff5b
commit b5eeaed9e1
+2 -7
View File
@@ -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();