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).

Overview

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.

Linux Kernel Location

The driver is currently located in a special early access branch of the Xilinx Linux kernel. See drivers/media/platform/xilinx/xilinx-gamma.c for the source code.

Linux Kernel defconfig

CONFIG_VIDEO_XILINX_GAMMA and CONFIG_VIDEO_XILINX should be enabled.

Gamma_Kconfig.jpg

Device tree binding

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

Supporting features

The following table compares the IP features against those supported by the V4L2 driver
Gamma LUT (v 1.0) IP Features
Gamma LUT V4L2 Driver Support
8-bit color depth
2017.1 Early Access
10-bit color depth
2017.3 Early Access


The Gamma Correction LUT soft IP provides a way to apply correction to each Red, Green and Blue components.
  • Exposes a V4L2 control to program Red, Green and Blue gamma values.
    • A gamma of 0.1 is achieved by setting a value of 1 (minumum)
    • A gamma of 1.0 is achieved by setting a value of 10 (default)
    • A gamma of 4.0 is achieved by setting a value of 40 (maximum)
  • Media-ctl will show an entry as follows that represents the Gamma LUT V4L2 sub-device. :
    • - entity 16: a0050000.gamma (2 pads, 2 links)
      type V4L2 subdev subtype Unknown flags 0
      device node name /dev/v4l-subdev4
      pad0: Sink
      [fmt:RBG24/1280x720 field:none]
      <- "a0060000.demosaic":1 [ENABLED]
      pad1: Source
      [fmt:RBG24/1280x720 field:none]
      -> "a0040000.csc":0 [ENABLED]
  • Yavta can display the three controls as follows :
    • # yavta --no-query -l /dev/v4l-subdev4
      Device /dev/v4l-subdev4 opened.
      --- User Controls (class 0x00980001) ---
      control 0x0098c9c1 `Red Gamma Correction(1 = 0.1 & ' min 1 max 40 step 1 default 10 current 10.
      control 0x0098c9c2 `Blue Gamma Correction(1 = 0.1 &' min 1 max 40 step 1 default 10 current 10.
      control 0x0098c9c3 `Green Gamma Correction(1 = 0.1 ' min 1 max 40 step 1 default 10 current 10.
    • # yavta --no-query -w '0x0098c9c1 40' /dev/v4l-subdev4
      Device /dev/v4l-subdev4 opened.
      Control 0x0098c9c1 set to 40, is 40
      # yavta --no-query -w '0x0098c9c2 40' /dev/v4l-subdev4
      Device /dev/v4l-subdev4 opened.
      Control 0x0098c9c2 set to 40, is 40
      # yavta --no-query -w '0x0098c9c3 40' /dev/v4l-subdev4
      Device /dev/v4l-subdev4 opened.
      Control 0x0098c9c3 set to 40, is 40
      root@plnx_aarch64:~# yavta --no-query -l /dev/v4l-subdev4
      Device /dev/v4l-subdev4 opened.
      --- User Controls (class 0x00980001) ---
      control 0x0098c9c1 `Red Gamma Correction(1 = 0.1 & ' min 1 max 40 step 1 default 10 current 40.
      control 0x0098c9c2 `Blue Gamma Correction(1 = 0.1 &' min 1 max 40 step 1 default 10 current 40.
      control 0x0098c9c3 `Green Gamma Correction(1 = 0.1 ' min 1 max 40 step 1 default 10 current 40.
      3 controls found.

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

  • User/Application programmable coefficients to program the Red, Blue and Green Look Up Tables.

Related Links

Save