linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver
       [not found] ` <20220308201038.48386-9-xavier.roumegue@oss.nxp.com>
@ 2022-03-10  7:21   ` Alexander Stein
  2022-03-10 16:18     ` Xavier Roumegue (OSS)
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2022-03-10  7:21 UTC (permalink / raw)
  To: Xavier Roumegue
  Cc: mchehab, hverkuil-cisco, stanimir.varbanov, laurent.pinchart,
	tomi.valkeinen, robh+dt, nicolas, linux-arm-kernel, linux-media,
	devicetree, Xavier Roumegue

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@oss.nxp.com>
> ---
> [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@oss.nxp.com)
> + *
> + */
> [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




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver
  2022-03-10  7:21   ` (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver Alexander Stein
@ 2022-03-10 16:18     ` Xavier Roumegue (OSS)
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Roumegue (OSS) @ 2022-03-10 16:18 UTC (permalink / raw)
  To: Alexander Stein
  Cc: mchehab, hverkuil-cisco, stanimir.varbanov, laurent.pinchart,
	tomi.valkeinen, robh+dt, nicolas, linux-arm-kernel, linux-media,
	devicetree

Hello Alexander,

On 3/10/22 08:21, Alexander Stein wrote:
> 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@oss.nxp.com>
>> ---
>> [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@oss.nxp.com)
>> + *
>> + */
>> [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.
Good point, will implement it in the next series.
Note that 16 is likely too much. I might decrease it.

> 
>> [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.

I will provide as part of the driver documentation a simple python 
script example how to generate a LUT.

Releasing examples through NXP github will take few days, but you can 
have a try without a user specified LUT, using the identiy map computed 
by the driver.

#! /usr/bin/env bash

SRC_FMT=NV12
SINK_FMT=NV16

SW=640
SH=480
DW=320
DH=240


gst-launch-1.0 \
     -v videotestsrc pattern=18  num-buffers=1000 !\
     video/x-raw,format=NV16,width=${SW},height=${SH} !\
     v4l2convert !\
     video/x-raw,format=NV12,width=${DW},height=${DH} !\
     waylandsink window-width=${DW} window-height=${DH}

Regards,
Xavier

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-10 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220308201038.48386-1-xavier.roumegue@oss.nxp.com>
     [not found] ` <20220308201038.48386-9-xavier.roumegue@oss.nxp.com>
2022-03-10  7:21   ` (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver Alexander Stein
2022-03-10 16:18     ` Xavier Roumegue (OSS)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).