ZynqMP DisplayPort Linux driver

Introduction

This page gives an overview of the DisplayPort driver which is available as part of the ZynqMP Linux distribution. The main driver is based on the Linux DRM KMS display subsystem. Some additional drivers are based on other subsystem: DMA engine driver for DPDMA and ALSA driver for audio support.
Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.

HW IP features

Features in bold are supported by the driver
  • Based on the VESA DisplayPort V.12a source-only specification.
  • Video support for the following:
    ° Resolution up to 4K x 2K at 30Fps.
    ° Y-only, YCbCr444, YCbCr422, YCbCr420, and RGB video formats.
    ° 6, 8, 10, or 12 bits per color components.
    ° Progressive video.
    ° A 36-bit native video input interface to capture live video.
    ° Non-live video from frame buffers using internal DPDMA.
  • Graphics support for the following:
    ° Non-live graphics from the frame buffer.
    ° 36-bit native video interface along with an 8-bit alpha channel to capture live graphics.
    ° 2-plane, on-the-fly rendering of video and graphics.
    ° Chroma upsampling.
    ° Chroma downsampling.
    ° Color space conversion from YCbCr to RGB and vice versa.
    ° Video blending.
    ° Chroma keying.
  • Audio support for the following:
    ° Up to two audio channels.
    ° Sample size of up to 24 bits.
    ° Maximum sample rate of 48 KHz.
    ° Live 24-bit audio from the PL.
    ° Non-live 16-bit audio from the frame buffer.
  • Audio mixer and volume control.
    ° Mixing of two audio streams of the same sampling rate and channel count.
    ° Provides gain control for audio streams.
  • Streaming A/V output back to the PL.
  • Includes a system time clock (STC) that is compliant with the ISO/IEC 13818-1 standard. Provides time stamping of the A/V presentation unit.

Missing Features, Known Issues and Limitations

Missing Features

This section summarizes the known issues and missing features
  • .Live support hasn't been implemented
    • Input from / out to PL
  • 10 bit YUV formats are not supported
    • Upstreaming on going
  • Interop

Limitation

  • Both layers (drm planes) should be in the same size. Otherwise, if the requested size is different, the driver returns an error.

Important AR links


Note

The driver implementation has switched to the new driver in 2018.1.

Kernel Configuration


The dedicated DMA engine for DisplayPort should be enabled.
CONFIG_XILINX_DPDMA=y
The following config options are optional and required for audio support.
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SOC_XILINX_DP=y
The driver, as some other multimedia drivers, needs CMA chunk. The following config options are recommended.
CONFIG_CMA=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=256

The below is for new driver (>= 2018.1)
The following config options should be enabled in order to build the DisplayPort driver
CONFIG_DRM_XLNX=y
CONFIG_DRM_XLNX_BRIDGE=y
CONFIG_DRM_XLNX_BRIDGE_DEBUG_FS=y
CONFIG_DRM_ZYNQMP_DPSUB=y

The below is for old driver (< 2018.1)
The following config options should be enabled in order to build the DisplayPort driver
CONFIG_DRM=y
CONFIG_DRM_XILINX=y
CONFIG_DRM_XILINX_DP=y
CONFIG_DRM_XILINX_DP_SUB=y

Devicetree

The below is for new driver (>= 2018.1)
The snippet:
- zynqmp-display: zynqmp-display
The dt binding doc: Documentation/devicetree/bindings/display/xlnx/xlnx,zynqmp-dpsub.txt
- xlnx,zynqmp-dpsub.txt

The below is for old driver (< 2018.1)
Device tree nodes required are as below in "arch/arm64/boot/dts/xilinx/zynqmp.dtsi"
- Xilinx drm: xilinx drm node
- dp: dp
- dp subsystem: dp_sub
- dpdma: dpdma
For audio support
- alsa nodes: card, codec, pcm

For more details, Please refer to "Documentation/devicetree/bindings/drm/xilinx"
- dp.txt
- dp_sub.txt
- xilinx_drm.txt

Applications

This section describes the example commands in drm or Xorg environment.

DRM

modetest is the test application available from libdrm: https://cgit.freedesktop.org/mesa/drm/tree/tests/modetest.

