Xilinx V4L2 VPSS CSC driver

Table of Contents

Introduction

The purpose of this page is to describe the Linux V4L2 driver for Xilinx VPSS Color Space Converter (CSC) soft IP. VPSS refers to the Video Processing Sub System.
This driver is for the CSC only mode of operation in the VPSS, please see the Product Guide for more details on its functionality and features.
The Linux VPSS CSC driver (xilinx-vpss-csc.c) based on the V4L2 framework creates a subdev node(/dev/v4l-subdev*) which can be used to configure the VPSS CSC IP core. The VPSS CSC supports changing video properties through V4L Controls like Brightness, Contrast, Red Gain, Blue Gain and Green Gain. The driver is available at https://github.com/Xilinx/linux-xlnx/blob/master/drivers/media/platform/xilinx/xilinx-vpss-csc.c
The VPSS CSC driver supports only the following features are supported including:
  • Ability apply controls Brightness and Contrast.
  • Ability to apply controls Red, Green and Blue gains.
  • The CSC IP will look like the following when displayed through media-ctl

  • yavta can be used to modify the control supported by the V4L2 VPSS CSC Driver

IP/Driver Features


IP features2018.1 to 2018.32019.1
One, two or four pixel-wide AXI4-Stream video interfaceYes
Video resolution support up to UHD at 60 fpsYes
Run-time color space support for RGB, YUV 4:4:4, YUV 4:2:2, YUV 4:2:0Yes
8, 10, 12, and 16 bits per component support

Driver supports only 8 and 10 bpc formats

using only 8 bpc MEDIA BUS formats.

Yes* Driver supports only 8 and 10 bpc formats

using 8 and 10 bpc media bus formats


Missing Features / Known Issues / Limitations in Driver


  • Works with fixed Vivado IP configuration as highlighted.
  • Demo Window is not supported

  • *Maximum color depth supported by the VPSS CSC soft IP driver is limited to 8 and 10 bpc.
  • *12 and 16 bpc color depth width is not supported.
  • Saturation Control is not supported
  • Pre-computed color conversion coefficient matrix used.
    • In future user supplied custom coefficients support may be added.

Video Processing Subsystem Release Notes and Known Issues

Kernel Configuration

CONFIG_VIDEO_XILINX_VPSS_CSC and CONFIG_VIDEO_XILINX should be enabled.

Device tree binding

The dts node should be defined with correct hardware configuration. How to define the node is documented here:
https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/devicetree/bindings/media/xilinx/xlnx%2Cv-vpss-csc.txt

Testing Procedure

This driver is a V4L2 sub-device driver, which means it is designed to operate with a video device in it's graph. The driver has been tested with a Xilinx video device (a V4L2 capture device) that is backed by a DMA element (like Framebuffer Write IP). The V4L2 device driver for this IP cannot be tested in isolation by itself. The successful operation of the driver can be tested in two phases :
  • Successful Creation of a Media Device
  • Successful Frame Captures (or writing of buffers by the Frame-buffer Write IP)

Successful Creation of a Media Device

media-ctl is a Linux user space utility that can control media entities, it is a part of a larger set of V4L2 tools called v4l-utils
media-ctl allows you to print the topology of your media pipeline and specify input and output pad properties.

Successful Frame Captures

Please see the Test Approach section of the Frame Buffer Write Wiki for more details on how to capture frames.
The Red / Green / Blue gain values can be changed as shown in the Overview section and the captured images can be compared.
Test design

We need a ZCU102 Rev 1.0 board.  Enable TPG, VPSS CSC and Framebuffer Write in kernel defconfig.

The color format set in the TPG is what will propagate to CSC sink pad.

The color format set in the CSC source pad and the one set on video node (Framebuffer Write) in yavta should match.

The device tree also needs to be update. If we are using a 8 bit design then TPG output video-width, VPSS CSC input and output ports video-width should all be 8. 

For 10bpc design, the video-width is 10. The video-format for the TPG output port and VPSS CSC input port should match.


View the captured files in some viewer like yuvplayer.exe.

Boards Supported

Driver has been tested on following boards:
  • ZCU102 Rev 1.0

Known Issues

  • AR65449 - LogiCORE IP Video Processing Subsystem(VPSS) - Release Notes and Known Issues for the Vivado 2015.3 tool and later versions

Change log

2020.2

2020.1

  • Summary
    • No changes

2019.2

  • Summary
    • Add support for missing RGB 10bpc media bus format
  • Commits
    • 2764687 v4l: xilinx: vpss-csc: Fix xcsc_set_format() for RBG 10 bpc

2019.1

  • Summary
    • Use 10 bit media codes
    • Make max-width and max-height as mandatory dt properties
  • Commits
    • 1ecec44 v4l: xilinx: vpss-csc: Use 10bit media bus codes

    • 7bc760b v4l: xilinx-vpss-csc: Make max width and height mandatory properties

2018.3

  • Summary
    • Add check for max width and height from dt
  • Commits
    • dddf225 v4l: xilinx-vpss-csc: Add check for max width and height

2018.2

  • Summary
    • No changes

2018.1

  • Summary
    • Support for any to any color space conversion
  • Commits
    • 3592a90 v4l: xilinx-vpss-csc: Support for any-to-any color space converison

2017.4

  • Summary
    • No changes

2017.3

  • Summary
    • Initial driver version added
  • Commits
    • 1437167 v4l: xilinx-vpss-csc: Any-to-any color space conversion
    • 2c171c6 v4l: xilinx-vpss-csc: driver support for xilinx vpss csc