From patchwork Tue Jul 11 12:57:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 118506 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp458925vqm; Tue, 11 Jul 2023 06:02:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHqHCU9PoH22Y+/DvIfIbFWtFboR9wBT9M7uxOGM9rpfppMzQ1wknBvgsDJErM88jIYekf X-Received: by 2002:a05:6a00:b51:b0:668:8545:cbeb with SMTP id p17-20020a056a000b5100b006688545cbebmr22071921pfo.15.1689080550959; Tue, 11 Jul 2023 06:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689080550; cv=none; d=google.com; s=arc-20160816; b=r5pArqrQ2GaOL3Ppd2AlO69sHizc69g92CWv+7KxbaqpXaBmi5F2i3Ts31R5FSredq VA7NnsnvWAbooY96zil0Q4r0e9ZV/zwehYWaKaGRxQxSWDTPFsQUwh65zFsw7UrjOEqm RmqJo5ZBlypbygody7IudqMVxnov+LeDa/xOKb/dADs9Btpka9OHpHVurQMdxk70XsHC mgPFldO82YtF/IBEEfyB6QW11cpUETqlg3NrLymYRkyQxvbNmojKP7tI9OQsR84Urlmv VzXOKMNr/Ez2g8WTwfzFcr+Fu5lzFCpaMWnWcRJ3sqK7W7bljqjxsUFIXReHEHgEPDfx 17wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eIY64OJ16PWkOviKweK04HJ+AS1S+mU7TE5PV56TFpk=; fh=xPbS+/DX5PtuKYqmiu+tTQOaqnNR82bA60iDNSNQ7fo=; b=RJXvxQBk9n/gVEqILjQvO5eOMvcaOYAUrxjgZRJxgPKx1mTqXT9tp/UYVlxVCDirUD yQbN6MMx41nKbb0vEh1eAogqumEA+PyoTDNiMe8lqR0fMQFRhtvSd05alvh//tBEWrFp ptJfDKhJonW4eUtRmFRDwKWOJoHKM6N9rXlDry7ryVw7XjV9bu3s2V8BAWX7Sf8TKyqf gmjlgyn/lbVUOhhPl1aw7OCwWo3WvqXjfP4WIpFv1gQH0/JRoyzcxu9dHP9B8rC/pjo4 zlReUWKsDAzgU1m0SsUnOcehtkDN9ZrJQYoPV+fT694TR6nrcgDP9DrBcMbaQMKR0B/1 4LbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SCgJWLxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056a000cd400b00682d7cb12cesi1482519pfv.309.2023.07.11.06.02.14; Tue, 11 Jul 2023 06:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SCgJWLxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232623AbjGKM6i (ORCPT + 99 others); Tue, 11 Jul 2023 08:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbjGKM6a (ORCPT ); Tue, 11 Jul 2023 08:58:30 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3948310EF; Tue, 11 Jul 2023 05:57:59 -0700 (PDT) X-UUID: 8d0cdbe01fea11ee9cb5633481061a41-20230711 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=eIY64OJ16PWkOviKweK04HJ+AS1S+mU7TE5PV56TFpk=; b=SCgJWLxk/+fDaEBwLbaWdplYFT7GGhm8KevyFhvqQILcyDpVc50aLBeztFCJF0lOz0EpK8rC5pVCCPNXWwVu0exBKQxGARYbqB3jwNQ6/l57UkgTNC7tSs4SfEh4cZIFNoDDTNn8agE+WBNce+lUavlBAS8bfK/z+x9rT6mSSQo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.28,REQID:c3c785dc-2445-41db-ad7d-7dc74a362b56,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:176cd25,CLOUDID:f4641c0e-c22b-45ab-8a43-3004e9216b56,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 8d0cdbe01fea11ee9cb5633481061a41-20230711 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1096585677; Tue, 11 Jul 2023 20:57:54 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 11 Jul 2023 20:57:53 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 11 Jul 2023 20:57:52 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert CC: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , Mingjia Zhang , , , , , , Subject: [PATCH 2/3] media: mediatek: vcodec: Add capture format to support 10bit raster mode Date: Tue, 11 Jul 2023 20:57:48 +0800 Message-ID: <20230711125749.15555-3-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230711125749.15555-1-yunfei.dong@mediatek.com> References: <20230711125749.15555-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771129328280750630 X-GMAIL-MSGID: 1771129328280750630 From: Mingjia Zhang Define one uncompressed capture format V4L2_PIX_FMT_MT2110R in order to support 10bit for H264 in mt8195. Signed-off-by: Mingjia Zhang Co-developed-by: Yunfei Dong Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 7 +++++++ drivers/media/v4l2-core/v4l2-common.c | 2 ++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 4 files changed, 11 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index b16a7257580c..175dc790ae17 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -283,6 +283,13 @@ please make a proposal on the linux-media mailing list. and more. This format have similitude with ``V4L2_PIX_FMT_MM21``. It remains an opaque intermediate format and it is used for VP9, AV1 and HEVC. + * .. _V4L2-PIX-FMT-MT2110R: + + - ``V4L2_PIX_FMT_MT2110R`` + - 'MT2110R' + - Two-planar 10-Bit raster mode YVU420 format used by Mediatek MT8195, MT8188 + and more. This format have similitude with ``V4L2_PIX_FMT_MM21``. + It remains an opaque intermediate format and it is used for AVC. .. raw:: latex \normalsize diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 869fc09a210b..3a4b15a98e02 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -264,6 +264,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_YUV48_12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 }, { .format = V4L2_PIX_FMT_MT2110T, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2, .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }}, + { .format = V4L2_PIX_FMT_MT2110R, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2, + .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }}, /* YUV planar formats */ { .format = V4L2_PIX_FMT_NV12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f465c0e3d6e3..f4d9d6279094 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1509,6 +1509,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_AJPG: descr = "Aspeed JPEG"; break; case V4L2_PIX_FMT_AV1_FRAME: descr = "AV1 Frame"; break; case V4L2_PIX_FMT_MT2110T: descr = "Mediatek 10bit Tile Mode"; break; + case V4L2_PIX_FMT_MT2110R: descr = "Mediatek 10bit Raster Mode"; break; default: if (fmt->description[0]) return; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 8c7d71afbdc7..78260e5d9985 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -797,6 +797,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ #define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */ #define V4L2_PIX_FMT_MT2110T v4l2_fourcc('M', 'T', '2', 'T') /* Mediatek 10-bit block tile mode */ +#define V4L2_PIX_FMT_MT2110R v4l2_fourcc('M', 'T', '2', 'R') /* Mediatek 10-bit block raster mode */ #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */