graphics/virtio-gpud: Add helper to submit a fenced request
This is necessary for implementing hardware cursor support.
This commit is contained in:
@@ -109,6 +109,9 @@ pub enum CommandTy {
|
||||
|
||||
static_assertions::const_assert_eq!(core::mem::size_of::<CommandTy>(), 4);
|
||||
|
||||
const VIRTIO_GPU_FLAG_FENCE: u32 = 1 << 0;
|
||||
//const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 1 << 1;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct ControlHeader {
|
||||
|
||||
@@ -66,6 +66,18 @@ impl VirtGpuAdapter<'_> {
|
||||
Ok(header)
|
||||
}
|
||||
|
||||
async fn send_request_fenced<T>(&self, request: Dma<T>) -> Result<Dma<ControlHeader>, Error> {
|
||||
let mut header = Dma::new(ControlHeader::default())?;
|
||||
header.flags |= VIRTIO_GPU_FLAG_FENCE;
|
||||
let command = ChainBuilder::new()
|
||||
.chain(Buffer::new(&request))
|
||||
.chain(Buffer::new(&header).flags(DescriptorFlags::WRITE_ONLY))
|
||||
.build();
|
||||
|
||||
self.control_queue.send(command).await;
|
||||
Ok(header)
|
||||
}
|
||||
|
||||
async fn get_display_info(&self) -> Result<Dma<GetDisplayInfo>, Error> {
|
||||
let header = Dma::new(ControlHeader::with_ty(CommandTy::GetDisplayInfo))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user