Re: [PATCH v2 63/66] staging: media: Add support for the Allwinner A31 ISP

From: Paul Kocialkowski
Date: Tue Mar 01 2022 - 10:59:03 EST


Hi Laurent,

On Mon 07 Feb 22, 18:16, Laurent Pinchart wrote:
> Hi Paul,
>
> Thank you for the patch.
>
> On Sat, Feb 05, 2022 at 07:54:26PM +0100, Paul Kocialkowski wrote:
> > 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;
>
> Greyscale formats would also be nice to have, if the hardware can
> support that (it mostly just requires the ability to disable the CFA
> interpolation).

As far as I know there's no support for grayscale, only bayer formats
and YUV.

> > - Semi-planar YUV (NV12/NV21) as output;
>
> Packed YUV would also be useful if the hardware supports it.

Same here, it only supports planar and semi-planar YUV 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: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx>
> > ---
> > drivers/staging/media/sunxi/Kconfig | 1 +
> > drivers/staging/media/sunxi/Makefile | 1 +
> > drivers/staging/media/sunxi/sun6i-isp/Kconfig | 13 +
> > .../staging/media/sunxi/sun6i-isp/Makefile | 4 +
> > .../staging/media/sunxi/sun6i-isp/sun6i_isp.c | 572 +++++++++++++
> > .../staging/media/sunxi/sun6i-isp/sun6i_isp.h | 86 ++
> > .../media/sunxi/sun6i-isp/sun6i_isp_capture.c | 751 ++++++++++++++++++
> > .../media/sunxi/sun6i-isp/sun6i_isp_capture.h | 78 ++
> > .../media/sunxi/sun6i-isp/sun6i_isp_params.c | 573 +++++++++++++
> > .../media/sunxi/sun6i-isp/sun6i_isp_params.h | 52 ++
> > .../media/sunxi/sun6i-isp/sun6i_isp_proc.c | 599 ++++++++++++++
> > .../media/sunxi/sun6i-isp/sun6i_isp_proc.h | 61 ++
> > .../media/sunxi/sun6i-isp/sun6i_isp_reg.h | 275 +++++++
> > .../sunxi/sun6i-isp/uapi/sun6i-isp-config.h | 43 +
>
> Could you add a TODO file to list the issues that need to be fixed for
> the driver to move out of staging ? I'll already propose one entry:
>
> - Add support in libcamera

Maybe it would be good to narrow down what level of support you have in mind
here. Just adding basic support fort the pipeline is probably doable, but
developing complex 3A algorithms would require very significant effort and
it would be a shame that this prevents the driver from leaving staging.

I think another obvious task would be to have a complete uAPI that reflects
all modules that are part of the ISP.

What do you think?

Paul

> This isn't required to merge the driver in staging as long as ABI
> compatibility doesn't need to be preserved until the driver is moved out
> of staging.
>
> > 14 files changed, 3109 insertions(+)
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/Kconfig
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/Makefile
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.h
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.h
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.h
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.h
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_reg.h
> > create mode 100644 drivers/staging/media/sunxi/sun6i-isp/uapi/sun6i-isp-config.h
>
> [snip]
>
> --
> Regards,
>
> Laurent Pinchart

--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Attachment: signature.asc
Description: PGP signature