Xilinx V4L2 VPSS CSC driver
Table of Contents
Introduction
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.
- 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
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
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 50. control 0x0098c9a2 `CSC Contrast' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a3 `CSC Red Gain' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a4 `CSC Green Gain' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a5 `CSC Blue Gain' min 0 max 100 step 1 default 50 current 50. 5 controls found. root@plnx_aarch64:~# 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 Contrast' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a3 `CSC Red Gain' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a4 `CSC Green Gain' min 0 max 100 step 1 default 50 current 50. control 0x0098c9a5 `CSC Blue Gain' min 0 max 100 step 1 default 50 current 50. 5 controls found.
IP/Driver Features
IP features | 2018.1 to 2018.3 | 2019.1 |
---|---|---|
One, two or four pixel-wide AXI4-Stream video interface | Yes | |
Video resolution support up to UHD at 60 fps | Yes | |
Run-time color space support for RGB, YUV 4:4:4, YUV 4:2:2, YUV 4:2:0 | Yes | |
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
- Does not support this driver in VPSS IPs full fledged mode.
- *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.
- 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
- 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-utilsmedia-ctl allows you to print the topology of your media pipeline and specify input and output pad properties.
Successful Frame Captures
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.
/* Use yavta to setup the color bar pattern */ #Set up the TPG output color format to RGB888 media-ctl -v -V '"a3c30000.tpg":0 [fmt:RBG888_1X24/1280x720 field:none]' #Set up the Color Space convertor output to YUV 422 media-ctl -v -V '"a3c40000.csc":1 [fmt:UYVY8_1X16/1280x720 field:none]' #Start capture yavta -n3 -c15 -f YUYV -s1280x720 --skip 14 -F /dev/video0
View the captured files in some viewer like yuvplayer.exe.
Boards Supported
- 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
2024.1
- No changes
2023.2
- No changes
2023.1
- No changes
2022.2
- No changes
2022.1
- No changes
2021.2
- Summary
- Update the SPDX license header
- Preserve the control values on setting format
- Commits
v4l: xilinx: vpss-csc: Update SPDX license header
2021.1
- No changes
2020.2
- Summary
- Fix Coverity warnings
- Commits
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
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
© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy