From patchwork Fri May 7 07:46:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Kuo X-Patchwork-Id: 12244081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFC8EC433ED for ; Fri, 7 May 2021 07:48:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ACDD610A7 for ; Fri, 7 May 2021 07:48:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2ACDD610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XvVaC4Q/Wkgjiavs5E4R1mIo6XmOg6zIsJjFOH4i2xE=; b=JCaK8xvh+Vaj+fQmq+cP4q4Af /vGHgiYoqK1fEz/8AhllgZzqaqHAvCkr0MgewYnlwhGrXYm35BONWM2Y9a2Nn+wpCrrc0rsQAn6j5 gVt4LV75KPv7kS+KXi1BZ6TPe7cP4149v3Jvc/brpIHEIrQSlFPQjmDo74NGFxo1ikRzT9U9tKWCU 1IRNOG5VQlIrdzTGHPfD1wcKhMxWOg5dkySYLpmBHs3hFNu9WsIglQSpOzCjXPn4YR4KO4jX0WA/v SEZ695hHJMWJcMdRGG3uzAVMYsLFNw8zlxmPeT7kgDpiYK0urFADhHLDwVCxudyiwmM1CM5Vt5L8f VzoN8uB5w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1levCB-006Q3Z-FU; Fri, 07 May 2021 07:46:47 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levBp-006Pxo-Rb; Fri, 07 May 2021 07:46:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=WwMYQ2IuiYVaDlQUEYh1u+hDNYgPvb8T4Zs2rw57VZw=; b=n4aD+tFxyo2ZJWtc9IXrUJ4VU3 FsITtIp33sohNrI9xVq8/Sr/c8Eyu6Sw2hguCf9V46/MC/BeIoHAhIf3CNCGH+iXgD/mrxS+R0qF4 9prS+Y0NliWNcWrf2LAzp3E6aPiahtXBx99smVeAu37hFm5AkTSHOkui1pRjyfm+uWXgnmGGun2Yp W1Jd00WHJ2fR46GbpwR7mIgyAKLrDBMriTyc4EeKd+/gLIdnqXHJpTcQVDogsqHGWGjPi1vKUGhrc 19EJ3ZBEX3ZsAs1bhh5fRyyyROCDlS5sbFl/5CkKdbBTW659h8wN9bk5/VvlHC5NkXbyAciJkfUnI vE+xwzbg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levBm-006f9W-WF; Fri, 07 May 2021 07:46:24 +0000 X-UUID: 48893fd57db2479fae033508726af7a8-20210507 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=WwMYQ2IuiYVaDlQUEYh1u+hDNYgPvb8T4Zs2rw57VZw=; b=Ugz0I89edS+cnnkVTk5k/CUCJ68A6hqQI5/SsuOl+Ma8nLFlKsnr2Kraa8Y3w5SbVvZg569WL3LlDnSucFyFtnGN66YPK5N98C50N0A+WI6m6exZ5pcXpJEdSv7aTq6+AAJgtz5OdsrUlHTScftrpnYlktimDDcrliLO/0CXpc0=; X-UUID: 48893fd57db2479fae033508726af7a8-20210507 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 497224842; Fri, 07 May 2021 00:46:14 -0700 Received: from MTKMBS02N2.mediatek.inc (172.21.101.101) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 00:46:13 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 15:46:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 15:46:11 +0800 From: Louis Kuo To: , , , , , , , , , , CC: , , , , Subject: [RESENT PATCH V0 1/4] media: v4l2-core: extend the v4l2 format to support request Date: Fri, 7 May 2021 15:46:01 +0800 Message-ID: <20210507074604.15079-2-louis.kuo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507074604.15079-1-louis.kuo@mediatek.com> References: <20210507074604.15079-1-louis.kuo@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 1590EAC639185F97FF7E7A490355A9923F682F90A2528AD627AE965E692FF2B72000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_004623_072701_F2B90D57 X-CRM114-Status: GOOD ( 17.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is to extend the related interface to support the request-based operations. We added request fd to the parameters of MEDIA_IOC_SETUP_LINK, VIDIOC_S_FMT, VIDIOC_SUBDEV_S_SELECTION, VIDIOC_SUBDEV_S_FMT. The driver uses media_request_get_by_fd() to retrieve the media request and save the pending change in it, so that we can apply the pending change in req_queue() callback then. Signed-off-by: Louis Kuo --- drivers/media/mc/mc-device.c | 7 ++++++- drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++---- include/media/media-entity.h | 3 +++ include/uapi/linux/media.h | 3 ++- include/uapi/linux/v4l2-subdev.h | 3 ++- include/uapi/linux/videodev2.h | 8 ++++++-- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index 9e56d2ad6b94..f46ae4c38102 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -203,6 +203,7 @@ static long media_device_setup_link(struct media_device *mdev, void *arg) struct media_link *link = NULL; struct media_entity *source; struct media_entity *sink; + int ret; /* Find the source and sink entities and link. */ @@ -221,10 +222,14 @@ static long media_device_setup_link(struct media_device *mdev, void *arg) if (link == NULL) return -EINVAL; + link->request_fd = linkd->request_fd; memset(linkd->reserved, 0, sizeof(linkd->reserved)); /* Setup the link on both entities. */ - return __media_entity_setup_link(link, linkd->flags); + ret = __media_entity_setup_link(link, linkd->flags); + link->request_fd = 0; + + return ret; } static long media_device_get_topology(struct media_device *mdev, void *arg) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 2673f51aafa4..823ebd175f3a 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1634,7 +1634,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: if (unlikely(!ops->vidioc_s_fmt_vid_cap_mplane)) break; - CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); + CLEAR_AFTER_FIELD(p, fmt.pix_mp.request_fd); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); @@ -1665,7 +1665,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: if (unlikely(!ops->vidioc_s_fmt_vid_out_mplane)) break; - CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); + CLEAR_AFTER_FIELD(p, fmt.pix_mp.request_fd); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); @@ -1736,7 +1736,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: if (unlikely(!ops->vidioc_try_fmt_vid_cap_mplane)) break; - CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); + CLEAR_AFTER_FIELD(p, fmt.pix_mp.request_fd); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); @@ -1767,7 +1767,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: if (unlikely(!ops->vidioc_try_fmt_vid_out_mplane)) break; - CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func); + CLEAR_AFTER_FIELD(p, fmt.pix_mp.request_fd); for (i = 0; i < p->fmt.pix_mp.num_planes; i++) CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i], bytesperline); diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 09737b47881f..30ad665c4413 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -128,6 +128,8 @@ struct media_pipeline { * link. * @flags: Link flags, as defined in uapi/media.h (MEDIA_LNK_FL_*) * @is_backlink: Indicate if the link is a backlink. + * @request_fd: The media request triggered the media link change, it is only + * meaningful in media_device_setup_link() */ struct media_link { struct media_gobj graph_obj; @@ -145,6 +147,7 @@ struct media_link { struct media_link *reverse; unsigned long flags; bool is_backlink; + int request_fd; }; /** diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 200fa8462b90..a331f80afe2d 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -231,7 +231,8 @@ struct media_link_desc { struct media_pad_desc source; struct media_pad_desc sink; __u32 flags; - __u32 reserved[2]; + __s32 request_fd; + __u32 reserved[1]; }; struct media_links_enum { diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index 658106f5b5dc..d6ffd5981c68 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -50,7 +50,8 @@ struct v4l2_subdev_format { __u32 which; __u32 pad; struct v4l2_mbus_framefmt format; - __u32 reserved[8]; + __s32 request_fd; + __u32 reserved[7]; }; /** diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 311a01cc5775..6641194b3fab 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1246,6 +1246,7 @@ struct v4l2_crop { * defined in v4l2-common.h; V4L2_SEL_TGT_* . * @flags: constraints flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*. * @r: coordinates of selection window + * @request_fd: fd of the request that trigger the set selection operation * @reserved: for future use, rounds structure size to 64 bytes, set to zero * * Hardware may use multiple helper windows to process a video stream. @@ -1257,7 +1258,8 @@ struct v4l2_selection { __u32 target; __u32 flags; struct v4l2_rect r; - __u32 reserved[9]; + __s32 request_fd; + __u32 reserved[8]; }; @@ -2266,6 +2268,7 @@ struct v4l2_plane_pix_format { * @hsv_enc: enum v4l2_hsv_encoding, HSV encoding * @quantization: enum v4l2_quantization, colorspace quantization * @xfer_func: enum v4l2_xfer_func, colorspace transfer function + * @request_fd: fd of the request that trigger the set format operation * @reserved: drivers and applications must zero this array */ struct v4l2_pix_format_mplane { @@ -2284,7 +2287,8 @@ struct v4l2_pix_format_mplane { }; __u8 quantization; __u8 xfer_func; - __u8 reserved[7]; + __s32 request_fd; + __u8 reserved[3]; } __attribute__ ((packed)); /** From patchwork Fri May 7 07:46:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Kuo X-Patchwork-Id: 12244083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE83DC433B4 for ; Fri, 7 May 2021 07:50:55 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75334610A7 for ; Fri, 7 May 2021 07:50:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75334610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GQkHEtryVsdihP1fz0iXkHqQ+aL8ojS6EYBcd0Qm9EA=; b=LcKxwpdl0CmKB+1jsEWG2gYEA /XwiFK1B2kirRLSRS2HZYAn/bv6CHJKnZAxyxHd/AzKCQsScRkE0Coid3IJICShiQWvupKcObfuxG dkTN+eX/3kbyyr0LRJ5mT/ohPjrLSpiaB9ikvFTPtUEZ1PWMBTbdCDjgljq3QgoTBj9v6Dcsm6jHy 7TaBCv0AVnegNJto/4qNjoIOP/oVIScp89tq9ZlaNoAvYc8tdsgfkshOKdiYzQBsXr0hLpvbJjAAj cSPPKz5bu/OpLmMLQcMzQhlLbgHgsl+VoPgZNqt2qF0mJQt3wFfSes7xUj1EKRifZm9Raj+omSZ1s 4T0CoKNcQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1levEs-006Qj7-Jf; Fri, 07 May 2021 07:49:34 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levEo-006Qi4-3r; Fri, 07 May 2021 07:49:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=HpFFAA7D7YLKW/xr0/02UbHBDzZwW06dnz24tC2b6k4=; b=0Riz8PLvTFqITsjMUt7D0NE+6J H6jFOFmxTqbGGR8wsNkNxyFChB1JAp68yG44wsx6/F4oXS+lr90w/D+7Xw0JnR60VHMcZKu80xw1H hcjMuaLMe8HUjyZaqG7QLj5qshqzKfd9j0yDL3CV6bec/z1NkngdWJsa/XGmYKOb4hgl0CnePHzZp rjWX5MW7iPA5grnVybmZXcHMOVE7GwMNejdP4APbt3FA5ADvUhjf3kjodlepMeDKTMFT1/iykSHJA mZOnIZaS3YLh3J7bAnpCD8QJkH1G/A8lRwEQ1RKbnzmDGtfxn/3VXgJHxqOli1lM0aT/fd0gWu5Aq rvrEUZ2A==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levEk-006fJK-VX; Fri, 07 May 2021 07:49:28 +0000 X-UUID: 8a24c3ea048242c59ba8ac61854e812b-20210507 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=HpFFAA7D7YLKW/xr0/02UbHBDzZwW06dnz24tC2b6k4=; b=qa1jQMQFQduAGpzaSczp3nL05KYnrZsrAyMxgiSv4wDXiO7RepR/kWcMxHJvwC+Z7u6WoaLYOji46TqpXdec1ba7Z0UraDz4Etv9TG49hGYU4rF82z3M+m/9xcY5I+hk9tYH+qDMSs1R3oYUZnDhF00wkzANovv6/UX+nLyL2I0=; X-UUID: 8a24c3ea048242c59ba8ac61854e812b-20210507 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1898311543; Fri, 07 May 2021 00:49:25 -0700 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 00:46:13 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 15:46:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 15:46:11 +0800 From: Louis Kuo To: , , , , , , , , , , CC: , , , , Subject: [RESENT PATCH V0 2/4] media: subdev: support which in v4l2_subdev_frame_interval Date: Fri, 7 May 2021 15:46:02 +0800 Message-ID: <20210507074604.15079-3-louis.kuo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507074604.15079-1-louis.kuo@mediatek.com> References: <20210507074604.15079-1-louis.kuo@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_004927_039975_F4B64717 X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is to support try or set of VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL through which parameter. This behavior is already supported in some similar V4L2 IOCTLs such as VIDIOC_SUBDEV_ENUM_FRAME_SIZE for the same reason. Signed-off-by: Louis Kuo --- include/uapi/linux/v4l2-subdev.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index d6ffd5981c68..9d64feaa693b 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -120,12 +120,13 @@ struct v4l2_subdev_frame_size_enum { * struct v4l2_subdev_frame_interval - Pad-level frame rate * @pad: pad number, as reported by the media API * @interval: frame interval in seconds - * @reserved: drivers and applications must zero this array + * @which: format type (from enum v4l2_subdev_format_whence) */ struct v4l2_subdev_frame_interval { __u32 pad; struct v4l2_fract interval; - __u32 reserved[9]; + __u32 which; + __u32 reserved[8]; }; /** From patchwork Fri May 7 07:46:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Kuo X-Patchwork-Id: 12244079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97ACBC433ED for ; Fri, 7 May 2021 07:48:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C809613C2 for ; Fri, 7 May 2021 07:48:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C809613C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NoQ/Pq5LadCpZHZx3LY3BHjmNkyWlAZGM3+7AZU4b7Y=; b=VYZoBwOjFhecwwkVq/93doJua EU9tCg6STrhbB8m3f/2roI4y8RPrtgLvYhzNHIif09ylSclPdhh1VYHFfSkwyd471ORmR0NEktWL5 jziFaZwcQzN/2zI2BrOJnI8rdbyARrzF8GQfigMoKyHkLoMDkErbRGAH38F27b19ZI36yjyP/w1Ai uotXSxeNjtP7/2CeX9hK2Hjt9FCFTnfwLzmpvuqJFGjiqBLzYSke2AI/ZEc1CiH1/81AAQxvuaDzD fuivfGetbs1EA1pT0ze2ilzLt6PAlOKNDCMdXXYJJqT0KPU5FfUWthemhicM4N9PFXKZc8/PzQaIG EldWsBz4w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1levC1-006Q0W-6z; Fri, 07 May 2021 07:46:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levBp-006Pxe-9c; Fri, 07 May 2021 07:46:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=nq22+gWwcmKMv5WSbTh6PmbcQeaBas8aQfnLYMcStYI=; b=oK/f/ptJEH1Z33p1g7hitkExtG hp0Rlq6yHuSj5m/p7UiyCMnhYYDY6nASihrOuC9Mkye+ylYTET+s1AXY6UwKo7pmk+njUSkT1EDKJ nuelwPa2FHa9XyFP6NanGex4mui0Q+hkMPx+HpHoejXKtBo6WFlF3Mt0Vl9u3VcOydtSL35k+I1Db z8i4dzOromrO3uBunK3ebwKi4XCSCCp2aL9IjwS09JxlkWjT1i0c2eZNcKwkJ5MZArXJXycp/ex8l kWtmVqwgVJTHbvjH1jI+v7Bq6uXmaukhfT1ZrAgyeZRFSzy3zfPha6Hjk6Uk4muRdfgi9sw7J1NaB dSwt6Vwg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levBm-006f9V-Ml; Fri, 07 May 2021 07:46:24 +0000 X-UUID: cfd30ed0117748628f7e6a39e87b14a3-20210507 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=nq22+gWwcmKMv5WSbTh6PmbcQeaBas8aQfnLYMcStYI=; b=fC5/waCwAYlOAPAMIyR3TJ56cOmSlILpKfclzsAqlS6PVNDBvoqgR8sDRChATYmRTDY6HuUOOU8sQOPTbZQTQdz7ZfKLywqoz62cr2XY+iw03moK+dwAUwHerrNqKRUzMOjmVwWE/fRGbob+kcUwpUJXBL88pur2gb5zW46IUd4=; X-UUID: cfd30ed0117748628f7e6a39e87b14a3-20210507 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1266612406; Fri, 07 May 2021 00:46:15 -0700 Received: from MTKMBS02N2.mediatek.inc (172.21.101.101) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 00:46:14 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 15:46:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 15:46:11 +0800 From: Louis Kuo To: , , , , , , , , , , CC: , , , , Subject: [RESENT PATCH V0 3/4] media: v4l2-ctrl: Add ISP Camsys user control Date: Fri, 7 May 2021 15:46:03 +0800 Message-ID: <20210507074604.15079-4-louis.kuo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507074604.15079-1-louis.kuo@mediatek.com> References: <20210507074604.15079-1-louis.kuo@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 6BA450B502D3B2C084112B9B12478CCC6F63A90150F67F045AFBCA2C6778DB472000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_004622_769428_7CB9FBCD X-CRM114-Status: GOOD ( 10.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is to add V4L2_CID_USER_MTK_CAM_BASE for Mediatek ISP-only features. For example, we have some hits from user to let driver select internal path and resource usage. (e.g. use multiple engine or bining the image or use higher clk and power). Signed-off-by: Louis Kuo --- include/uapi/linux/v4l2-controls.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index d43bec5f1afd..5f664b98fc58 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -194,6 +194,10 @@ enum v4l2_colorfx { * We reserve 16 controls for this driver. */ #define V4L2_CID_USER_IMX_BASE (V4L2_CID_USER_BASE + 0x10b0) +/* The base for the mediatek camsys driver controls */ +/* We reserve 48 controls for this driver. */ +#define V4L2_CID_USER_MTK_CAM_BASE (V4L2_CID_USER_BASE + 0x10d0) + /* * The base for the atmel isc driver controls. * We reserve 32 controls for this driver. From patchwork Fri May 7 07:46:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Kuo X-Patchwork-Id: 12244087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0737C433ED for ; Fri, 7 May 2021 07:51:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55D666142D for ; Fri, 7 May 2021 07:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55D666142D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ppgAkv5n0eH4o/t0Dez+aoUgNPid9cZP/1fEbzi5Xvc=; b=X9QozKK7J//fZ8iAVYSucidyK YnHSPgou05RdwULVPp3JNQUulnbxZ4LZfXgH/LBPNVjOFuVlb/ZVxloIzcb1UBz+WowQGtflFZgRI c7k64zhd2N1028Ywp4QkHIv2/YTGGUOHuZUP3EuDyjf88knuvThxgdbfHPM4ft1oVJSIs/1ojXxxH pcuH/JB1OBVxESM3QGtCFo9Ptf+RzwNwdCb4AY2YNsQiYUpLwjTlW46Tt4wtbTd+3flW16AiAEleL BZEnlgF0hFztYcvaIdMfSS93+wacdWnHgRvwRby2ocDtsKXAReP+iDif8P/z0KIPsHBVaQ/LAED/2 9f9AEwrkg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1levFK-006Qpk-Li; Fri, 07 May 2021 07:50:02 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levEp-006QiU-VZ; Fri, 07 May 2021 07:49:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=KNnUA6V6+eBMeqrvnHn7hFApZozuNBmSCEONxX0zPCQ=; b=AgQQNn62gpCQHZ/tHGvLZeogtZ iTyXEgW3EWSXajIp4XQJ08g3jQfON/HY6avN8n715JN3szF0l4hlNpSybB3in9HGjxrByRE9iukP3 OazJaGhU7vNDbi5qih5eaMhdiNkzoCe8XQRBVf1zkDw5HVvn8UGHtKRoJgB2BQaEAJjgtpeLjaKlq 9R6L5xNwP77Z/+NE8l+lZt/ZR0q4FwNlkLO7GOwBzJd/BMLdhyJG8rF14a02Ybn943IuUZFBgW+Jj ANFC5jULL16j2YOJsKs2pN3WeAXdJVfh6833fTu9c7QkswzraSrPgS5m2AaJe10skP/jJCSluMpqB f+KBSuXQ==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1levEm-006fJK-Hg; Fri, 07 May 2021 07:49:30 +0000 X-UUID: 9d60adad95d64811af33b4dc2abe0e22-20210507 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=KNnUA6V6+eBMeqrvnHn7hFApZozuNBmSCEONxX0zPCQ=; b=iIMhQi/LScKuUaz3fon4W9y6TwCym+UBDmylnxJkcgWzr2ECvJuNvLTotBxY3ij9WVnYnINKm5DERxvICN9xzwmaD5pY8PSAMhLuvAg2COQF3+q62ob6NM1tROwIo2pTuhbn3/XzvUNWNx+giiM3WJOVqrn79rgbBN7DZo90vXA=; X-UUID: 9d60adad95d64811af33b4dc2abe0e22-20210507 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 788091128; Fri, 07 May 2021 00:49:25 -0700 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 00:46:13 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 15:46:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 15:46:11 +0800 From: Louis Kuo To: , , , , , , , , , , CC: , , , , Subject: [RESENT PATCH V0 4/4] media: pixfmt: Add ISP Camsys formats Date: Fri, 7 May 2021 15:46:04 +0800 Message-ID: <20210507074604.15079-5-louis.kuo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507074604.15079-1-louis.kuo@mediatek.com> References: <20210507074604.15079-1-louis.kuo@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_004928_625488_C7FAB6B9 X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add packed bayer formats with 10/12/14 bit for image output. Add packed/unpacked yuv formats with 10/12 bit for image output. Add specific meta formats for parameter processing and 3A/other statistics. Signed-off-by: Louis Kuo --- drivers/media/v4l2-core/v4l2-ioctl.c | 145 ++++++++++++++++++++++++++- include/uapi/linux/videodev2.h | 101 +++++++++++++++++++ 2 files changed, 245 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 823ebd175f3a..00dba596893a 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1259,6 +1259,30 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_YVYU: descr = "YVYU 4:2:2"; break; case V4L2_PIX_FMT_UYVY: descr = "UYVY 4:2:2"; break; case V4L2_PIX_FMT_VYUY: descr = "VYUY 4:2:2"; break; + case V4L2_PIX_FMT_YUYV10: + descr = "YUYV 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_YVYU10: + descr = "YVYU 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_UYVY10: + descr = "UYVY 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_VYUY10: + descr = "VYUY 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_YUYV12: + descr = "YUYV 4:2:2 12 bits"; + break; + case V4L2_PIX_FMT_YVYU12: + descr = "YVYU 4:2:2 12 bits"; + break; + case V4L2_PIX_FMT_UYVY12: + descr = "UYVY 4:2:2 12 bits"; + break; + case V4L2_PIX_FMT_VYUY12: + descr = "VYUY 4:2:2 12 bits"; + break; case V4L2_PIX_FMT_YUV422P: descr = "Planar YUV 4:2:2"; break; case V4L2_PIX_FMT_YUV411P: descr = "Planar YUV 4:1:1"; break; case V4L2_PIX_FMT_Y41P: descr = "YUV 4:1:1 (Packed)"; break; @@ -1282,6 +1306,30 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_NV61: descr = "Y/CrCb 4:2:2"; break; case V4L2_PIX_FMT_NV24: descr = "Y/CbCr 4:4:4"; break; case V4L2_PIX_FMT_NV42: descr = "Y/CrCb 4:4:4"; break; + case V4L2_PIX_FMT_NV12_10: + descr = "Y/CbCr 4:2:0 10 bits"; + break; + case V4L2_PIX_FMT_NV21_10: + descr = "Y/CrCb 4:2:0 10 bits"; + break; + case V4L2_PIX_FMT_NV16_10: + descr = "Y/CbCr 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_NV61_10: + descr = "Y/CrCb 4:2:2 10 bits"; + break; + case V4L2_PIX_FMT_NV12_12: + descr = "Y/CbCr 4:2:0 12 bits"; + break; + case V4L2_PIX_FMT_NV21_12: + descr = "Y/CrCb 4:2:0 12 bits"; + break; + case V4L2_PIX_FMT_NV16_12: + descr = "Y/CbCr 4:2:2 12 bits"; + break; + case V4L2_PIX_FMT_NV61_12: + descr = "Y/CrCb 4:2:2 12 bits"; + break; case V4L2_PIX_FMT_NV12M: descr = "Y/CbCr 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_NV21M: descr = "Y/CrCb 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_NV16M: descr = "Y/CbCr 4:2:2 (N-C)"; break; @@ -1348,6 +1396,90 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_KONICA420: descr = "GSPCA KONICA420"; break; case V4L2_PIX_FMT_HSV24: descr = "24-bit HSV 8-8-8"; break; case V4L2_PIX_FMT_HSV32: descr = "32-bit XHSV 8-8-8-8"; 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_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_SDR_FMT_CU8: descr = "Complex U8"; break; case V4L2_SDR_FMT_CU16LE: descr = "Complex U16LE"; break; case V4L2_SDR_FMT_CS8: descr = "Complex S8"; break; @@ -1367,7 +1499,18 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_META_FMT_VIVID: descr = "Vivid Metadata"; break; case V4L2_META_FMT_RK_ISP1_PARAMS: descr = "Rockchip ISP1 3A Parameters"; break; case V4L2_META_FMT_RK_ISP1_STAT_3A: descr = "Rockchip ISP1 3A Statistics"; break; - + case V4L2_META_FMT_MTISP_AF: + descr = "AF Histogram"; + break; + case V4L2_META_FMT_MTISP_LCS: + descr = "Local Contrast Enhancement Stat"; + break; + case V4L2_META_FMT_MTISP_LMV: + descr = "Local Motion Vector Histogram"; + break; + case V4L2_META_FMT_MTISP_PARAMS: + descr = "MTK ISP Tuning Metadata"; + break; default: /* Compressed formats */ flags = V4L2_FMT_FLAG_COMPRESSED; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 6641194b3fab..c86ab1c18284 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -593,6 +593,22 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ #define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ +#define V4L2_PIX_FMT_YUYV10 v4l2_fourcc('Y', 'U', 'Y', 'A') +/* 16 YUV 4:2:2 10-bit */ +#define V4L2_PIX_FMT_YVYU10 v4l2_fourcc('Y', 'V', 'Y', 'A') +/* 16 YUV 4:2:2 10-bit */ +#define V4L2_PIX_FMT_UYVY10 v4l2_fourcc('U', 'Y', 'V', 'A') +/* 16 YUV 4:2:2 10-bit */ +#define V4L2_PIX_FMT_VYUY10 v4l2_fourcc('V', 'Y', 'U', 'A') +/* 16 YUV 4:2:2 10-bit */ +#define V4L2_PIX_FMT_YUYV12 v4l2_fourcc('Y', 'U', 'Y', 'C') +/* 16 YUV 4:2:2 12-bit */ +#define V4L2_PIX_FMT_YVYU12 v4l2_fourcc('Y', 'V', 'Y', 'C') +/* 16 YUV 4:2:2 12-bit */ +#define V4L2_PIX_FMT_UYVY12 v4l2_fourcc('U', 'Y', 'V', 'C') +/* 16 YUV 4:2:2 12-bit */ +#define V4L2_PIX_FMT_VYUY12 v4l2_fourcc('V', 'Y', 'U', 'C') +/* 16 YUV 4:2:2 12-bit */ /* two planes -- one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ @@ -602,6 +618,22 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */ #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */ #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ +#define V4L2_PIX_FMT_NV12_10 v4l2_fourcc('1', '2', 'A', 'U') + /* 12 Y/CbCr 4:2:0 10 bits un-packed */ +#define V4L2_PIX_FMT_NV21_10 v4l2_fourcc('2', '1', 'A', 'U') + /* 12 Y/CrCb 4:2:0 10 bits un-packed */ +#define V4L2_PIX_FMT_NV16_10 v4l2_fourcc('1', '6', 'A', 'U') + /* 16 Y/CbCr 4:2:2 10 bits un-packed */ +#define V4L2_PIX_FMT_NV61_10 v4l2_fourcc('6', '1', 'A', 'U') + /* 16 Y/CrCb 4:2:2 10 bits un-packed */ +#define V4L2_PIX_FMT_NV12_12 v4l2_fourcc('1', '2', 'C', 'U') + /* 12 Y/CbCr 4:2:0 12 bits un-packed */ +#define V4L2_PIX_FMT_NV21_12 v4l2_fourcc('2', '1', 'C', 'U') + /* 12 Y/CrCb 4:2:0 12 bits un-packed */ +#define V4L2_PIX_FMT_NV16_12 v4l2_fourcc('1', '6', 'C', 'U') + /* 16 Y/CbCr 4:2:2 12 bits un-packed */ +#define V4L2_PIX_FMT_NV61_12 v4l2_fourcc('6', '1', 'C', 'U') + /* 16 Y/CrCb 4:2:2 12 bits un-packed */ /* two non contiguous planes - one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ @@ -743,6 +775,75 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */ #define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */ #define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */ + /* Vendor specific - Mediatek ISP bayer formats */ +#define V4L2_PIX_FMT_MTISP_SBGGR10 v4l2_fourcc('M', 'B', 'B', 'A') + /* Packed 10-bit */ +#define V4L2_PIX_FMT_MTISP_SGBRG10 v4l2_fourcc('M', 'B', 'G', 'A') + /* Packed 10-bit */ +#define V4L2_PIX_FMT_MTISP_SGRBG10 v4l2_fourcc('M', 'B', 'g', 'A') + /* Packed 10-bit */ +#define V4L2_PIX_FMT_MTISP_SRGGB10 v4l2_fourcc('M', 'B', 'R', 'A') + /* Packed 10-bit */ +#define V4L2_PIX_FMT_MTISP_SBGGR12 v4l2_fourcc('M', 'B', 'B', 'C') + /* Packed 12-bit */ +#define V4L2_PIX_FMT_MTISP_SGBRG12 v4l2_fourcc('M', 'B', 'G', 'C') + /* Packed 12-bit */ +#define V4L2_PIX_FMT_MTISP_SGRBG12 v4l2_fourcc('M', 'B', 'g', 'C') + /* Packed 12-bit */ +#define V4L2_PIX_FMT_MTISP_SRGGB12 v4l2_fourcc('M', 'B', 'R', 'C') + /* Packed 12-bit */ +#define V4L2_PIX_FMT_MTISP_SBGGR14 v4l2_fourcc('M', 'B', 'B', 'E') + /* Packed 14-bit */ +#define V4L2_PIX_FMT_MTISP_SGBRG14 v4l2_fourcc('M', 'B', 'G', 'E') + /* Packed 14-bit */ +#define V4L2_PIX_FMT_MTISP_SGRBG14 v4l2_fourcc('M', 'B', 'g', 'E') + /* Packed 14-bit */ +#define V4L2_PIX_FMT_MTISP_SRGGB14 v4l2_fourcc('M', 'B', 'R', 'E') + /* Packed 14-bit */ +/* Vendor specific - Mediatek Luminance+Chrominance formats */ +#define V4L2_PIX_FMT_MTISP_YUYV10P v4l2_fourcc('Y', 'U', 'A', 'P') +/* YUV 4:2:2 10-bit packed */ +#define V4L2_PIX_FMT_MTISP_YVYU10P v4l2_fourcc('Y', 'V', 'A', 'P') +/* YUV 4:2:2 10-bit packed */ +#define V4L2_PIX_FMT_MTISP_UYVY10P v4l2_fourcc('U', 'Y', 'A', 'P') +/* YUV 4:2:2 10-bit packed */ +#define V4L2_PIX_FMT_MTISP_VYUY10P v4l2_fourcc('V', 'Y', 'A', 'P') +/* YUV 4:2:2 10-bit packed */ +#define V4L2_PIX_FMT_MTISP_NV12_10P v4l2_fourcc('1', '2', 'A', 'P') +/* Y/CbCr 4:2:0 10 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV21_10P v4l2_fourcc('2', '1', 'A', 'P') +/* Y/CrCb 4:2:0 10 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV16_10P v4l2_fourcc('1', '6', 'A', 'P') +/* Y/CbCr 4:2:2 10 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV61_10P v4l2_fourcc('6', '1', 'A', 'P') +/* Y/CrCb 4:2:2 10 bits packed */ +#define V4L2_PIX_FMT_MTISP_YUYV12P v4l2_fourcc('Y', 'U', 'C', 'P') +/* YUV 4:2:2 12-bit packed */ +#define V4L2_PIX_FMT_MTISP_YVYU12P v4l2_fourcc('Y', 'V', 'C', 'P') +/* YUV 4:2:2 12-bit packed */ +#define V4L2_PIX_FMT_MTISP_UYVY12P v4l2_fourcc('U', 'Y', 'C', 'P') +/* YUV 4:2:2 12-bit packed */ +#define V4L2_PIX_FMT_MTISP_VYUY12P v4l2_fourcc('V', 'Y', 'C', 'P') +/* YUV 4:2:2 12-bit packed */ +#define V4L2_PIX_FMT_MTISP_NV12_12P v4l2_fourcc('1', '2', 'C', 'P') +/* Y/CbCr 4:2:0 12 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV21_12P v4l2_fourcc('2', '1', 'C', 'P') +/* Y/CrCb 4:2:0 12 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV16_12P v4l2_fourcc('1', '6', 'C', 'P') +/* Y/CbCr 4:2:2 12 bits packed */ +#define V4L2_PIX_FMT_MTISP_NV61_12P v4l2_fourcc('6', '1', 'C', 'P') +/* Y/CrCb 4:2:2 12 bits packed */ +/* Vendor specific - Mediatek ISP parameters for firmware */ +#define V4L2_META_FMT_MTISP_PARAMS v4l2_fourcc('M', 'T', 'f', 'p') + /* ISP tuning parameters */ +#define V4L2_META_FMT_MTISP_3A v4l2_fourcc('M', 'T', 'f', 'a') + /* AE/AWB histogram */ +#define V4L2_META_FMT_MTISP_AF v4l2_fourcc('M', 'T', 'f', 'f') + /* AF histogram */ +#define V4L2_META_FMT_MTISP_LCS v4l2_fourcc('M', 'T', 'f', 'c') + /* Local contrast enhanced statistics */ +#define V4L2_META_FMT_MTISP_LMV v4l2_fourcc('M', 'T', 'f', 'm') + /* Local motion vector histogram */ /* SDR formats - used only for Software Defined Radio devices */ #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */