Skip to main content

Module vpp

Module vpp 

Source
Expand description

Video post-processing: the VAEntrypointVideoProc pipeline.

The one operation is a blit from one surface into another, which the video processor stretches to fit the destination and converts to the destination’s format on the way. That covers three jobs without the pixels leaving the GPU:

  • Scaling: blit into a smaller or larger surface.
  • Color conversion: blit a packed RGB or YUYV surface into an NV12 one, the format an encoder takes. Processor::blit takes the YUV space to write.
  • Re-tiling: blit into a surface of the same size and format. The destination is one the driver allocated for itself, so the blit rewrites the pixels into whatever tiling the driver prefers for a fresh allocation. That is how a DMA-BUF carrying a format modifier some other API refuses to import becomes one it accepts. Measured on Intel Meteor Lake with iHD 26.1.5 (the retile_round_trip test prints it), a decode target exports at 0x100000000000009 (I915_FORMAT_MOD_4_TILED), which Mesa’s Vulkan driver lists, so that combination does not need it. Older iHD releases wrote Y_TILED (0x100000000000002), which Mesa does not list.
use moq_vaapi::vpp::Processor;

let processor = Processor::new("/dev/dri/renderD128")?;
let retiled = processor.retile(buffer)?;
let exported = retiled.export_prime().map_err(|e| anyhow::anyhow!("export: {e:?}"))?;

Structs§

Processor
A video post-processor on one device.

Functions§

probe
Checks that display’s driver offers video post-processing, which is what Processor::with_display needs of a render node.