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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user