Table of Contents
The purpose of this page is to describe the Linux V4L2 driver for Xilinx Gamma Correction LUT soft IP.
To understand more details about this IP and its functionality please see the Product Guide (below).
The Xilinx V4L2 Gamma LUT driver (xilinx-gamma.c) is based on the V4L2 framework and creates a subdev node(/dev/v4l-subdev*)
which can be used to configure the the Look Up Table (LUT) for Red, Green and Blue gamma correction components.
The LUT is applied to the incoming video stream by the Gamma Correction LUT soft IP.
The Gamma Correction LUT soft IP provides a way to apply correction to each Red, Green and Blue components.
|IP Features||2018.1 and on wards|
|Programmable gamma table supports gamma correction or any user defined function||Yes*|
|Three channel independent look-up table structure||Yes*|
|One, two, four or eight pixel-wide AXI4-Stream video interface||Yes|
|8 and 10 bits per component support||Yes**|
|Supports spatial resolutions from 64 x 64 up to 8192 x 4320||Yes***|
|Supports 4K60 in all supported device families||NA|
*Pre-computed coefficients table used.
**Media bus format supported is MEDIA_BUS_FMT_RBG888_1X24 for both 8 and 10bpc
***Tested for 8192x4320, 3840x2160, 1920x1080, 1280x720
CONFIG_VIDEO_XILINX_GAMMA and CONFIG_VIDEO_XILINX should be enabled.
Device Tree Binding
The device tree node should be defined with correct hardware configuration. How to define the node is documented here:
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)
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.
We need a ZCU102 Rev 1.0 board. Enable TPG, Demosaic, Gamma LUT and Framebuffer Write in kernel defconfig.
Modify the demosaic driver as below as TPG output is RGB type and Demosaic requires SRGGB type.
- Setup the TPG to generate a pattern.
- Setup the Gamma brightness as shown above.
- Now capture image using yavta
View the captured image using a viewer like yuvplayer.exe
Driver has been tested on following boards:
- AR68768 - LogiCORE Gamma LUT - Release Notes and Known Issues for the Vivado 2017.3 tool and later versions
- Make max-width and max-height mandatory dt properties
- Added xlnx,max-width and xlnx,max-height dt properties
- Added checks to set the correct default, min and max width and height from dt properties
- da376b3 v4l: xilinx-gamma: Add check for max width and height
- 032026f v4l: xilinx-gamma: Correct default values when max width, height dt property absent
- Added 10-bit support and kernel documentation
- Fixed debug mode compile error
- 1d34b87 v4l: xilinx-gamma: Fix compile error in debug mode
- ada9c6a v4l: xilinx-gamma: Add kernel-doc for xgamma_dev struct
- ae6e1f0 v4l: xilinx-gamma: Add 10-bit IP support for Video Gammma IP.
- Initial revision added to master branch