The below is the help from the application. Please note, some arguments / commands changes.
root@xilinx-zcu106-zu7-es2-2018_1:~# modetest --help
usage: modetest [-cDdefMPpsCvw]
 
 Query options:
 
        -c      list connectors
        -e      list encoders
        -f      list framebuffers
        -p      list CRTCs and planes (pipes)
 
 Test options:
 
        -P <plane_id>@<crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>]  set a plane
        -s <connector_id>[,<connector_id>][@<crtc_id>]:<mode>[-<vrefresh>][@<format>]   set a mode
        -C      test hw cursor
        -v      test vsynced page flipping
        -w <obj_id>:<prop_name>:<value> set property
 
 Generic options:
 
        -d      drop master after mode set
        -M module       use the given driver
        -D device       use the given device
 
        Default is to dump all info.
 

Running the modetest with driver id string lists available modes / properties from the connected monitor. Please note the IDs are not fixed and changes due to framework updates or so.
  • Available modes under connector@38
  • Current framebuffer set to crtc@36
  • Available planes (layers): plane@34 and plane@35
  • List of supported formats for each plane
  • Alpha properties of plane@35

Please note, the driver name has been changed to xlnx for release >= 2018.1. For release <= 2017.4, the ID is 'xilinx_drm'.

root@xilinx-zcu106-zu7-es2-2018_1:~# modetest -M xlnx
Encoders:
id      crtc    type    possible crtcs  possible clones
37      36      TMDS    0x00000001      0x00000000
 
Connectors:
id      encoder status          name            size (mm)       modes   encoders
38      37      connected       DP-1            530x300         29      37
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  3840x2160 30 3840 3888 3920 4000 2160 2163 2168 2191 262750 flags: phsync, nvsync; type: driver
  2560x1440 60 2560 2608 2640 2720 1440 1443 1448 1481 241500 flags: phsync, nvsync; type: driver
  2048x1280 60 2048 2192 2416 2784 1280 1281 1284 1325 221277 flags: nhsync, pvsync; type:
  1920x1200 60 1920 2056 2256 2592 1200 1203 1209 1245 193250 flags: nhsync, pvsync; type: driver
  1920x1080 60 1920 2008 2052 2200 1080 1082 1087 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  1920x1080 50 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1920x1080 24 1920 2558 2602 2750 1080 1084 1089 1125 74250 flags: phsync, pvsync; type: driver
  1920x1080 24 1920 2558 2602 2750 1080 1084 1089 1125 74176 flags: phsync, pvsync; type: driver
  1600x1200 60 1600 1664 1856 2160 1200 1201 1204 1250 162000 flags: phsync, pvsync; type: driver
  1600x900 60 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  1280x1024 75 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  1152x864 75 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  1280x720 50 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1024x768 75 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  1024x768 60 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  800x600 75 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  800x600 60 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  720x576 50 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  640x480 75 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  720x400 70 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:
 
                value:
                        00ffffffffffff0010acbea04c433930
                        171a0104a5351e783ae245a8554da326
                        0b5054a54b00714f8180a9c0a940d1c0
                        e100d10001014dd000a0f0703e803e30
                        35000f282100001a000000ff00473344
                        37463636313039434c0a000000fc0044
                        454c4c205032343135510a20000000fd
                        001d4c1e8c36000a2020202020200135
                        02031df150101f200514041312110302
                        161507060123091f0783010000565e00
                        a0a0a02950302035000f282100001a02
                        3a801871382d40582c25000f28210000
                        1e011d007251d01e206e2855000f2821
                        00001ea36600a0f0701f80302035000f
                        282100001a0000000000000000000000
                        000000000000000000000000000000eb
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        39 sync:
                flags: range
                values: 0 1
                value: 0
        40 bpc:
                flags: enum
                enums: 6BPC=6 8BPC=8 10BPC=10 12BPC=12
                value: 8
 
CRTCs:
id      fb      pos     size
36      64      (0,0)   (3840x2160)
  3840x2160 30 3840 3888 3920 4000 2160 2163 2168 2191 262750 flags: phsync, nvsync; type: driver
  props:
        29 output_color:
                flags: enum
                enums: rgb=0 ycrcb444=1 ycrcb422=2 yonly=3
                value: 0
        30 bg_c0:
                flags: range
                values: 0 4095
                value: 0
        31 bg_c1:
                flags: range
                values: 0 4095
                value: 0
        32 bg_c2:
                flags: range
                values: 0 4095
                value: 0
 
Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
34      0       0       0,0             0,0     0               0x00000001
  formats: VYUY UYVY YUYV YVYU YU16 YV16 YU24 YV24 NV16 NV61 BG24 RG24 XB24 XR24 XB30 XR30 YU12 YV12 NV12 NV21 XV15 XV20
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        33 tpg:
                flags: range
                values: 0 1
                value: 0
35      36      64      0,0             0,0     0               0x00000001
  formats: AB24 AR24 RA24 BA24 BG24 RG24 RA15 BA15 RA12 BA12 RG16 BG16
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        27 alpha:
                flags: range
                values: 0 255
                value: 255
        28 g_alpha_en:
                flags: range
                values: 0 1
                value: 1
 
Frame buffers:
id      size    pitch

To set the test pattern on the crtc, 'RG16' can be replaced with any other format from primary plane (plane@35).
root@xilinx-zcu106-zu7-es2-2018_1:~# modetest -M xlnx -s 38:1920x1080@RG16
setting mode 1920x1080-60Hz@RG16 on connectors 38, crtc 36
To enable the overlay plane, use '-P' with arguments below. 'YUYV' can be replaced with any other format from overlay plane (plane@34).
root@xilinx-zcu106-zu7-es2-2018_1:~# modetest -M xlnx -s 38:1920x1080@RG16 -P 34@36:1920x1080@YUYV
setting mode 1920x1080-60Hz@RG16 on connectors 38, crtc 36
testing 1920x1080@YUYV overlay plane 34
plane@34 wouldn't be visible as plane@35 is always on top. Set the alpha property using '-w'.
root@xilinx-zcu106-zu7-es2-2018_1:~# modetest -M xlnx -s 38:1920x1080@RG16 -P 34@36:1920x1080@YUYV -w 35:alpha:100
setting mode 1920x1080-60Hz@RG16 on connectors 38, crtc 36
testing 1920x1080@YUYV overlay plane 34
The modetest also demonstrates the page flipping with '-v' option. The command flips two buffers and prints the framerate.
root@xilinx-zcu106-zu7-es2-2018_1:~# modetest -M xlnx -s 38:1920x1080@RG16 -P 34@36:1920x1080@YUYV -w 35:alpha:100 -v
setting mode 1920x1080-60Hz@RG16 on connectors 38, crtc 36
testing 1920x1080@YUYV overlay plane 34
freq: 60.10Hz
freq: 59.99Hz

ALSA

The "aplay" is an ALSA (Linux audio/sound subsystem) example and demonstrates the audio play. The command sends audio data on specific pcm channel which is audible at DPout.
aplay test.wav -d 30 -D hw:0,0 ,For PCM0
aplay test.was -d 30 -D hw:0,1 ,For PCM1
 

Xorg

Xorg automatically launches at boot up. If needed to run manually,
Xorg&
Xorg clients look for the env variable to find corresponding server. Thus export before running clients from serial console.
export DISPLAY=:0.0
Run window manager and desktop session (matchbox example).
matchbox-window-manager&
matchbox-session&
'xrandr' is to display and change the resolutions.
root@plnx_aarch64:~# xrandr
Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 4096 x 4096
DP-1 connected 3840x2160+0+0 953mm x 543mm
   3840x2160     29.98*
   2560x1600     59.97
   1920x1080     60.00    50.00    59.94
   1680x1050     59.95
   1280x1024     75.02    60.02
   1440x900      74.98    59.89
   1280x960      60.00
   1366x768      59.79
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
root@plnx_aarch64:~# xrandr -s 1920x1080
root@plnx_aarch64:~# xrandr -s 640x480
 
'xset' changes some setting. Change of power states can be done as below.
root@plnx_aarch64:~# xset dpms force off
root@plnx_aarch64:~# xset dpms force on

Related Links