R-Car/Devices

From eLinux.org
< R-Car
Revision as of 06:54, 19 May 2016 by Laurent.pinchart (talk | contribs) (Tests)
Jump to: navigation, search

Introduction

The R-Car SoCs contain a large number of peripheral devices. SoC variants within a family usually differ by the number and configuration of the peripherals, while new SoC generations introduce more drastic changes in the peripherals themselves, both in the form of new peripherals and significative architectural changes to existing peripherals.

This page describes Linux support for the R-Car family peripherals. It puts the focus on usage of the peripherals from a userspace point of view. Implementation details internal to the Linux kernel are considered out of scope here, and differences between versions of a peripheral are only described if they matter for applications.

Multimedia Peripherals

VSP

The VSP is the successor of the VIO6 video processing engine found in the first generation R-Car SoCs. I provides per-frame video processing such as color management, up/down scaling and blending. The first version of the VSP, named VSP1, is available on the second generation R-Car SoCs. The third generation R-Car SoCs introduced an updated VSP named VSP2 with support for more video processing functions.

The VSP operates in memory-to-memory mode, with some instances supporting direct output to the Display Unit (DU). All instances have one or more input channels to read data from memory, one or more output channels to write data to memory, and a variable number of video processing blocks that can be arranged freely to create processing pipelines.

  • The Read Pixel Formatter (RPF) reads images from memory and unpacks them with optional pixel encoding conversion and alpha channel support.
  • The Write Pixel Formatter (WPF) packs and writes images to memory with optional dithering, mirroring/flipping and pixel encoding conversion support.
  • The Blend ROP Unit (BRU) blends up to four (Gen2) or five (Gen3) input frames into a single output using ROP and/or alpha blending.
  • The Blend ROP Sub unit (BRS) is an additional two inputs blend/ROP unit.
  • The Super Resolution Unit (SRU) performs super-resolution processing with optional x2 upscaling.
  • The Up/Down Scaler (SRU) scales the input frame up or down by a factor of x1/4 to x4.
  • The Look Up Table (LUT) converts the input frame using a per-component look-up table.
  • The Cubic Look-up Table (CLU) converts the input frame using a 2-dimensional or 3-dimensional look-up table that takes all pixel components into account simultaneously.
  • The Hue Saturation value Transform (HST) converts a frame from RGB to HSV.
  • The Hue Saturation value Inverse transform (HSI) converts a frame from HSV to RGB.
  • The Histogram Generator One dimension (HGO) computes per-component one-dimensional histograms on a frame.
  • The Histogram Generator Two dimension (HGT) computes a two-dimensional histogram on a frame.
  • The Lcdc InterFace (LIF) transfers frames to the Display Unit (DU).
  • The SHarPness (SHP) sharpens or unsharpens frames.

The following table shows the blocks available in each VSP variant.

Renesas R-Car VSP variants
# RPF # WPF Other Blocks
R-Car Gen2
VSPD 4 1 BRU, HGO, HSI, HST, LIF, LUT, UDS (x1)
VSPR 5 4 BRU, HSI, HST, SRU, UDS (x3)
VSPS (H2) 5 4 BRU, CLU, HGO, HGT, HSI, HST, LUT, SRU, UDS (x3)
VSPS (M2) 5 4 BRU, CLU, HGO, HGT, HSI, HST, LUT, SRU, UDS (x1)
R-Car Gen3
VSPBC (H3, M3) 5 1 BRU, CLU, HGO, LUT
VSPBD (H3) 5 1 BRU
VSPD (H3, M3) 5 2 BRU, LIF
VSPD (V3) 5 1 BRS, BRU, LIF
VSPI (H3, M3) 1 1 CLU, HGO, HGT, HSI, HST, LUT, SHP, SRU, UDS (x1)

Usage

Both the VSP1 and VSP2 are supported in mainline Linux by a V4L2 driver named vsp1 (the BRS, HGT and SHP blocks are currently not supported). The driver uses the Media Controller API. It creates one video device node for each input and output, and exposes V4L2 subdev device nodes to userspace. Applications use the Media Controller link setup API to connect the processing blocks into a video pipelines, the V4L2 subdev API to configure formats on the pipeline and the V4L2 API to stream video in and out of the VSP.

Tests

The VSP unit tests suite is available in the following git tree.

git://git.ideasonboard.com/renesas/vsp-tests.git
http://git.ideasonboard.com/renesas/vsp-tests.git

Instructions to build, install and run the test scripts are available in the README file.