This page gives an overview of the Linux DRM based Video Mixer driver . Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.
IP Feature | 2018.1/2018.3 | 2019.1/2019.2 | 2020.1 |
---|---|---|---|
Output Stream | RGB/YUV444/YUV422/YUV420 | ||
Samples per Clock | 1, 2 and 4 | ||
Maximum Data Width | 8, 10 | ||
Maximum Number of Columns | 4096 | 8192 | |
Maximum Number of Rows | 2160 | 4320 | |
Number of Layers | 8 | 16 | |
Layer Video Formats | RGB8, RGBX8, YUYV8, RGBA8, BGRA8, Y_UV8, Y_UV8_420, YUV8, YUVX8, Y8, UYVY8, BGRX8, RGBX10, YUVX10, RGB565, Y_UV10, Y_UV10_420, Y10 | ||
Layer Alpha | Yes | ||
Layer Scaling | Yes | ||
Layer Interface | Memory, Streaming | ||
Logo Layer | Yes | ||
Logo Layer per Pixel Alpha | Yes | ||
IP Revision | 3.0 | 4.0 | 5.0 |
CONFIG_DRM_XLNX_MIXER should be enabled. This depends on CONFIG_DRM_XLNX and CONFIG_DRM
Location: → Device Drivers → Graphics support → Xilinx DRM KMS Driver
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:
From within Vivado, Mixer layers can be configured with the following optional properties:
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.
IP version 5.0, provides option to enable CSC coefficient registers to be applied on primary layer.
Driver adds the COLOR_ENCODING and COLOR_RANGE properties to support BT601/709/2020 color encoding schemes with limited and full range.
driver by default configures to BT709 with Limited range.
For more details about DRM framework supported encoding schemes, please refer drm_color_mgmt.h
To verify the proper configuration and operation of the IP, a suitable hardware design will need to include at a minimum:
Modetest is a test tool which can be found as part of the libdrm suite of test tools. We will use this tool to ensure proper configuration and operation of the Mixer IP. Modetest can be used to activate overlay layers and alter layer properties (e.g. layer alpha, layer scaling, background color) & coefficient register programming for csc by passing color encoding and range properties. Following table captures the property values of encoding and range .
COLOR_ENCODING | Value | COLOR_RANGE | Value |
---|---|---|---|
DRM_COLOR_YCBCBR_BT601 | 0 | DRM_COLOR_YCBCR_LIMITED_RANGE | 0 |
DRM_COLOR_YCBCR_BT709 | 1 | DRM_COLOR_YCBCR_FULL_RANGE | 1 |
DRM_COLOR_YCBCR_BT2020 | 2 |
root@mixer_proj:~# modetest -M xlnx |
Below is a Sample output of 2019.1 SDI-Tx with 10bpc as the encoder (edited for brevity and clarity):
root@zcu106-zynqmp:~# modetest -M xlnx Encoders: id crtc type possible crtcs possible clones 48 0 TMDS 0x00000001 0x00000000 Connectors: id encoder status name size (mm) modes encoders 49 0 connected unknown-1 0x0 49 48 modes: name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot) 4096x2160 60 4096 4184 4272 4400 2160 2168 2178 2250 593408 flags: phsync, pvsync; type: driver 4096x2160 50 4096 5064 5152 5280 2160 2168 2178 2250 594000 flags: phsync, pvsync; type: driver <snip> 1280x720 24 1280 2250 3155 4125 720 725 730 750 74250 flags: phsync, pvsync; type: driver 720x576i 50 720 732 795 864 288 290 293 312 13500 flags: phsync, pvsync, interlace, dblclk; type: driver 720x486i 60 720 739 801 858 243 247 250 262 13500 flags: phsync, pvsync, interlace, dblclk; type: driver props: 1 EDID: flags: immutable blob blobs: value: 2 DPMS: flags: enum enums: On=0 Standby=1 Suspend=2 Off=3 value: 3 5 link-status: flags: enum enums: Good=0 Bad=1 value: 0 <snip> 51 sdi_mode: flags: range values: 0 5 value: 2 52 sdi_data_stream: flags: range values: 2 8 value: 4 CRTCs: id fb pos size 47 0 (0,0) (0x0) 0 0 0 0 0 0 0 0 0 0 flags: ; type: props: Planes: id crtc fb CRTC x,y x,y gamma size possible crtcs 29 0 0 0,0 0,0 0 0x00000001 formats: RA24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 2 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 30 0 0 0,0 0,0 0 0x00000001 formats: YUYV props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 31 0 0 0,0 0,0 0 0x00000001 formats: XV15 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 32 0 0 0,0 0,0 0 0x00000001 formats: AB24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 33 0 0 0,0 0,0 0 0x00000001 formats: BG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 34 0 0 0,0 0,0 0 0x00000001 formats: XB24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 35 0 0 0,0 0,0 0 0x00000001 formats: NV12 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 36 0 0 0,0 0,0 0 0x00000001 formats: XV20 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 37 0 0 0,0 0,0 0 0x00000001 formats: BG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 27 scale: flags: range values: 0 2 value: 0 28 alpha: flags: range values: 0 256 value: 256 38 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 39 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 40 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 41 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 42 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 43 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 44 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 45 0 0 0,0 0,0 0 0x00000001 formats: RG24 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 28 alpha: flags: range values: 0 256 value: 256 46 0 0 0,0 0,0 0 0x00000001 formats: XV20 props: 6 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 1 Frame buffers: id size pitch |
root@mixer_proj:~# modetest -M xlnx -P 33@47:640x480+0+0@BG24 |
testing 640x480@BG24 overlay plane 33 |
root@mixer_proj:~# modetest -M xlnx -w 33:scale:1 |
33 0 0 0,0 0,0 0 0x00000001 formats: BG24 props: 5 type: flags: immutable enum enums: Overlay=0 Primary=1 Cursor=2 value: 0 23 scale: flags: range values: 0 2 value: 0 24 alpha: flags: range values: 0 256 value: 256 |
root@mixer_proj:~# modetest -M xlnx -w 33:alpha:0 |
root@mixer_proj:~# modetest -M xlnx -w 33:alpha:256 |
root@mixer_proj:~# modetest -M xlnx -w 34:bg_color:255 |
Test 6 - Change the output resolution
To change Mixer output to a new resolution, modetest must be invoked with the connector id and new resolution. In this example, we change to output 1920x1080:root@mixer_proj:~# modetest -M xlnx -s 49:1920x1080@BG24 |
setting mode 1920x1080-60Hz@BG24 on connectors 49, crtc 47 |
vbltest is a test tool which is part of the libdrm suite of test tools. It is used to ensure vertical blanking interrupts are properly sent by the DRM driver.
root@mixer_proj:~# vbltest -M xlnx starting count: 0 freq: 60.49Hz freq: 60.00Hz freq: 60.00Hz freq: 60.00Hz |