media: uapi: Add meta formats for PiSP FE config and stats
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Thu, 3 Oct 2024 10:31:10 +0000 (13:31 +0300)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 16 Oct 2024 07:32:39 +0000 (09:32 +0200)
Add two meta formats for PiSP FE: V4L2_META_FMT_RPI_FE_CFG and
V4L2_META_FMT_RPI_FE_STATS. The former is used to provide configuration
for the FE and the latter is used to read the statistics from the FE.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Documentation/userspace-api/media/v4l/meta-formats.rst
Documentation/userspace-api/media/v4l/metafmt-pisp-fe.rst [new file with mode: 0644]
drivers/media/v4l2-core/v4l2-ioctl.c
include/uapi/linux/videodev2.h

index c6e56b5888bc9d4edc9b7b05a040b71237028d10..86ffb3bc8ade2e0c563dd84441572ecea1a571a6 100644 (file)
@@ -16,6 +16,7 @@ These formats are used for the :ref:`metadata` interface only.
     metafmt-generic
     metafmt-intel-ipu3
     metafmt-pisp-be
+    metafmt-pisp-fe
     metafmt-rkisp1
     metafmt-uvc
     metafmt-vivid
diff --git a/Documentation/userspace-api/media/v4l/metafmt-pisp-fe.rst b/Documentation/userspace-api/media/v4l/metafmt-pisp-fe.rst
new file mode 100644 (file)
index 0000000..fddeada
--- /dev/null
@@ -0,0 +1,39 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+.. _v4l2-meta-fmt-rpi-fe-cfg:
+
+************************
+V4L2_META_FMT_RPI_FE_CFG
+************************
+
+Raspberry Pi PiSP Front End configuration format
+================================================
+
+The Raspberry Pi PiSP Front End image signal processor is configured by
+userspace by providing a buffer of configuration parameters to the
+`rp1-cfe-fe-config` output video device node using the
+:c:type:`v4l2_meta_format` interface.
+
+The `Raspberry Pi PiSP technical specification
+<https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf>`_
+provide detailed description of the Front End configuration and programming
+model.
+
+.. _v4l2-meta-fmt-rpi-fe-stats:
+
+**************************
+V4L2_META_FMT_RPI_FE_STATS
+**************************
+
+Raspberry Pi PiSP Front End statistics format
+=============================================
+
+The Raspberry Pi PiSP Front End image signal processor provides statistics data
+by writing to a buffer provided via the `rp1-cfe-fe-stats` capture video device
+node using the
+:c:type:`v4l2_meta_format` interface.
+
+The `Raspberry Pi PiSP technical specification
+<https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf>`_
+provide detailed description of the Front End configuration and programming
+model.
index b9a3c6b20282d6caf473c9c27086154ecc8b2fb0..0304daa8471d1ee7808a418232384fb8d2264dea 100644 (file)
@@ -1468,6 +1468,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
        case V4L2_PIX_FMT_Y212:         descr = "12-bit YUYV Packed"; break;
        case V4L2_PIX_FMT_Y216:         descr = "16-bit YUYV Packed"; break;
        case V4L2_META_FMT_RPI_BE_CFG:  descr = "RPi PiSP BE Config format"; break;
+       case V4L2_META_FMT_RPI_FE_CFG:  descr = "RPi PiSP FE Config format"; break;
+       case V4L2_META_FMT_RPI_FE_STATS: descr = "RPi PiSP FE Statistics format"; break;
        case V4L2_META_FMT_GENERIC_8:   descr = "8-bit Generic Metadata"; break;
        case V4L2_META_FMT_GENERIC_CSI2_10:     descr = "8-bit Generic Meta, 10b CSI-2"; break;
        case V4L2_META_FMT_GENERIC_CSI2_12:     descr = "8-bit Generic Meta, 12b CSI-2"; break;
index ded023edac70b56551f9db4110b9b144712e3b41..e7c4dce390074b8b69593f1cd252284616f1b9db 100644 (file)
@@ -860,6 +860,8 @@ struct v4l2_pix_format {
 
 /* Vendor specific - used for RaspberryPi PiSP */
 #define V4L2_META_FMT_RPI_BE_CFG       v4l2_fourcc('R', 'P', 'B', 'C') /* PiSP BE configuration */
+#define V4L2_META_FMT_RPI_FE_CFG       v4l2_fourcc('R', 'P', 'F', 'C') /* PiSP FE configuration */
+#define V4L2_META_FMT_RPI_FE_STATS     v4l2_fourcc('R', 'P', 'F', 'S') /* PiSP FE stats */
 
 #ifdef __KERNEL__
 /*