[PATCH v1 07/10] media: platform: mediatek: add isp_7x video ops
CK Hu (胡俊光)
ck.hu at mediatek.com
Sun Nov 3 19:24:54 PST 2024
Hi, Shu-hsiang:
On Wed, 2024-10-09 at 19:15 +0800, Shu-hsiang Yang wrote:
> Introduces the V4L2 video interface and feature management for the
> MediaTek ISP7x CAMSYS. These interfaces include various functionalities,
> such as video operation initialization and registration. They also
> manage MediaTek-specific formats and handle buffers for MediaTek camera
> video devices. This integrates CAMSYS functionalities to be compatible
> with the V4L2 framework.
>
> Signed-off-by: Shu-hsiang Yang <Shu-hsiang.Yang at mediatek.com>
> ---
[snip]
> +
> +static void mtk_cam_fill_ext_fmtdesc(struct v4l2_fmtdesc *fmt)
> +{
> + const char *descr = NULL;
> + const unsigned int sz = sizeof(fmt->description);
> +
> + switch (fmt->pixelformat) {
> + case V4L2_PIX_FMT_MTISP_SBGGR8:
> + descr = "8-bit Bayer BGGR MTISP Packed";
V4L2_PIX_FMT_PISP_COMP1_RGGB is a Raspberry Pi format, and its fmtdesc is filled in v4l_fill_fmtdesc().
So move these fill code into v4l_fill_fmtdesc().
Regards,
CK
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG8:
> + descr = "8-bit Bayer GBRG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG8:
> + descr = "8-bit Bayer GRBG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB8:
> + descr = "8-bit Bayer RGGB MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR10:
> + descr = "10-bit Bayer BGGR MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG10:
> + descr = "10-bit Bayer GBRG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG10:
> + descr = "10-bit Bayer GRBG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB10:
> + descr = "10-bit Bayer RGGB MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR12:
> + descr = "12-bit Bayer BGGR MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG12:
> + descr = "12-bit Bayer GBRG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG12:
> + descr = "12-bit Bayer GRBG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB12:
> + descr = "12-bit Bayer RGGB MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR14:
> + descr = "14-bit Bayer BGGR MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG14:
> + descr = "14-bit Bayer GBRG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG14:
> + descr = "14-bit Bayer GRBG MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB14:
> + descr = "14-bit Bayer RGGB MTISP Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR8F:
> + descr = "8-bit Full-G Bayer BGGR Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG8F:
> + descr = "8-bit Full-G Bayer GBRG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG8F:
> + descr = "8-bit Full-G Bayer GRBG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB8F:
> + descr = "8-bit Full-G Bayer RGGB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR10F:
> + descr = "10-bit Full-G Bayer BGGR Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG10F:
> + descr = "10-bit Full-G Bayer GBRG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG10F:
> + descr = "10-bit Full-G Bayer GRBG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB10F:
> + descr = "10-bit Full-G Bayer RGGB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR12F:
> + descr = "12-bit Full-G Bayer BGGR Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG12F:
> + descr = "12-bit Full-G Bayer GBRG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG12F:
> + descr = "12-bit Full-G Bayer GRBG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB12F:
> + descr = "12-bit Full-G Bayer RGGB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SBGGR14F:
> + descr = "14-bit Full-G Bayer BGGR Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGBRG14F:
> + descr = "14-bit Full-G Bayer GBRG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRBG14F:
> + descr = "14-bit Full-G Bayer GRBG Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SRGGB14F:
> + descr = "14-bit Full-G Bayer RGGB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV12_10P:
> + descr = "Y/CbCr 4:2:0 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV21_10P:
> + descr = "Y/CrCb 4:2:0 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV16_10P:
> + descr = "Y/CbCr 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV61_10P:
> + descr = "Y/CrCb 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_YUYV10P:
> + descr = "YUYV 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_YVYU10P:
> + descr = "YVYU 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_UYVY10P:
> + descr = "UYVY 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_VYUY10P:
> + descr = "VYUY 4:2:2 10 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV12_12P:
> + descr = "Y/CbCr 4:2:0 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV21_12P:
> + descr = "Y/CrCb 4:2:0 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV16_12P:
> + descr = "Y/CbCr 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV61_12P:
> + descr = "Y/CrCb 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_YUYV12P:
> + descr = "YUYV 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_YVYU12P:
> + descr = "YVYU 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_UYVY12P:
> + descr = "UYVY 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_VYUY12P:
> + descr = "VYUY 4:2:2 12 bits packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV12_UFBC:
> + descr = "YCbCr 420 8 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV21_UFBC:
> + descr = "YCrCb 420 8 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV12_10_UFBC:
> + descr = "YCbCr 420 10 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV21_10_UFBC:
> + descr = "YCrCb 420 10 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV12_12_UFBC:
> + descr = "YCbCr 420 12 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_NV21_12_UFBC:
> + descr = "YCrCb 420 12 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_BAYER8_UFBC:
> + descr = "RAW 8 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_BAYER10_UFBC:
> + descr = "RAW 10 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_BAYER12_UFBC:
> + descr = "RAW 12 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_BAYER14_UFBC:
> + descr = "RAW 14 bits compress";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRB8F:
> + descr = "8-bit 3 plane GRB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRB10F:
> + descr = "10-bit 3 plane GRB Packed";
> + break;
> + case V4L2_PIX_FMT_MTISP_SGRB12F:
> + descr = "12-bit 3 plane GRB Packed";
> + break;
> + case V4L2_META_FMT_MTISP_PARAMS:
> + descr = "MTK ISP Tuning Metadata";
> + break;
> + case V4L2_META_FMT_MTISP_3A:
> + descr = "MTK 3A Statistics";
> + break;
> + case V4L2_META_FMT_MTISP_AF:
> + descr = "MTK AF Statistics";
> + break;
> + case V4L2_META_FMT_MTISP_LCS:
> + descr = "MTK LCS Statistics";
> + break;
> + case V4L2_META_FMT_MTISP_LMV:
> + descr = "MTK LMV Statistics";
> + break;
> + default:
> + descr = NULL;
> + break;
> + }
> +
> + if (descr)
> + WARN_ON(strscpy(fmt->description, descr, sz) < 0);
> +}
> +
More information about the Linux-mediatek
mailing list