voelin-media: hand a DMA-BUF-taking sink the buffer's real size

The portal offers a sink that accepts DMA-BUFs the buffer as it is, with
its size taken from `mapoffset + maxsize`: the same fields e5789e4 found
0 for every DMA-BUF this compositor sends, which left the mapping empty.
On the sink path the size goes into the DRM PRIME descriptor of the
import. Mesa happens to ignore it (an import with size 0 encoded the same
picture here), but the size is part of the descriptor and other drivers
use it, so ask the buffer object (lseek to the end, which a DMA-BUF
answers with its size) and fall back to the rows the format describes.

The module documentation now says what a DMA-BUF-taking sink gets, and
why tiled buffers are still not offered: the modifiers the encoder's
driver imports are not known on this side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 02:35:34 +03:00
1 parent 53057b657e
commit 8cc0636eee
3 files changed
+29 -6

No files matched your search

+1 -1
View File
@@ -1098,7 +1098,7 @@ impl FfmpegEncoder {
/// this frame's packet came out (the encoder reads them one frame deep).
/// RGB buffers (`XR24`, `AR24`, `XB24`, `AB24`: what screen capture
/// delivers) are converted into the session's NV12 surfaces on the GPU
/// (VA-API video processing, [`vpp`]), cropped to the coded size, and
/// (VA-API video processing), cropped to the coded size, and
/// are no longer read when this returns.
///
/// Anything else fails with `Error::CodecUnavailable`; callers then map