diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs index 5392618cd9..3c49ef3547 100644 --- a/devices/src/virtio/gpu/mod.rs +++ b/devices/src/virtio/gpu/mod.rs @@ -448,6 +448,7 @@ impl Frontend { info.r.y.to_native(), info.r.width.to_native(), info.r.height.to_native(), + info.offset.to_native(), ); self.virtio_gpu.transfer_write(0, resource_id, transfer) } diff --git a/devices/src/virtio/gpu/virtio_gpu.rs b/devices/src/virtio/gpu/virtio_gpu.rs index d7426603df..b17262e4f9 100644 --- a/devices/src/virtio/gpu/virtio_gpu.rs +++ b/devices/src/virtio/gpu/virtio_gpu.rs @@ -382,7 +382,7 @@ impl VirtioGpuScanout { .framebuffer_region(surface_id, 0, 0, self.width, self.height) .ok_or(ErrUnspec)?; - let mut transfer = Transfer3D::new_2d(0, 0, self.width, self.height); + let mut transfer = Transfer3D::new_2d(0, 0, self.width, self.height, 0); transfer.stride = fb.stride(); let fb_slice = fb.as_volatile_slice(); let buf = IoSliceMut::new( diff --git a/rutabaga_gfx/src/rutabaga_utils.rs b/rutabaga_gfx/src/rutabaga_utils.rs index 616ee968b8..62a57f0080 100644 --- a/rutabaga_gfx/src/rutabaga_utils.rs +++ b/rutabaga_gfx/src/rutabaga_utils.rs @@ -616,7 +616,7 @@ pub struct Transfer3D { impl Transfer3D { /// Constructs a 2 dimensional XY box in 3 dimensional space with unit depth and zero /// displacement on the Z axis. - pub fn new_2d(x: u32, y: u32, w: u32, h: u32) -> Transfer3D { + pub fn new_2d(x: u32, y: u32, w: u32, h: u32, offset: u64) -> Transfer3D { Transfer3D { x, y, @@ -627,7 +627,7 @@ impl Transfer3D { level: 0, stride: 0, layer_stride: 0, - offset: 0, + offset, } }