All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
To: 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, alexander.stein@ew.tq-group.com
Cc: Xavier Roumegue <xavier.roumegue@oss.nxp.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH v6 09/14] media: Documentation: dw100: Add user documentation for the DW100 driver
Date: Thu, 23 Jun 2022 16:31:10 +0200	[thread overview]
Message-ID: <20220623143115.3185297-10-xavier.roumegue@oss.nxp.com> (raw)
In-Reply-To: <20220623143115.3185297-1-xavier.roumegue@oss.nxp.com>

Add user documentation for the DW100 driver.

while at it, replace spaces with tab on drivers list.

Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../userspace-api/media/drivers/dw100.rst     | 69 +++++++++++++++++++
 .../userspace-api/media/drivers/index.rst     |  3 +-
 2 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/userspace-api/media/drivers/dw100.rst

diff --git a/Documentation/userspace-api/media/drivers/dw100.rst b/Documentation/userspace-api/media/drivers/dw100.rst
new file mode 100644
index 000000000000..1ca6fa55f539
--- /dev/null
+++ b/Documentation/userspace-api/media/drivers/dw100.rst
@@ -0,0 +1,69 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+DW100 dewarp driver
+===================
+
+The Vivante DW100 Dewarp Processor IP core found on i.MX8MP SoC applies a
+programmable geometrical transformation on the input image to correct distortion
+introduced by lenses.
+
+The transformation function is exposed by the hardware as a grid map with 16x16
+pixel macroblocks indexed using X, Y vertex coordinates.
+::
+
+                          Image width
+           <--------------------------------------->
+
+      ^    .-------.-------.-------.-------.-------.
+      |    | 16x16 |       |       |       |       |
+   I  |    | pixel |       |       |       |       |
+   m  |    | block |       |       |       |       |
+   a  |    .-------.-------.-------.-------.-------.
+   g  |    |       |       |       |       |       |
+   e  |    |       |       |       |       |       |
+      |    |       |       |       |       |       |
+   h  |    .-------.-------.-------.-------.-------.
+   e  |    |       |       |       |       |       |
+   i  |    |       |       |       |       |       |
+   g  |    |       |       |       |       |       |
+   h  |    .-------.-------.-------.-------.-------.
+   t  |    |       |       |       |       |       |
+      |    |       |       |       |       |       |
+      |    |       |       |       |       |       |
+      v    '-------'-------'-------'-------'-------'
+
+            Grid of Image Blocks for Dewarping Map
+
+
+Each x, y coordinate register uses 16 bits to record the coordinate address in
+an unsigned 12.4 fixed point format (UQ12.4).
+::
+
+    .----------------------.--------..----------------------.--------.
+    |         31~20        | 19~16  ||         15~4         |  3~0   |
+    |       (integer)      | (frac) ||       (integer)      | (frac) |
+    '----------------------'--------''----------------------'--------'
+    <-------------------------------><------------------------------->
+                Y coordinate                     X coordinate
+
+                           Remap Register Layout
+
+The dewarping map is set from applications using the
+V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP control. The control contains
+an array of u32 values storing (x, y) destination coordinates for each
+vertex of the grid. The x coordinate is stored in the 16 LSBs and the y
+coordinate in the 16 MSBs.
+
+The number of elements in the array must match the image size:
+
+.. code-block:: C
+
+    elems = (DIV_ROUND_UP(width, 16) + 1) * (DIV_ROUND_UP(height, 16) + 1);
+
+If the control has not been set by the application, the driver uses an identity
+map.
+
+More details on the DW100 hardware operations can be found in
+*chapter 13.15 DeWarp* of IMX8MP_ reference manual.
+
+.. _IMX8MP: https://www.nxp.com/webapp/Download?colCode=IMX8MPRM
diff --git a/Documentation/userspace-api/media/drivers/index.rst b/Documentation/userspace-api/media/drivers/index.rst
index 12e3c512d718..0c720ca1a27d 100644
--- a/Documentation/userspace-api/media/drivers/index.rst
+++ b/Documentation/userspace-api/media/drivers/index.rst
@@ -33,7 +33,8 @@ For more details see the file COPYING in the source distribution of Linux.
 
 	ccs
 	cx2341x-uapi
-        hantro
+	dw100
+	hantro
 	imx-uapi
 	max2175
 	meye-uapi
-- 
2.36.1


  parent reply	other threads:[~2022-06-23 14:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 14:31 [PATCH v6 00/14] i.MX8MP DW100 dewarper driver Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 01/14] videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY Xavier Roumegue
2022-07-08  9:58   ` Laurent Pinchart
2022-06-23 14:31 ` [PATCH v6 02/14] v4l2-ctrls: add support for dynamically allocated arrays Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 03/14] vivid: add dynamic array test control Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 04/14] v4l2-ctrls: allocate space for arrays Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 05/14] v4l2-ctrls: alloc arrays in ctrl_ref Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 06/14] v4l2-ctrls: add v4l2_ctrl_modify_dimensions Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 07/14] v4l2-ctrls: add event Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 08/14] vivid: add pixel_array test control Xavier Roumegue
2022-06-23 14:31 ` Xavier Roumegue [this message]
2022-06-23 14:31 ` [PATCH v6 10/14] media: v4l: uapi: Add user control base for DW100 controls Xavier Roumegue
2022-06-23 14:31 ` [PATCH v6 11/14] media: uapi: Add a control for DW100 driver Xavier Roumegue
2022-07-08 10:50   ` Laurent Pinchart
2022-06-23 14:31 ` [PATCH v6 12/14] media: dt-bindings: media: Add i.MX8MP DW100 binding Xavier Roumegue
2022-06-30 21:57   ` Rob Herring
2022-06-23 14:31 ` [PATCH v6 13/14] media: dw100: Add i.MX8MP dw100 dewarper driver Xavier Roumegue
2022-07-08 10:12   ` Hans Verkuil
2022-07-08 12:03     ` Laurent Pinchart
2022-07-08 10:48   ` Ezequiel Garcia
2022-06-23 14:31 ` [PATCH v6 14/14] 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=20220623143115.3185297-10-xavier.roumegue@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-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.