Remove DMABUF handler functions on !unix

This commit is contained in:
Marc-André Lureau 2022-11-16 22:43:08 +04:00
parent 16e20d7b4a
commit 12d7cd59c3
2 changed files with 7 additions and 4 deletions

View File

@ -98,8 +98,10 @@ pub trait ConsoleListenerHandler: 'static + Send + Sync {
async fn update(&mut self, update: Update); async fn update(&mut self, update: Update);
#[cfg(unix)]
async fn scanout_dmabuf(&mut self, scanout: ScanoutDMABUF); async fn scanout_dmabuf(&mut self, scanout: ScanoutDMABUF);
#[cfg(unix)]
async fn update_dmabuf(&mut self, update: UpdateDMABUF); async fn update_dmabuf(&mut self, update: UpdateDMABUF);
async fn mouse_set(&mut self, set: MouseSet); async fn mouse_set(&mut self, set: MouseSet);

View File

@ -174,10 +174,6 @@ mod imp {
} }
this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, u.stride as _, &u.data); this.obj().update_area(u.x as _, u.y as _, u.w as _, u.h as _, u.stride as _, &u.data);
} }
#[cfg(windows)]
ScanoutDMABUF(_) => {
unimplemented!()
}
#[cfg(unix)] #[cfg(unix)]
ScanoutDMABUF(s) => { ScanoutDMABUF(s) => {
this.obj().set_display_size(Some((s.width as _, s.height as _))); this.obj().set_display_size(Some((s.width as _, s.height as _)));
@ -191,6 +187,7 @@ mod imp {
fd: s.into_raw_fd(), fd: s.into_raw_fd(),
}); });
} }
#[cfg(unix)]
UpdateDMABUF { wait_tx, .. } => { UpdateDMABUF { wait_tx, .. } => {
this.obj().render(); this.obj().render();
let _ = wait_tx.send(()); let _ = wait_tx.send(());
@ -257,7 +254,9 @@ impl Display {
enum ConsoleEvent { enum ConsoleEvent {
Scanout(qemu_display::Scanout), Scanout(qemu_display::Scanout),
Update(qemu_display::Update), Update(qemu_display::Update),
#[cfg(unix)]
ScanoutDMABUF(qemu_display::ScanoutDMABUF), ScanoutDMABUF(qemu_display::ScanoutDMABUF),
#[cfg(unix)]
UpdateDMABUF { UpdateDMABUF {
_update: qemu_display::UpdateDMABUF, _update: qemu_display::UpdateDMABUF,
wait_tx: futures::channel::oneshot::Sender<()>, wait_tx: futures::channel::oneshot::Sender<()>,
@ -289,10 +288,12 @@ impl ConsoleListenerHandler for ConsoleHandler {
self.send(ConsoleEvent::Update(update)); self.send(ConsoleEvent::Update(update));
} }
#[cfg(unix)]
async fn scanout_dmabuf(&mut self, scanout: qemu_display::ScanoutDMABUF) { async fn scanout_dmabuf(&mut self, scanout: qemu_display::ScanoutDMABUF) {
self.send(ConsoleEvent::ScanoutDMABUF(scanout)); self.send(ConsoleEvent::ScanoutDMABUF(scanout));
} }
#[cfg(unix)]
async fn update_dmabuf(&mut self, _update: qemu_display::UpdateDMABUF) { async fn update_dmabuf(&mut self, _update: qemu_display::UpdateDMABUF) {
let (wait_tx, wait_rx) = futures::channel::oneshot::channel(); let (wait_tx, wait_rx) = futures::channel::oneshot::channel();
self.send(ConsoleEvent::UpdateDMABUF { _update, wait_tx }); self.send(ConsoleEvent::UpdateDMABUF { _update, wait_tx });