pub(crate) fn alloc_render_target<T: AsFd>(
gbm: &Device<T>,
width: u32,
height: u32,
format: Format,
) -> Result<BufferObject<()>>Expand description
The buffer a display is rendered into and a hardware encoder reads in place: one plane, for rendering. Intel’s video processor, converting to 4:2:0, reads a linear surface at a pitch rounded up to 64 bytes whatever pitch its import declares, and Mesa gives a linear buffer allocated for rendering alone the pitch of its width, so a width that is no multiple of 16 reaches the encoder sheared. A buffer the display engine may scan out carries that engine’s aligned pitch, so a linear allocation whose pitch is not a multiple of 64 is made again for scanout as well, and that one is kept only where it came out aligned.