1
0
Fork 0
forked from wry/wry

dmabuf: add PlaneVec

This commit is contained in:
Julian Orth 2023-10-23 20:41:33 +02:00
parent 3e4bed66b0
commit d022d96fbf
9 changed files with 42 additions and 23 deletions

View file

@ -1,4 +1,9 @@
use {crate::format::Format, std::rc::Rc, uapi::OwnedFd};
use {
crate::{format::Format, video::Modifier},
arrayvec::ArrayVec,
std::rc::Rc,
uapi::OwnedFd,
};
#[derive(Clone)]
pub struct DmaBufPlane {
@ -12,6 +17,10 @@ pub struct DmaBuf {
pub width: i32,
pub height: i32,
pub format: &'static Format,
pub modifier: u64,
pub planes: Vec<DmaBufPlane>,
pub modifier: Modifier,
pub planes: PlaneVec<DmaBufPlane>,
}
pub const MAX_PLANES: usize = 4;
pub type PlaneVec<T> = ArrayVec<T, MAX_PLANES>;