1
0
Fork 0
forked from wry/wry

video: add udmabuf allocator

This commit is contained in:
Julian Orth 2024-09-01 20:23:04 +02:00
parent 2579834a60
commit 62cd29056a
33 changed files with 883 additions and 256 deletions

View file

@ -21,10 +21,16 @@ impl JayRenderCtx {
pub fn send_render_ctx(&self, ctx: Option<Rc<dyn GfxContext>>) {
let mut fd = None;
if let Some(ctx) = ctx {
match ctx.gbm().drm.dup_render() {
Ok(d) => fd = Some(d.fd().clone()),
Err(e) => {
log::error!("Could not dup drm fd: {}", ErrorFmt(e));
let allocator = ctx.allocator();
match allocator.drm() {
Some(drm) => match drm.dup_render() {
Ok(d) => fd = Some(d.fd().clone()),
Err(e) => {
log::error!("Could not dup drm fd: {}", ErrorFmt(e));
}
},
None => {
log::error!("Allocator does not have a DRM device");
}
}
} else {