virtio-gpud: Add offset method to XferToHost2d

This will hopefully avoid confusion if someone in the future changes the
XferToHost2d in flush to pass a smaller GpuRect. Without adjusting
offset this would cause glitches.
This commit is contained in:
bjorn3
2024-12-23 18:10:32 +01:00
parent f6cc7d25df
commit 025086acd1
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -392,7 +392,7 @@ pub struct XferToHost2d {
}
impl XferToHost2d {
pub fn new(resource_id: ResourceId, rect: GpuRect) -> Self {
pub fn new(resource_id: ResourceId, rect: GpuRect, offset: u64) -> Self {
Self {
header: ControlHeader {
ty: VolatileCell::new(CommandTy::TransferToHost2d),
@@ -400,8 +400,8 @@ impl XferToHost2d {
},
rect,
offset,
resource_id,
offset: 0,
padding: 0,
}
}
+1
View File
@@ -193,6 +193,7 @@ impl<'a> Display<'a> {
width: self.width,
height: self.height,
},
0,
))?;
let header = self.send_request(req).await?;
assert_eq!(header.ty.get(), CommandTy::RespOkNodata);