Skip to content

VC4 display compositing

Eric Anholt edited this page Dec 27, 2018 · 7 revisions

VC4's HVS is a very flexible display engine, supporting effectively arbitrary numbers of planes on the screen, limited only by display bandwidth, HVS clock rate, and scratch memory space.


The following formats are supported (including RGB vs BGR reordering):

  • RGB and RGBA 8888
  • RGB and RGBA 5551
  • RGB 565
  • YUV/YVU 3-plane BT601 422/420 (DRM_FORMAT_YUV*)
  • YUV/YVU 2-plane BT601 422/420 (DRM_FORMAT_NV*)

Planes may be linear (aka raster), T-format (V3D tiling) or SAND (media encode/decode tiling).


Planes are composited in order, so higher-numbered planes are on top. Planes with alpha are treated as premultiplied. A separate fixed alpha value may be attached to a plane to blend without adjusting per-pixel alpha. No clipping is performed, so setting the src_w/src_h on them when they are partially occluded by opaque planes will reduce memory bandwidth. Planes may be flipped in the X or Y direction, but rotation is not supported.

Plane stride must be <65535 bytes.


H/V scaling is supported. Scaling down uses a trapezoidal filter, while scaling up uses the Mitchell/Netravali B=1/3, C=1/3 filter. There may be room for improvement in filter choice at various sizes. Panning within linear planes is also supported.

CTM support

One of the display outputs may have the HVS's OLED coefficients applied to it. This is exposed using the DRM CTM interface, which applies a colorspace conversion matrix after gamma ramps.

Plane count

Currently 8 planes are supported, though the number is arbitrary. As we increase plane count, we may run into bandwidth limits in the hardware, which are not currently accounted for in atomic_check().


The TXP block is exposed as a writeback connector. This allows userspace to use the HVS compositor to render a scene to memory when it's too complex to scan out and hits memory bandwidth or cycle limits. There is no automatic support for scanning out from writeback when the limits are hit.

Unimplemented features

  • 323, 4444, paletted, and YUV444 input formats
  • rgb_trans (colormasking) mode
  • separate alpha_mask plane
  • configurable rgba 8-bit expansion function
  • HVS (whole unit, scaler, or gamma) power management
  • FIFO priority management
  • FIFO watermark management
  • dynamic FIFO mux management
  • non-premultiplied alpha blending
  • HVS DMA FIFO output (Not useful for SPI, do we have any other usecase?)
  • Chroma vertical replication mode
  • Custom plane CSC (not just BT601)
  • HVS bandwidth and clock rate limit estimates (WIP by Boris)
  • underflow warnings to dmesg (WIP by Boris)
  • chroma subsampling position control
  • dithering
  • display test modes
  • background colors other than black
You can’t perform that action at this time.