dmabuf: add PlaneVec
This commit is contained in:
parent
3e4bed66b0
commit
d022d96fbf
9 changed files with 42 additions and 23 deletions
|
|
@ -8,7 +8,7 @@ use {
|
|||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
video::{
|
||||
dmabuf::{DmaBuf, DmaBufPlane},
|
||||
dmabuf::{DmaBuf, DmaBufPlane, PlaneVec},
|
||||
INVALID_MODIFIER,
|
||||
},
|
||||
wire::{wl_drm::*, WlDrmId},
|
||||
|
|
@ -123,7 +123,7 @@ impl WlDrm {
|
|||
height: req.height,
|
||||
format,
|
||||
modifier: INVALID_MODIFIER,
|
||||
planes: vec![],
|
||||
planes: PlaneVec::new(),
|
||||
};
|
||||
if req.stride0 > 0 {
|
||||
dmabuf.planes.push(DmaBufPlane {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use {
|
|||
buffd::{MsgParser, MsgParserError},
|
||||
errorfmt::ErrorFmt,
|
||||
},
|
||||
video::dmabuf::{DmaBuf, DmaBufPlane},
|
||||
video::dmabuf::{DmaBuf, DmaBufPlane, PlaneVec, MAX_PLANES},
|
||||
wire::{zwp_linux_buffer_params_v1::*, WlBufferId, ZwpLinuxBufferParamsV1Id},
|
||||
},
|
||||
ahash::AHashMap,
|
||||
|
|
@ -27,7 +27,7 @@ const INTERLACED: u32 = 2;
|
|||
#[allow(dead_code)]
|
||||
const BOTTOM_FIRST: u32 = 4;
|
||||
|
||||
const MAX_PLANE: u32 = 3;
|
||||
const MAX_PLANE: u32 = MAX_PLANES as u32 - 1;
|
||||
|
||||
pub struct ZwpLinuxBufferParamsV1 {
|
||||
pub id: ZwpLinuxBufferParamsV1Id,
|
||||
|
|
@ -118,7 +118,7 @@ impl ZwpLinuxBufferParamsV1 {
|
|||
height,
|
||||
format: format.format,
|
||||
modifier,
|
||||
planes: vec![],
|
||||
planes: PlaneVec::new(),
|
||||
};
|
||||
let mut planes: Vec<_> = self.planes.borrow_mut().drain().map(|v| v.1).collect();
|
||||
planes.sort_by_key(|a| a.plane_idx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue