Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp891489lqp; Thu, 23 May 2024 03:16:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUi4E97KpmneW6D3DZXIA5iXQtoHMubo38H3Ahio9kPPCH9G1SLb34M/7yua45uNMBk6ODg4OfRMl4koDUVxjWD5RTJ80vbAAMnp0Q5hQ== X-Google-Smtp-Source: AGHT+IHt7NQi1r9xMHzXLHyOjv1c1vyxgKZx0EAOlQwrQsK94s2Pm0vlGqHlGvgNZ2CNWP7WrC2t X-Received: by 2002:a05:6870:f14e:b0:23c:5f20:83a2 with SMTP id 586e51a60fabf-24c68d091damr5046797fac.14.1716459368699; Thu, 23 May 2024 03:16:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716459368; cv=pass; d=google.com; s=arc-20160816; b=L5fML0EFSMin2HU4Ns6cZdAp9gSGRvXr3icgby7ZCtfuATJfv8Nu1O+nkvbPmqldVE kQYZ6u8iexY9fRAc7xywcwTLcoCO4jClRus9fmZkB0oou+3bxECpRdQZnrl6Buotwk6O 8GvwMm2GGrCcp2uE0OjAUDUuqlBBT8dvmz8WVD1oqkJWTK/EG2+phem+ePifnHUrJm01 f48c7va6ywyhKgoOV+OiZqK3MPeaKeJ8jhfXtpA0GJIQ7/2cwuzuBjdZoz75bMIm/dCY GUhas8wkfZpWXAKV2JYVXFV7bWl33f7guWk9mJ+NjTEfdtE2+X2TDDdBa/419BVFfFQt EQrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=je/4vwCpDMWc32EsFOVCpVOCcUoHSSpBangn9cXhJO8=; fh=hpjHcSul/w9OXVKfpfxF7hJjvlQNewdQfoo8FmPhga0=; b=jWd2u8TAjil7gw/IBpTybhbSwvWaG9c4Tk82GpWpVKVniyQNJWUrW/I6mGtjicut+2 oIlkwNLmNYmUNtnTGiVhEWbshk3Z9b86jGIJRqfMzSHq4tWu+SuYO9UVbY2IZB/BkDLr P27fnxbtx0BHSk8sgmkjNpAcsAQbRnUNwmZT4BjyMHs4yrhuMywWHb2Zsq+1iOMPR9ds zbLtglRO311lg+hAGum78yH6ZhuDqTSwrie3AdMcU8OiAnjx64ndg0KjNWxPH8NyRju9 V1aFRfMFL5eJhdm/DyynXJ5A/wmryL3V5bGBCxmht2C4qIPVkI7IyQTqRS6cULCp5XBt rFCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hIRBbJKA; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-187316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a8bc90si417983b3a.83.2024.05.23.03.16.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:16:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hIRBbJKA; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-187316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 4EE7BB21D2A for ; Thu, 23 May 2024 10:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D4CE13F453; Thu, 23 May 2024 10:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hIRBbJKA" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 B32BD13DDA3; Thu, 23 May 2024 10:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459288; cv=none; b=dme6kzVKMNhHfrqxXncp5+b5am+sTGXUO6BSCQOzVSCxCXjoZpcZiouaJWnWUOgsTgJpHrOpAgmdBpQwrndFhpQYbiOBzQCdiDIMGQuP26BJWK2/12afKnXC1c0NVSjjIImNmDXddyiq5ORfSRrZ4eJ8Nh/O6FDPhPXHXbNK22U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459288; c=relaxed/simple; bh=Y3BoaPFgHcp3e0s6XB11yfnRYltsdW/fEeJj3u9YY7s=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=bKPFTigBkDuMKDOuy+0EkbDQDnYtO5yscVoDBW+u3tw3LEn3Mz0D4Q8I9k0VX1lPCW72MKpI8+LFv0HrFnwVkUSqK/MzxL2SAG0RHaBCmY6Jqikzry1hEh42DeZasq9XB8MUVx9MKzii8l9oYB7BLMn7DpMjZjOuP/eQPujQsWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hIRBbJKA; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1716459284; bh=Y3BoaPFgHcp3e0s6XB11yfnRYltsdW/fEeJj3u9YY7s=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=hIRBbJKAv+89Th/8r3t5WoroS/VXirfeomXc3ufA+imdXW+nEQaSxOJ8vXypVY9Ey crPp7y0zsJfxn0nMkiU7dRio0rM7TJ6ZmTL854wBW4b97PUe8t5jBNBC05S0bjdpj5 N6+MBelc0ZETsp7O9Xs8P+XgEwND9WZavnscf8PTjBCGL0bkKL2qdf17fntZAC4E1N 9hj5X1rw/E72rLVuhKuq05R/conjrZ5spOFno+NC/rijyavg1sdMgVn5s0cg1tnpo0 uwHmr8asNRQKd6CAANDsMkXMpeIfvaULptZJytZYOkR9AEzys58XjMesoLTsG2kJ61 yNqQ4QTv3327g== Received: from [100.95.196.182] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: andrzej.p) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 33FCF37821B3; Thu, 23 May 2024 10:14:43 +0000 (UTC) Message-ID: <537a0969-afdf-4e48-a640-2d8fc665c964@collabora.com> Date: Thu, 23 May 2024 12:14:42 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6,14/24] media: mediatek: vcodec: Add capture format to support one plane memory From: Andrzej Pietrasiewicz To: Yunfei Dong , Jeffrey Kardatzke , =?UTF-8?Q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , 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 , Sumit Semwal , Brian Starkey , John Stultz , "T . J . Mercier" , =?UTF-8?Q?Christian_K=C3=B6nig?= , Matthias Brugger , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20240516122102.16379-1-yunfei.dong@mediatek.com> <20240516122102.16379-15-yunfei.dong@mediatek.com> <1d4618ac-4316-495d-afdb-5849e4b1e805@collabora.com> Content-Language: en-US In-Reply-To: <1d4618ac-4316-495d-afdb-5849e4b1e805@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I'm having second thoughts, please see inline, W dniu 22.05.2024 o 14:26, Andrzej Pietrasiewicz pisze: > Hi Yunfei, > > W dniu 16.05.2024 o 14:20, Yunfei Dong pisze: >> 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 > > Maybe s/one/single ? > >> +        memory. Luma pixel in 16x32 tiles at the start, chroma pixel in 16x16 > > maybe the word "pixel" is reduntant here? What else than pixels could tile sizes mean? > Any padding between luma and chroma? > >> +        tiles at the end. The image height must be aligned with 32 and the image >> +        width must be aligned with 16. > > Maybe aligned to? > >>   .. raw:: latex >>       \normalsize >> diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c >> index 4165c815faef..5ae54cf48dc7 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 = { 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 4c76d17b4629..3a68f2b9e7a4 100644 >> --- a/drivers/media/v4l2-core/v4l2-ioctl.c >> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c >> @@ -1529,6 +1529,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; > > s/One/Single ? > On the other hand "single" would be [in this case incorrectly] associated with single-planar API, which would be totally confusing. Still, the reality you are trying to model is complex: you use MPLANE, yet there's a single plane in case of secure playback. Regards, Andrzej > Regards, > > Andrzej > >>           default: >>               if (fmt->description[0]) >>                   return; >> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h >> index 89eb1a3c6555..7aff2f2c8f9c 100644 >> --- a/include/uapi/linux/videodev2.h >> +++ b/include/uapi/linux/videodev2.h >> @@ -800,6 +800,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 */ >