Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/backend/allocator/dmabuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ impl Dmabuf {
self.0.planes.iter().map(|p| p.stride)
}

/// Returns if this buffer format has any vendor-specific modifiers set or is implicit/linear
/// Returns if this buffer format has any vendor-specific modifiers set or is implicit
pub fn has_modifier(&self) -> bool {
self.0.modifier != Modifier::Invalid && self.0.modifier != Modifier::Linear
self.0.modifier != Modifier::Invalid
}

/// Returns if the buffer is stored inverted on the y-axis
Expand Down
5 changes: 4 additions & 1 deletion src/backend/allocator/gbm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ impl Dmabuf {
offsets[i] = offset as i32;
}

if self.has_modifier() || self.num_planes() > 1 || self.offsets().next().unwrap() != 0 {
if (self.has_modifier() && self.format().modifier != Modifier::Linear)
|| self.num_planes() > 1
|| self.offsets().next().unwrap() != 0
{
gbm.import_buffer_object_from_dma_buf_with_modifiers(
self.num_planes() as u32,
handles,
Expand Down
Loading