From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "robh@kernel.org" <robh@kernel.org>,
"mchehab@kernel.org" <mchehab@kernel.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sarang Chaudhari <Sarang.Chaudhari@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>
Cc: "Zhaoyuan Chen (陈兆远)" <zhaoyuan.chen@mediatek.com>,
"Teddy Chen (陳乾元)" <Teddy.Chen@mediatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v6 3/4] media: uapi: mediatek: Add MT8188 AIE control definitions
Date: Mon, 8 Jun 2026 02:06:27 +0000 [thread overview]
Message-ID: <139308dda4cc6f29cc973d86af52e6153b88b2f1.camel@mediatek.com> (raw)
In-Reply-To: <20260605082956.2590511-1-sarang.chaudhari@mediatek.com>
On Fri, 2026-06-05 at 16:29 +0800, Sarang Chaudhari wrote:
> Add AIE (AI Engine) UAPI control definitions and register the
> V4L2_META_FMT_MTFD_RESULT metadata format for the MediaTek face
> detection hardware accelerator.
>
> This patch adds:
> - include/uapi/linux/mtk_aie_v4l2_controls.h: Custom V4L2 control IDs
> for AIE initialization and per-frame parameters.
> - V4L2_META_FMT_MTFD_RESULT format in videodev2.h for face detection
> result metadata output.
> - Format description in v4l2-ioctl.c.
>
> Signed-off-by: Sarang Chaudhari <sarang.chaudhari@mediatek.com>
> ---
> Changes in v6:
> - Simplify UAPI header to contain only control ID definitions. Full
> structures kept in kernel-internal header for now, pending UAPI
> structure redesign per CK Hu's feedback.
> - Drop V4L2_CTRL_TYPE_AIE_INIT and V4L2_CTRL_TYPE_AIE_PARAM from
> v4l2_ctrl_type enum (use V4L2_CTRL_TYPE_U32 compound control instead).
> - Address CK Hu's review feedback: remove freq_level, improve
> feature_threshold docs, clarify pyramid multi-scale detection, clarify
> FLD mode uses FD results via Binary Tree Traversal.
>
> Changes in v5:
> - Add an introduction for feature_threshold.
> - Rename v4l2_aie_roi to aie_roi_coordinate.
> - Rename v4l2_aie_padding to aie_padding_size.
> - Explain en_padding and the three modes of fd_mode.
> - Move structures from mtk_aie.h to the uapi directory.
>
> Changes in v4:
> - Document the detail of V4L2_META_FMT_MTFD_RESULT.
> - Add the introduction of related variables.
>
> Changes in v3: None
>
> Changes in v2:
> - Fix coding style.
>
> drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
> include/uapi/linux/mtk_aie_v4l2_controls.h | 23 ++++++++++++++++++++++
> include/uapi/linux/videodev2.h | 1 +
> 3 files changed, 25 insertions(+)
> create mode 100644 include/uapi/linux/mtk_aie_v4l2_controls.h
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index e50e517..8754098 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -11,6 +11,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
> case V4L2_META_FMT_GENERIC_CSI2_16: descr = "8-bit Generic Meta, 16b CSI-2"; break;
> case V4L2_META_FMT_GENERIC_CSI2_20: descr = "8-bit Generic Meta, 20b CSI-2"; break;
> case V4L2_META_FMT_GENERIC_CSI2_24: descr = "8-bit Generic Meta, 24b CSI-2"; break;
> + case V4L2_META_FMT_MTFD_RESULT: descr = "Mediatek Face Detect Result"; break;
>
> default:
> /* Compressed formats */
> diff --git a/include/uapi/linux/mtk_aie_v4l2_controls.h b/include/uapi/linux/mtk_aie_v4l2_controls.h
> new file mode 100644
> index 0000000..a8b2927
> --- /dev/null
> +++ b/include/uapi/linux/mtk_aie_v4l2_controls.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +/*
> + * MediaTek AI Engine (AIE) V4L2 control definitions
> + *
> + * Copyright (c) 2020 MediaTek Inc.
> + * Author: Fish Wu <fish.wu@mediatek.com>
> + */
> +
> +#ifndef __UAPI_MTK_AIE_V4L2_CONTROLS_H__
> +#define __UAPI_MTK_AIE_V4L2_CONTROLS_H__
> +
> +#include <linux/videodev2.h>
> +
> +/*
> + * The base for the MediaTek AIE driver controls.
> + * We reserve 16 controls for this driver.
> + */
> +#define V4L2_CID_USER_MTK_FD_BASE (V4L2_CID_USER_BASE + 0x1fd0)
> +
> +#define V4L2_CID_MTK_AIE_INIT (V4L2_CID_USER_MTK_FD_BASE + 1)
> +#define V4L2_CID_MTK_AIE_PARAM (V4L2_CID_USER_MTK_FD_BASE + 2)
Add definition of parameter of V4L2_CID_MTK_AIE_INIT and V4L2_CID_MTK_AIE_PARAM,
so user space would know how to control this driver.
If this patch is not ready to apply. Add 'RFC' prefix in title.
> +
> +#endif /* __UAPI_MTK_AIE_V4L2_CONTROLS_H__ */
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 7668201..6d6866d 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -10,6 +10,7 @@ struct v4l2_pix_format {
> #define V4L2_META_FMT_GENERIC_CSI2_16 v4l2_fourcc('M', 'C', '1', 'G') /* 16-bit CSI-2 packed 8-bit metadata */
> #define V4L2_META_FMT_GENERIC_CSI2_20 v4l2_fourcc('M', 'C', '1', 'K') /* 20-bit CSI-2 packed 8-bit metadata */
> #define V4L2_META_FMT_GENERIC_CSI2_24 v4l2_fourcc('M', 'C', '1', 'O') /* 24-bit CSI-2 packed 8-bit metadata */
> +#define V4L2_META_FMT_MTFD_RESULT v4l2_fourcc('M', 'T', 'f', 'd') /* Mediatek face detection result */
Add document to describe the detail of V4L2_META_FMT_MTFD_RESULT. [1] is the example document for V4L2_META_FMT_RPI_FE_CFG.
There are many document in Documentation/userspace-api/media/v4l/ for your reference.
[1] https://patchwork.kernel.org/project/linux-media/patch/20241003-rp1-cfe-v6-1-d6762edd98a8@ideasonboard.com/
Regards,
CK
> #endif
>
> /* priv field value to indicates that subsequent fields are valid. */
prev parent reply other threads:[~2026-06-08 2:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 8:29 [PATCH v6 3/4] media: uapi: mediatek: Add MT8188 AIE control definitions Sarang Chaudhari
2026-06-08 2:06 ` CK Hu (胡俊光) [this message]
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=139308dda4cc6f29cc973d86af52e6153b88b2f1.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Sarang.Chaudhari@mediatek.com \
--cc=Teddy.Chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=zhaoyuan.chen@mediatek.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