Commit fd5c32d8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull media updates from Mauro Carvalho Chehab:

 - the usbvision driver was dropped from staging

 - the Zoran driver were re-added at staging. It gained lots of
   improvements, and was converted to use videobuf2 API

 - a new virtual driver (vidtv) was added in order to allow testing the
   digital TV framework and APIs

 - the media uAPI documentation gained a glossary with commonly used
   terms, helping to simplify some parts of the docs

 - more cleanups at the atomisp driver

 - Mediatek VPU gained support for MT8183

 - added support for codecs with supports doing colorspace conversion
   (CSC)

 - support for CSC API was added at vivid and rksip1 drivers

 - added a helper core support and uAPI for better supporting H.264
   codecs

 - added support for Renesas R8A774E1

 - use the new SPDX GFDL-1.1-no-invariants-or-later license on media
   uAPI docs, instead of a license text

 - Venus driver has gained VP9 codec support

 - lots of other cleanups and driver improvements

* tag 'media/v5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (555 commits)
  media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning
  media: tvp7002: fix uninitialized variable warning
  media: s5k5baf: drop 'data' field in struct s5k5baf_fw
  media: dt-bindings: media: venus: Add an optional power domain for perf voting
  media: rcar-vin: rcar-dma: Fix setting VNIS_REG for RAW8 formats
  media: staging: rkisp1: uapi: Do not use BIT() macro
  media: v4l2-mem2mem: Fix spurious v4l2_m2m_buf_done
  media: usbtv: Fix refcounting mixup
  media: zoran.rst: place it at the right place this time
  media: add Zoran cardlist
  media: admin-guide: update cardlists
  media: siano: rename a duplicated card string
  media: zoran: move documentation file to the right place
  media: atomisp: fixes build breakage for ISP2400 due to a cleanup
  media: zoran: fix mixed case on vars
  media: zoran: get rid of an unused var
  media: zoran: use upper case for card types
  media: zoran: fix sparse warnings
  media: zoran: fix smatch warning
  media: zoran: update TODO
  ...
parents 647412da c386e079
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -20,13 +20,13 @@ dvb-usb-dvbsky cards list
     - 0572:0320
   * - DVBSky T680CI
     - 0572:680c
   * - MyGica Mini DVB-T2 USB Stick T230
   * - MyGica Mini DVB-(T/T2/C) USB Stick T230
     - 0572:c688
   * - MyGica Mini DVB-T2 USB Stick T230C
   * - MyGica Mini DVB-(T/T2/C) USB Stick T230C
     - 0572:c689
   * - MyGica Mini DVB-T2 USB Stick T230C Lite
   * - MyGica Mini DVB-(T/T2/C) USB Stick T230C Lite
     - 0572:c699
   * - MyGica Mini DVB-T2 USB Stick T230C v2
   * - MyGica Mini DVB-(T/T2/C) USB Stick T230C v2
     - 0572:c68a
   * - TechnoTrend TT-connect CT2-4650 CI
     - 0b48:3012
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ dvb-usb-dw2102 cards list
     - 0b48:3011
   * - TerraTec Cinergy S USB
     - 0ccd:0064
   * - Terratec Cinergy S2 PCIe Dual Port 1
     - 153b:1181
   * - Terratec Cinergy S2 PCIe Dual Port 2
     - 153b:1182
   * - Terratec Cinergy S2 USB BOX
     - 0ccd:0x0105
   * - Terratec Cinergy S2 USB HD
+4 −0
Original line number Diff line number Diff line
@@ -434,3 +434,7 @@ EM28xx cards list
     - PCTV DVB-S2 Stick (461e v2)
     - em28178
     - 2013:0461, 2013:0259
   * - 105
     - MyGica iGrabber
     - em2860
     - 1f4d:1abe
+74 −68
Original line number Diff line number Diff line
@@ -89,12 +89,12 @@ Let us take the example of ov5670 sensor connected to CSI2 port 0, for a
Using the media contorller APIs, the ov5670 sensor is configured to send
frames in packed raw Bayer format to IPU3 CSI2 receiver.

# This example assumes /dev/media0 as the CIO2 media device
.. code-block:: none

    # This example assumes /dev/media0 as the CIO2 media device
    export MDEV=/dev/media0

    # and that ov5670 sensor is connected to i2c bus 10 with address 0x36

    export SDEV=$(media-ctl -d $MDEV -e "ov5670 10-0036")

    # Establish the link for the media devices using media-ctl [#f3]_
@@ -102,9 +102,7 @@ media-ctl -d $MDEV -l "ov5670:0 -> ipu3-csi2 0:0[1]"

    # Set the format for the media devices
    media-ctl -d $MDEV -V "ov5670:0 [fmt:SGRBG10/2592x1944]"

    media-ctl -d $MDEV -V "ipu3-csi2 0:0 [fmt:SGRBG10/2592x1944]"

    media-ctl -d $MDEV -V "ipu3-csi2 0:1 [fmt:SGRBG10/2592x1944]"

