Re: (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Xavier,

thanks for trying to mainline this hardware support.

Am Dienstag, 8. März 2022, 21:10:37 CET schrieb Xavier Roumegue:
> Add a V4L2 mem-to-mem driver for the Vivante DW100 Dewarp Processor IP
> core found on i.MX8MP SoC.
> 
> The processor core applies a programmable geometrical transformation on
> input image to correct distorsion introduced by lenses.
> The transformation function is exposed as a grid map with 16x16 pixel
> macroblocks indexed using X, Y vertex coordinates.
> 
> The dewarping map can be set from application through dedicated a v4l2
> control. If not set or invalid, the driver computes an identity map
> prior to start the processing engine.
> 
> The driver supports scaling, cropping and pixel format conversion.
> 
> Signed-off-by: Xavier Roumegue <xavier.roumegue@xxxxxxxxxxx>
> ---
> [snip]
> diff --git a/drivers/media/platform/dw100/dw100.c
> b/drivers/media/platform/dw100/dw100.c new file mode 100644
> index 000000000000..7e1fcdfe5b91
> --- /dev/null
> +++ b/drivers/media/platform/dw100/dw100.c
> @@ -0,0 +1,1744 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * DW100 Hardware dewarper
> + *
> + * Copyright 2022 NXP
> + * Author: Xavier Roumegue (xavier.roumegue@xxxxxxxxxxx)
> + *
> + */
> [snip]
> +static const struct v4l2_ctrl_config ctrl_custom_lut = {
> +	.id = V4L2_CID_DW100_MAPPING,
> +	.name = "Look-Up Table",
> +	.type = V4L2_CTRL_TYPE_U32,
> +	.min = 0x00000000,
> +	.max = 0xFFFFFFFF,
> +	.step = 1,
> +	.def = 0,
> +	.dims = { DW100_MAX_LUT_NELEMS },
> +	.flags = V4L2_CTRL_FLAG_DYNAMIC_ARRAY,
> +};

I know right now there is only one control, but you are reserving 16 controls 
in PATCH 5/9. So for me it seems sensible to make this an array already, so 
that additional controls can be added here easily.

> [snip]
> +	hdl = &ctx->hdl;
> +	v4l2_ctrl_handler_init(hdl, 1);
> +	v4l2_ctrl_new_custom(hdl, &ctrl_custom_lut, NULL);

IMHO this won't need any further changes if an array is already being used.
I'm eager to try it once you can provide an example how to use it.

Regards
Alexander







[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux