1
0
Fork 0
forked from wry/wry

wayland: implement linux-drm-syncobj-v1

This commit is contained in:
Julian Orth 2024-03-21 20:54:21 +01:00
parent 816315170f
commit aaf73d6fdc
29 changed files with 1507 additions and 35 deletions

View file

@ -14,7 +14,11 @@ use {
renderer::{framebuffer::Framebuffer, image::Image},
GfxGlState, RenderError, Texture,
},
video::{dmabuf::DmaBuf, drm::Drm, gbm::GbmDevice},
video::{
dmabuf::DmaBuf,
drm::{sync_obj::SyncObjCtx, Drm},
gbm::GbmDevice,
},
},
ahash::AHashMap,
jay_config::video::GfxApi,
@ -53,6 +57,7 @@ pub(crate) struct TexProgs {
pub(in crate::gfx_apis::gl) struct GlRenderContext {
pub(crate) ctx: Rc<EglContext>,
pub gbm: Rc<GbmDevice>,
pub sync_ctx: Rc<SyncObjCtx>,
pub(crate) render_node: Rc<CString>,
@ -128,6 +133,7 @@ impl GlRenderContext {
Ok(Self {
ctx: ctx.clone(),
gbm: ctx.dpy.gbm.clone(),
sync_ctx: Rc::new(SyncObjCtx::new(ctx.dpy.gbm.drm.fd())),
render_node: node.clone(),
@ -271,4 +277,8 @@ impl GfxContext for GlRenderContext {
})?;
Ok(Rc::new(Framebuffer { ctx: self, gl: fb }))
}
fn sync_obj_ctx(&self) -> &Rc<SyncObjCtx> {
&self.sync_ctx
}
}