DRM Implementation Overview

Linux Drivers

Release Date
2023-07-22
  • Primary: this serves as the mode-setting layer and determines the background screen image
  • Overlay: a layer designed to be superimposed over the primary layer. It can be a streaming or memory interface
  • Cursor: a special layer designed to represent a screen pointer or equivalent

By default, the Mixer’s various layers will be mapped to the above DRM Plane roles as follows:

Mixer IP Layer DRM Plane Type
Output stream layer Primary
Layer 1-8 (2018.1/2018.3)

Overlay

Layer 1-16(2019.1) Overlay
Logo Cursor

The default assignment of the layer serving as DRM Primary can be overridden in the device tree with the optional property xlnx,layer-primary. This property can be used to assign the role of “primary” to any one of the Mixer layers(except logo) present in the design. Other hardware layers will be assigned the role of “overlay” layer.

As an overlay plane, the output stream layer will only respond to video format changes; its size will always correspond to the current size of the assigned primary layer. There are several cases wherein assignment of the primary layer to a mixer overlay layer might be advantageous:

  • Your mixer instance is configured to stream out YUV 4:2:2 but you wish to present user space drivers with an ARGB memory interface. You could configure the Mixer with an overlay layer that accepts ARGB memory formatted data and assign this as the DRM primary layer. User space is able to write ARGB and conduct normal mode setting/resolution changes through this layer yet the final output, via the Mixer, will be transformed into YUV 4:2:2.
  • Your use case is such that using overlays superimposed over a background primary plane does not work. Instead, you wish the background layer to be the top layer( in z-order position and utilize per-pixel alpha values to create open regions in the background through which content can be framed underneath. This might be done in the case where the primary plane is used to render video/audio controls and the video is displayed beneath this superimposed gui background. By assigning the primary plane to be the uppermost layer, the remaining layers can be used, effectively, as underlays.

From within Vivado, Mixer layers can be configured with the following optional properties:

  • layer alpha
  • layer scaling (1x, 2x or 4x)

These properties, if described in the device tree, will be represented as DRM plane properties. To understand more about these capabilities, please refer to the Video Mixer Product Guide [PG243]. Additionally, the Video Mixer supports generation of solid background color when either the AXI streaming input is not connected or the layer is otherwise disabled. On initialization, this color is programmed to default to blue. The color may be configured using a value representing packed RGB little-endian format via the DRM plane property bg_color. This property is attached to the primary plane.