Once the media pipeline is configured, desired sensor specific settings
@@ -112,16 +110,18 @@ Once the media pipeline is configured, desired sensor specific settings

e.g

yavta -w 0x009e0903 444 $SDEV
.. code-block:: none

    yavta -w 0x009e0903 444 $SDEV
    yavta -w 0x009e0913 1024 $SDEV

    yavta -w 0x009e0911 2046 $SDEV

Once the desired sensor settings are set, frame captures can be done as below.

e.g

.. code-block:: none

    yavta --data-prefix -u -c10 -n5 -I -s2592x1944 --file=/tmp/frame-#.bin \
          -f IPU3_SGRBG10 $(media-ctl -d $MDEV -e "ipu3-cio2 0")

@@ -269,20 +269,20 @@ all the video nodes setup correctly.

Let us take "ipu3-imgu 0" subdev as an example.

media-ctl -d $MDEV -r
.. code-block:: none

    media-ctl -d $MDEV -r
    media-ctl -d $MDEV -l "ipu3-imgu 0 input":0 -> "ipu3-imgu 0":0[1]

    media-ctl -d $MDEV -l "ipu3-imgu 0":2 -> "ipu3-imgu 0 output":0[1]

    media-ctl -d $MDEV -l "ipu3-imgu 0":3 -> "ipu3-imgu 0 viewfinder":0[1]

    media-ctl -d $MDEV -l "ipu3-imgu 0":4 -> "ipu3-imgu 0 3a stat":0[1]

Also the pipe mode of the corresponding V4L2 subdev should be set as desired
(e.g 0 for video mode or 1 for still mode) through the control id 0x009819a1 as
below.

.. code-block:: none

    yavta -w "0x009819A1 1" /dev/v4l-subdev7

Certain hardware blocks in ImgU pipeline can change the frame resolution by
@@ -371,16 +371,18 @@ v4l2n command can be used. This helps process the raw Bayer frames and produces
the desired results for the main output image and the viewfinder output, in NV12
format.

.. code-block:: none

    v4l2n --pipe=4 --load=/tmp/frame-#.bin --open=/dev/video4
--fmt=type:VIDEO_OUTPUT_MPLANE,width=2592,height=1944,pixelformat=0X47337069
--reqbufs=type:VIDEO_OUTPUT_MPLANE,count:1 --pipe=1 --output=/tmp/frames.out
--open=/dev/video5
--fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12
--reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=2 --output=/tmp/frames.vf
--open=/dev/video6
--fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12
--reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=3 --open=/dev/video7
--output=/tmp/frames.3A --fmt=type:META_CAPTURE,?
          --fmt=type:VIDEO_OUTPUT_MPLANE,width=2592,height=1944,pixelformat=0X47337069 \
          --reqbufs=type:VIDEO_OUTPUT_MPLANE,count:1 --pipe=1 \
          --output=/tmp/frames.out --open=/dev/video5 \
          --fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12 \
          --reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=2 \
          --output=/tmp/frames.vf --open=/dev/video6 \
          --fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12 \
          --reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=3 --open=/dev/video7 \
          --output=/tmp/frames.3A --fmt=type:META_CAPTURE,? \
          --reqbufs=count:1,type:META_CAPTURE --pipe=1,2,3,4 --stream=5

You can also use yavta [#f2]_ command to do same thing as above:
@@ -408,6 +410,8 @@ as below.
Main output frames
~~~~~~~~~~~~~~~~~~

.. code-block:: none

    raw2pnm -x2560 -y1920 -fNV12 /tmp/frames.out /tmp/frames.out.ppm

where 2560x1920 is output resolution, NV12 is the video format, followed
@@ -416,6 +420,8 @@ by input frame and output PNM file.
Viewfinder output frames
~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: none

    raw2pnm -x2560 -y1920 -fNV12 /tmp/frames.vf /tmp/frames.vf.ppm

where 2560x1920 is output resolution, NV12 is the video format, followed
@@ -482,63 +488,63 @@ Name Description
Optical Black Correction Optical Black Correction block subtracts a pre-defined
			 value from the respective pixel values to obtain better
			 image quality.
			 Defined in :c:type:`ipu3_uapi_obgrid_param`.
			 Defined in struct ipu3_uapi_obgrid_param.
Linearization		 This algo block uses linearization parameters to
			 address non-linearity sensor effects. The Lookup table
			 table is defined in
			 :c:type:`ipu3_uapi_isp_lin_vmem_params`.
			 struct ipu3_uapi_isp_lin_vmem_params.
SHD			 Lens shading correction is used to correct spatial
			 non-uniformity of the pixel response due to optical
			 lens shading. This is done by applying a different gain
			 for each pixel. The gain, black level etc are
			 configured in :c:type:`ipu3_uapi_shd_config_static`.
			 configured in struct ipu3_uapi_shd_config_static.
BNR			 Bayer noise reduction block removes image noise by
			 applying a bilateral filter.
			 See :c:type:`ipu3_uapi_bnr_static_config` for details.
			 See struct ipu3_uapi_bnr_static_config for details.
ANR			 Advanced Noise Reduction is a block based algorithm
			 that performs noise reduction in the Bayer domain. The
			 convolution matrix etc can be found in
			 :c:type:`ipu3_uapi_anr_config`.
			 struct ipu3_uapi_anr_config.
DM			 Demosaicing converts raw sensor data in Bayer format
			 into RGB (Red, Green, Blue) presentation. Then add
			 outputs of estimation of Y channel for following stream
			 processing by Firmware. The struct is defined as
			 :c:type:`ipu3_uapi_dm_config`.
			 struct ipu3_uapi_dm_config.
Color Correction	 Color Correction algo transforms sensor specific color
			 space to the standard "sRGB" color space. This is done
			 by applying 3x3 matrix defined in
			 :c:type:`ipu3_uapi_ccm_mat_config`.
Gamma correction	 Gamma correction :c:type:`ipu3_uapi_gamma_config` is a
			 struct ipu3_uapi_ccm_mat_config.
Gamma correction	 Gamma correction struct ipu3_uapi_gamma_config is a
			 basic non-linear tone mapping correction that is
			 applied per pixel for each pixel component.
CSC			 Color space conversion transforms each pixel from the
			 RGB primary presentation to YUV (Y: brightness,
			 UV: Luminance) presentation. This is done by applying
			 a 3x3 matrix defined in
			 :c:type:`ipu3_uapi_csc_mat_config`
			 struct ipu3_uapi_csc_mat_config
CDS			 Chroma down sampling
			 After the CSC is performed, the Chroma Down Sampling
			 is applied for a UV plane down sampling by a factor
			 of 2 in each direction for YUV 4:2:0 using a 4x2
			 configurable filter :c:type:`ipu3_uapi_cds_params`.
			 configurable filter struct ipu3_uapi_cds_params.
CHNR			 Chroma noise reduction
			 This block processes only the chrominance pixels and
			 performs noise reduction by cleaning the high
			 frequency noise.
			 See struct :c:type:`ipu3_uapi_yuvp1_chnr_config`.
			 See struct struct ipu3_uapi_yuvp1_chnr_config.
TCC			 Total color correction as defined in struct
			 :c:type:`ipu3_uapi_yuvp2_tcc_static_config`.
			 struct ipu3_uapi_yuvp2_tcc_static_config.
XNR3			 eXtreme Noise Reduction V3 is the third revision of
			 noise reduction algorithm used to improve image
			 quality. This removes the low frequency noise in the
			 captured image. Two related structs are  being defined,
			 :c:type:`ipu3_uapi_isp_xnr3_params` for ISP data memory
			 and :c:type:`ipu3_uapi_isp_xnr3_vmem_params` for vector
			 struct ipu3_uapi_isp_xnr3_params for ISP data memory
			 and struct ipu3_uapi_isp_xnr3_vmem_params for vector
			 memory.
TNR			 Temporal Noise Reduction block compares successive
			 frames in time to remove anomalies / noise in pixel
			 values. :c:type:`ipu3_uapi_isp_tnr3_vmem_params` and
			 :c:type:`ipu3_uapi_isp_tnr3_params` are defined for ISP
			 values. struct ipu3_uapi_isp_tnr3_vmem_params and
			 struct ipu3_uapi_isp_tnr3_params are defined for ISP
			 vector and data memory respectively.
======================== =======================================================

@@ -570,9 +576,9 @@ processor, while many others will use a set of fixed hardware blocks also
called accelerator cluster (ACC) to crunch pixel data and produce statistics.

ACC parameters of individual algorithms, as defined by
:c:type:`ipu3_uapi_acc_param`, can be chosen to be applied by the user
space through struct :c:type:`ipu3_uapi_flags` embedded in
:c:type:`ipu3_uapi_params` structure. For parameters that are configured as
struct ipu3_uapi_acc_param, can be chosen to be applied by the user
space through struct struct ipu3_uapi_flags embedded in
struct ipu3_uapi_params structure. For parameters that are configured as
not enabled by the user space, the corresponding structs are ignored by the
driver, in which case the existing configuration of the algorithm will be
preserved.
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ sta2x11_vip STA2X11 VIP Video For Linux
tw5864            Techwell TW5864 video/audio grabber and encoder
tw686x            Intersil/Techwell TW686x
tw68              Techwell tw68x Video For Linux
zoran             Zoran-36057/36067 JPEG codec
================  ========================================================

Some of those drivers support multiple devices, as shown at the card
@@ -105,3 +106,4 @@ lists below:
	ivtv-cardlist
	saa7134-cardlist
	saa7164-cardlist
	zoran-cardlist
Loading