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.

Overview

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.

Linux Kernel Location

The driver is currently located in a special early access branch of the standard Xilinx Linux kernel. See drivers/media/platform/xilinx/xilinx-vpss-csc.c

Linux Kernel defconfig

CONFIG_VIDEO_XILINX_VPSS_CSC and CONFIG_VIDEO_XILINX should be enabled.
VPSS_CSC_Kconfig.jpg

Device Tree Binding

The dts node should be defined with correct hardware configuration. How to define the node is documented here:
Documentation/devicetree/bindings/media/xilinx/xlnx,v-vpss-csc.txt
(This path is relative to your linux kernel source root directory)

Limitations

  • Demo Window is not supported
  • 12 and 16 color depth width is not supported by this driver. Maximum color depth supported by the VPSS CSC soft IP driver is limited to 8-bit and 10-bit in this release
  • Saturation Control is not supported

Supported Features

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.
  • Saturation control is still experimental (it may not be fully functional)
  • The CSC IP will look like the following when displayed through media-ctl :
    • - entity 7: a0040000.csc (2 pads, 2 links)
      type V4L2 subdev subtype Unknown flags 0
      device node name /dev/v4l-subdev1
      pad0: Sink
      [fmt:RBG24/1280x720 field:none]
      <- "a0050000.gamma":1 [ENABLED]
      pad1: Source
      [fmt:RBG24/1280x720 field:none]
      -> "a0000000.scalar":0 [ENABLED]
  • Yavta can be used to modify the control supported by the V4L2 VPSS CSC Driver:
    • # yavta --no-query -l /dev/v4l-subdev1
      Device /dev/v4l-subdev1 opened.
      --- User Controls (class 0x00980001) ---
      control 0x0098c9a1 `CSC Brightness' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a2 `CSC Saturation' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a3 `CSC Contrast' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a4 `CSC Red Gain' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a5 `CSC Green Gain' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a6 `CSC Blue Gain' min 0 max 100 step 1 default 50 current 50.
      6 controls found.

    • # yavta --no-query -w '0x0098c9a1 80' /dev/v4l-subdev1
      Device /dev/v4l-subdev1 opened.
      Control 0x0098c9a1 set to 80, is 80
      root@plnx_aarch64:~# yavta --no-query -l /dev/v4l-subdev1
      Device /dev/v4l-subdev1 opened.
      --- User Controls (class 0x00980001) ---
      control 0x0098c9a1 `CSC Brightness' min 0 max 100 step 1 default 50 current 80.
      control 0x0098c9a2 `CSC Saturation' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a3 `CSC Contrast' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a4 `CSC Red Gain' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a5 `CSC Green Gain' min 0 max 100 step 1 default 50 current 50.
      control 0x0098c9a6 `CSC Blue Gain' min 0 max 100 step 1 default 50 current 50.
      6 controls found.


Vivado IP Configuration

The following snapshots show the Vivado GUI configuration that is supported. All other configurations are not supported.
To get the driver supported version of the IP :
  1. Pick the CSC Only functionality
  2. Enable Color Space Conversion. Pick RGB | YUV 4:4:4 | YUV 4:2:2 | YUV 4:2:0
CSC_Vivado_2017.3.jpg

3. Do not enable Demo Window
vpss-csc-color-matrix.jpg

Boards Supported

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

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.

Technical Reference Designs

reVision Getting Started

Future Improvements

  • Support to program custom coefficients into the 3x4 Matrix as supplied by the user.

Related Links