Thread (15 messages) 15 messages, 3 authors, 2022-03-10

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

From: Alexander Stein <hidden>
Date: 2022-03-10 07:21:15
Also in: linux-arm-kernel, linux-media

Hello Xavier,

thanks for trying to mainline this hardware support.

Am Dienstag, 8. März 2022, 21:10:37 CET schrieb Xavier Roumegue:
quoted hunk ↗ jump to hunk
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


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help