1
0
Fork 0
forked from wry/wry

egui: add integration

This commit is contained in:
Julian Orth 2026-02-22 00:26:52 +01:00
parent 85b9b7222d
commit 008e8a671a
49 changed files with 4110 additions and 149 deletions

View file

@ -1,8 +1,12 @@
use {
crate::{
format::Format,
gfx_api::SyncFile,
utils::{compat::IoctlNumber, oserror::OsError},
video::{LINEAR_MODIFIER, Modifier},
video::{
LINEAR_MODIFIER, Modifier,
drm::{DrmError, syncobj::merge_sync_files},
},
},
arrayvec::ArrayVec,
std::{cell::OnceCell, rc::Rc, sync::OnceLock},
@ -113,6 +117,22 @@ impl DmaBuf {
}
Ok(())
}
pub fn export_sync_file(&self, flags: u32) -> Result<Option<SyncFile>, DrmError> {
let mut sf = PlaneVec::new();
for plane in &self.planes {
sf.push(
dma_buf_export_sync_file(&plane.fd, flags)
.map(Rc::new)
.map(SyncFile)
.map_err(DrmError::ExportSyncFile)?,
);
if self.is_one_file() {
break;
}
}
merge_sync_files(sf.iter())
}
}
const DMA_BUF_BASE: u64 = b'b' as _;