public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Xavier Roumegue (OSS)" <xavier.roumegue@oss.nxp.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl,
	stanimir.varbanov@linaro.org, laurent.pinchart@ideasonboard.com,
	tomi.valkeinen@ideasonboard.com, robh+dt@kernel.org,
	nicolas@ndufresne.ca, linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: (EXT) [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver
Date: Thu, 10 Mar 2022 17:18:34 +0100	[thread overview]
Message-ID: <a041cf2f-896b-5231-8d36-da2e27f3fc50@oss.nxp.com> (raw)
In-Reply-To: <10066981.nUPlyArG6x@steina-w>

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

  reply	other threads:[~2022-03-10 16:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 20:10 [PATCH v3 0/9] i.MX8MP DW100 dewarper driver Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 1/9] videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 2/9] v4l2-ctrls: add support for dynamically allocated arrays Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 3/9] vivid: add dynamic array test control Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 4/9] media: Documentation: dw100: Add user documentation for the DW100 driver Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 5/9] media: v4l: uapi: Add user control base for DW100 controls Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 6/9] media: uapi: Add a control for DW100 driver Xavier Roumegue
2022-03-08 20:10 ` [PATCH v3 7/9] media: dt-bindings: media: Add i.MX8MP DW100 binding Xavier Roumegue
2022-03-08 21:24   ` Rob Herring
2022-03-09  1:23   ` Rob Herring
2022-03-09 10:51     ` Xavier Roumegue (OSS)
2022-03-08 20:10 ` [PATCH v3 8/9] media: dw100: Add i.MX8MP dw100 dewarper driver Xavier Roumegue
2022-03-10  7:21   ` (EXT) " Alexander Stein
2022-03-10 16:18     ` Xavier Roumegue (OSS) [this message]
2022-03-08 20:10 ` [PATCH v3 9/9] media: MAINTAINERS: add entry for i.MX8MP DW100 v4l2 mem2mem driver Xavier Roumegue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a041cf2f-896b-5231-8d36-da2e27f3fc50@oss.nxp.com \
    --to=xavier.roumegue@oss.nxp.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=robh+dt@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox