|
@@ -17,15 +17,15 @@ pub struct VirtIOGpu<'a, H: Hal, T: Transport> {
|
|
|
transport: T,
|
|
|
rect: Option<Rect>,
|
|
|
/// DMA area of frame buffer.
|
|
|
- frame_buffer_dma: Option<DMA<H>>,
|
|
|
+ frame_buffer_dma: Option<Dma<H>>,
|
|
|
/// DMA area of cursor image buffer.
|
|
|
- cursor_buffer_dma: Option<DMA<H>>,
|
|
|
+ cursor_buffer_dma: Option<Dma<H>>,
|
|
|
/// Queue for sending control commands.
|
|
|
control_queue: VirtQueue<H>,
|
|
|
/// Queue for sending cursor commands.
|
|
|
cursor_queue: VirtQueue<H>,
|
|
|
/// Queue buffer DMA
|
|
|
- queue_buf_dma: DMA<H>,
|
|
|
+ queue_buf_dma: Dma<H>,
|
|
|
/// Send buffer for queue.
|
|
|
queue_buf_send: &'a mut [u8],
|
|
|
/// Recv buffer for queue.
|
|
@@ -56,7 +56,7 @@ impl<H: Hal, T: Transport> VirtIOGpu<'_, H, T> {
|
|
|
let control_queue = VirtQueue::new(&mut transport, QUEUE_TRANSMIT, 2)?;
|
|
|
let cursor_queue = VirtQueue::new(&mut transport, QUEUE_CURSOR, 2)?;
|
|
|
|
|
|
- let queue_buf_dma = DMA::new(2)?;
|
|
|
+ let queue_buf_dma = Dma::new(2)?;
|
|
|
let queue_buf_send = unsafe { &mut queue_buf_dma.as_buf()[..PAGE_SIZE] };
|
|
|
let queue_buf_recv = unsafe { &mut queue_buf_dma.as_buf()[PAGE_SIZE..] };
|
|
|
|
|
@@ -102,7 +102,7 @@ impl<H: Hal, T: Transport> VirtIOGpu<'_, H, T> {
|
|
|
|
|
|
// alloc continuous pages for the frame buffer
|
|
|
let size = display_info.rect.width * display_info.rect.height * 4;
|
|
|
- let frame_buffer_dma = DMA::new(pages(size as usize))?;
|
|
|
+ let frame_buffer_dma = Dma::new(pages(size as usize))?;
|
|
|
|
|
|
// resource_attach_backing
|
|
|
self.resource_attach_backing(RESOURCE_ID_FB, frame_buffer_dma.paddr() as u64, size)?;
|
|
@@ -138,7 +138,7 @@ impl<H: Hal, T: Transport> VirtIOGpu<'_, H, T> {
|
|
|
if cursor_image.len() != size as usize {
|
|
|
return Err(Error::InvalidParam);
|
|
|
}
|
|
|
- let cursor_buffer_dma = DMA::new(pages(size as usize))?;
|
|
|
+ let cursor_buffer_dma = Dma::new(pages(size as usize))?;
|
|
|
let buf = unsafe { cursor_buffer_dma.as_buf() };
|
|
|
buf.copy_from_slice(cursor_image);
|
|
|
|