1
0
Fork 0
forked from wry/wry

drm: preserve GbmBos while they are in use

This commit is contained in:
Julian Orth 2024-05-08 23:10:22 +02:00
parent 760658522c
commit 110f45fef7
5 changed files with 25 additions and 7 deletions

View file

@ -17,7 +17,7 @@ use {
},
video::{
dmabuf::DmaBuf,
gbm::{GbmError, GBM_BO_USE_LINEAR, GBM_BO_USE_RENDERING},
gbm::{GbmBo, GbmError, GBM_BO_USE_LINEAR, GBM_BO_USE_RENDERING},
Modifier, INVALID_MODIFIER, LINEAR_MODIFIER,
},
wire::{jay_screencast::*, JayScreencastId},
@ -100,6 +100,7 @@ struct Pending {
}
struct ScreencastBuffer {
_bo: GbmBo,
dmabuf: DmaBuf,
fb: Rc<dyn GfxFramebuffer>,
free: bool,
@ -403,6 +404,7 @@ impl JayScreencast {
let fb = ctx.clone().dmabuf_img(buffer.dmabuf())?.to_framebuffer()?;
buffers.push(ScreencastBuffer {
dmabuf: buffer.dmabuf().clone(),
_bo: buffer,
fb,
free: true,
});