Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp29051lql; Fri, 12 Apr 2024 02:36:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzrawSQOkojqm/erWgjYzLvWuzReuD6s2ljBOV1ayFDruR3tDsRRsvAQUjUWGpN+kzaTjJ/1PYANluqtN2EZDuxKzH4F9jrUn5RSB3lg== X-Google-Smtp-Source: AGHT+IEHaXqOYHRgdECfW8cg9xk1JLKPwJVXmtuNeK/NBE9m+t6jgrB4QjcOel0U67KlRsVXxfQk X-Received: by 2002:a17:902:7289:b0:1e4:45b8:7b6 with SMTP id d9-20020a170902728900b001e445b807b6mr1748153pll.48.1712914607937; Fri, 12 Apr 2024 02:36:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712914607; cv=pass; d=google.com; s=arc-20160816; b=ydjiINTkbtIIHAgj4DySHRaHA70T2mXI9ZiIEEbQSFjMljsYTzyLPZq/lC0sbpDm05 VXcaojZG4rE8E1bsFQyU7wwf94lnSVzs46ug0ZursU9XJxRWqRNzBNd7K+ElooVlGKLY KFDRIHt+qwBuH+5fxpNk0DsICHaPaLjth2+V6+4yFMVtrIk2wLsVL8D3NRVma/z4bZxn e5YltDArePPQj21SPy0f9BGVvgFdPZqmwDjgEReGNhlGVUtYmy+ky1dk/yh48C1PKRZ5 ehyxRojXGOtYlFw+Y/i7dy+UuroWPbdRK+3V908PNGVaYoqpwsQh+Fj07THQtMhTfy6V SPzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MdlmszlOGV3++fVcX5SghCa8DLzkLl13LYZ3klecxt8=; fh=+3keNzaSOvsaq+BXFM2IqKmKMiZV6QsxTCb//k4Cpek=; b=HtgMkQCQv0rJ7sm4gC5S1prcAwSlqZbueDPa7r/QJeB5tsVqFjKPJFOKWF76ydmeQ1 w4kGLDsaSXjYnfeo93pYPz0V80r2ErkyLw8I6q8NSFvdYyfDcQ+8eQ5leX9ad5Yf7pZH 2a2KPZmGm4FSVtYTxfiRX9RV7ARYF64+uZhiq2c9fjRZwZFXQPBxnXhAnKdsT8q6og3R Q8gNHxO1+1FQqYfrskmrSP7q1wUUXolhL2vd9vkflHuAuK+ZvX5Y0Ep+QotRRUrDPo0p TqbsKhlF6ImOj7IX9Kq7GS06HkfTA72w789StCuxfT4FgYHLI3WJQI8KAVDE7gq/aGle KeMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=sHnroF8L; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c7-20020a170902d48700b001e440345a33si2871953plg.25.2024.04.12.02.36.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=sHnroF8L; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B9FB7B258DB for ; Fri, 12 Apr 2024 09:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D8555823A; Fri, 12 Apr 2024 09:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="sHnroF8L" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B70D502AD; Fri, 12 Apr 2024 09:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912961; cv=none; b=WPlo0RL8I40cghZvb+DgiocDqxpsyGquuHZnGS7+VP4L1IJ8oCuWgQdsrrvEnkwyQH5NHNwFelKrR0loTjqLTE8Wzqo3wQml/xWM126qi6FdyWWCT5BJP0lLXdgU47uCcDNikgyKVHgLY0JmHVl6XpzUBNrLB/I1lUq3ty0o27k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912961; c=relaxed/simple; bh=xe9h3+1/pX6R3LzpjMMMxT9E+Vg0cmJ6JdDkqBFeQJI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PucJyQMEEw5IfdMyBg9jD/tl+0ffGqkV2SBZQx0N7q6jKHmgCyL1hSSO5f7fBocVTX0Utz2Z9B4eEwiMEFOvd+y3y4gq+cfmm5VXoDOanxgOlo9P1WsOvTxDX02THGbkmh8mGUzHuE61S99EVCtaySuUs0GDMmsv51JZS3EXKT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=sHnroF8L; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 571e090af8ac11ee935d6952f98a51a9-20240412 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=MdlmszlOGV3++fVcX5SghCa8DLzkLl13LYZ3klecxt8=; b=sHnroF8LwWAyRQWxbR8v5fK/7PGiEcOQhagMDn8e+1MZutV6N+RkiVCa4kvWCsPDgs8mWn7PsVMM6TBsawd36o5qtJnkuM0g+m29/MYgVyHoheg2jXUA8f3FKMC+v/f9V/EW1V5s90itmDUAlBu+39MP3u/B/9a2Lzp/7VlcevU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:d8449892-f453-4b1e-9ced-d5377c39759e,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:6f543d0,CLOUDID:92f09882-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 571e090af8ac11ee935d6952f98a51a9-20240412 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 155861169; Fri, 12 Apr 2024 17:09:17 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 12 Apr 2024 17:09:15 +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; Fri, 12 Apr 2024 17:09:14 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert , "Nicolas Dufresne" , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Tomasz Figa , "Mauro Carvalho Chehab" , Marek Szyprowski CC: Chen-Yu Tsai , Yong Wu , "Hsin-Yi Wang" , Fritz Koenig , "Daniel Vetter" , Steve Cho , Yunfei Dong , Sumit Semwal , "Brian Starkey" , John Stultz , "T . J . Mercier" , =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthias Brugger , , , , , , Subject: [PATCH v5,14/23] media: mediatek: vcodec: Add capture format to support one plane memory Date: Fri, 12 Apr 2024 17:08:42 +0800 Message-ID: <20240412090851.24999-15-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412090851.24999-1-yunfei.dong@mediatek.com> References: <20240412090851.24999-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--6.120000-8.000000 X-TMASE-MatchedRID: BYkBAcwd73tdleeOihB1yNRZ1mKTfKthFuNF4lJG6xuYFp2iw4hoIRFx R5JQAS6O09NQNrxIpFatD4//XDh+LAUJ2rQm9htlbc297PAGtWaFKXsoBdprwrKeTtOdjMy6dRd n4HVr0uVDbck/2A/BRp9JsZBi/4Xfo3S7Fgg29DXk7k9yXJiqquYQsENyzR2dCqIJhrrDy2984U qAu2N/TwBCE7zybeHUd+NxvU2qThikefSXk/iudY+YSzwl92XTVddk7QGQHad0fNeMnPMvbqPFj JEFr+olwXCBO/GKkVqOhzOa6g8KrW9wuXQxlwvGzbwKBo9i18YLVrY79GMMVg8IZ8MmPeCi8sDZ lqyKeh9DDKa3G4nrLQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.120000-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 9C0737311E0CC8CE8FFE9A34496F41C28A2D942C08BDB8F5D969299A7B7D8DDC2000:8 X-MTK: N Define one uncompressed capture format V4L2_PIX_FMT_MS21 in order to support one plane memory. The buffer size is luma + chroma, luma is stored at the start and chrome is stored at the end. Signed-off-by: Yunfei Dong --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 8 ++++++++ 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, 12 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index 886ba7b08d6b..6ec899649d50 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -295,6 +295,14 @@ please make a proposal on the linux-media mailing list. - Compressed format used by Nuvoton NPCM video driver. This format is defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile Encoding). + * .. _V4L2-PIX-FMT-MS21: + + - ``V4L2_PIX_FMT_MS21`` + - 'MS21' + - This format has one plane, luma and chroma are stored in a contiguous + memory. Luma pixel in 16x32 tiles at the start, chroma pixel in 16x16 + tiles at the end. The image height must be aligned with 32 and the image + width must be aligned with 16. .. raw:: latex \normalsize diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 4165c815faef..117a8f526f5f 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -271,6 +271,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) .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 }}, + { .format = V4L2_PIX_FMT_MS21, .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, + .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 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 5aeff5519407..dc7df3978e55 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1519,6 +1519,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_MT2110T: descr = "Mediatek 10bit Tile Mode"; break; case V4L2_PIX_FMT_MT2110R: descr = "Mediatek 10bit Raster Mode"; break; case V4L2_PIX_FMT_HEXTILE: descr = "Hextile Compressed Format"; break; + case V4L2_PIX_FMT_MS21: descr = "MediaTek One Plane Format"; break; default: if (fmt->description[0]) return; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index b6fbbd276bf1..419dec606bfe 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -798,6 +798,7 @@ struct v4l2_pix_format { #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_MS21 v4l2_fourcc('M', 'S', '2', '1') /* MediaTek 8-bit block mode with one plane */ #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 */ -- 2.18.0