Commit e3185e1d authored by Paul Kocialkowski's avatar Paul Kocialkowski Committed by Mauro Carvalho Chehab
Browse files

media: staging: media: Add support for the Allwinner A31 ISP



Some Allwinner platforms come with an Image Signal Processor, which
supports various features in order to enhance and transform data
received by image sensors into good-looking pictures. In most cases,
the data is raw bayer, which gets internally converted to RGB and
finally YUV, which is what the hardware produces.

This driver supports ISPs that are similar to the A31 ISP, which was
the first standalone ISP found in Allwinner platforms. Simpler ISP
blocks were found in the A10 and A20, where they are tied to a CSI
controller. Newer generations of Allwinner SoCs (starting with the
H6, H616, etc) come with a new camera subsystem and revised ISP.
Even though these previous and next-generation ISPs are somewhat
similar to the A31 ISP, they have enough significant differences to
be out of the scope of this driver.

While the ISP supports many features, including 3A and many
enhancement blocks, this implementation is limited to the following:
- V3s (V3/S3) platform support;
- Bayer media bus formats as input;
- Semi-planar YUV (NV12/NV21) as output;
- Debayering with per-component gain and offset configuration;
- 2D noise filtering with configurable coefficients.

Since many features are missing from the associated uAPI, the driver
is aimed to integrate staging until all features are properly
described.

On the technical side, it uses the v4l2 and media controller APIs,
with a video node for capture, a processor subdev and a video node
for parameters submission. A specific uAPI structure and associated
v4l2 meta format are used to configure parameters of the supported
modules.

One particular thing about the hardware is that configuration for
module registers needs to be stored in a DMA buffer and gets copied
to actual registers by the hardware at the next vsync, when instructed
by a flag. This is handled by the "state" mechanism in the driver.

Signed-off-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 4c6f0bc1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,5 +12,6 @@ config VIDEO_SUNXI
if VIDEO_SUNXI

source "drivers/staging/media/sunxi/cedrus/Kconfig"
source "drivers/staging/media/sunxi/sun6i-isp/Kconfig"

endif
+1 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_VIDEO_SUNXI_CEDRUS)	+= cedrus/
obj-$(CONFIG_VIDEO_SUN6I_ISP)		+= sun6i-isp/
+15 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config VIDEO_SUN6I_ISP
	tristate "Allwinner A31 Image Signal Processor (ISP) Driver"
	depends on V4L_PLATFORM_DRIVERS && VIDEO_DEV
	depends on ARCH_SUNXI || COMPILE_TEST
	depends on PM && COMMON_CLK && HAS_DMA
	select MEDIA_CONTROLLER
	select VIDEO_V4L2_SUBDEV_API
	select VIDEOBUF2_DMA_CONTIG
	select VIDEOBUF2_VMALLOC
	select V4L2_FWNODE
	select REGMAP_MMIO
	help
	   Support for the Allwinner A31 Image Signal Processor (ISP), also
	   found on other platforms such as the A80, A83T or V3/V3s.
+4 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
sun6i-isp-y += sun6i_isp.o sun6i_isp_proc.o sun6i_isp_capture.o sun6i_isp_params.o

obj-$(CONFIG_VIDEO_SUN6I_ISP) += sun6i-isp.o
+6 −0
Original line number Diff line number Diff line
Unstaging requirements:
- Add uAPI support and documentation for the configuration of all the hardware
  modules and description of the statistics data structures;
- Add support for statistics reporting;
- Add userspace support in libcamera which demonstrates the ability to receive
  statistics and adapt hardware modules configuration accordingly;
Loading