Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2467528lqt; Mon, 22 Apr 2024 11:29:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPdm3ELyN6abDEIIjSkT2QvIPeZGy05qYTXSrUK2J4x/pF19ihmLZLFn4cMGMzQFQbZe1hRBzQzVqUKids4xsisPJhUYfNJe+c83CE6A== X-Google-Smtp-Source: AGHT+IFWc4FMWSNJHsxnOyKTLkRTPZd8qTpMpsaawqDq2wqKHiNiZ2fLCv9wA3tjI8IyPlR94472 X-Received: by 2002:a5b:948:0:b0:dc7:43aa:5c0b with SMTP id x8-20020a5b0948000000b00dc743aa5c0bmr10221672ybq.21.1713810585647; Mon, 22 Apr 2024 11:29:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713810585; cv=pass; d=google.com; s=arc-20160816; b=o2hKERl08bMnWrFiiyblhMqXN9XQDgi8vh7hyzmhxS6+qQngYfR+MJspBzBITXtbUh UyA6UieKatNaALxkqug/JG+02XYl5bL9djVDK7VBakJY7HDoSxVUXHp3+Q5A5ueYYrm5 1gRLghW8H7/xLc+KbhqFKljAUUJGaIr1iIy6rYZG1vquu7zyQCMXQoFhHK2ECWCbrhob NWNuj2SE8wu1qhKEd6/viBhYf3LxkGY+joQQYXpD4/il+VcXvimnGymxfIQdNrpD1U/L ChHXrZlPMuw88cHpFjzGzHyVkky6NYxX/0i+ljAh1leDOJPOjS34lGIsMQsYjTUMu3VA x1nQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:content-transfer-encoding:autocrypt:references :in-reply-to:cc:to:from:subject:message-id:dkim-signature; bh=16jkLD/Jb8wlNCarypqSg5A9BaF21KaHsxOGivdahY0=; fh=xQERF+eaMof5KNiI50+Wwdwyv1W2i2yFzz/V0JCkiu4=; b=BUYA+OC3jHHDwCImJjHibrXfADfP496Yhoed/MBJsrzv20UiASb3qAOsrL3CJ6k/0y 3Ce+X1Y/qzubNAIYIFBa7K5A3OzSM1anQErCDrdHZLlmtmYthDl3BxdiDwarTpVC4zlv glXZ/k30668/IMJAvbE5Tgf9f+JwwWiLn61E8GeNcETTjJHZMdRGKpCCw1e0qXvAh5jK 9Yao3SBsbhDrKDLjcuEl1Dl35TpSmWRPxqyLQfAgJ40XTCMQYChF9PgsDNb2CIq1wf+U ZjDK3TSQVXRyZ+OPV2UNg6svCwmxNfW+W6YOd6FTWugNW51+BynHIwDpsGlMvB1WkCVB vPkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dFKQQzcq; 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-153832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jr10-20020a0562142a8a00b0069685a3332fsi10773098qvb.463.2024.04.22.11.29.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 11:29:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dFKQQzcq; 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-153832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153832-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 523911C20D78 for ; Mon, 22 Apr 2024 18:29:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B6781552E4; Mon, 22 Apr 2024 18:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dFKQQzcq" 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 58167153BFE; Mon, 22 Apr 2024 18:29:25 +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=1713810567; cv=none; b=DkO3ygfsWTAQJB63u2JDg9M1QIp72Q3BDia9urAAGIHDmB1q7Dy8Eh578cswztlJRjLj0LzoQCRFhyQoqcSnes57QEGM/sVmJnu+VLbavg6tQooapSx5mGyjgnY7l+QJ/jvbQnzYsTdcU1EEhji8kubDsv4mI6ZCElLdgup++kQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713810567; c=relaxed/simple; bh=m+nDW6b/eB4Ha2+acNVpqHBPt12qJH/nspZVysjD1q8=; h=Message-ID:Subject:From:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=i+0ypm9fM9kEhagpSM6RYzaGgosaVooyLfUbxm/e9VG6R2I8aktdH8cvS/scTwcWxpP653xL6wQfRoRSsLlgvolIjDaTnICgQmEEYJ3XhhgLtVQWPZhJNP8W825kg7rBeW4lE4SFO1qeeN01dhRVoAi4F8S4oNrFJyYrRyBagho= 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=dFKQQzcq; 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=1713810563; bh=m+nDW6b/eB4Ha2+acNVpqHBPt12qJH/nspZVysjD1q8=; h=Subject:From:To:Cc:In-Reply-To:References:Date:From; b=dFKQQzcqL3PMbXRFFReTEpOOlhADJXPHtqrNvfqzovYraekxDkSD4sLqBhrQ7bYk8 Wnt8SLyDC/53tyZHsS8/WeGMjjWK2gdSeQEe5Vr1d6TM3v4Pci7shq45sWI0nyCnwR BJhw6o8IGw6AD5dbobgFkfhvUYwsHWggjeM0xtO5NxWk05J8vuDdjyc03a6X8HL8Gy oJzW446QdV5YjLrHW1+mzg/iUU/uvmXZWWTax9CBoacq6F3bRtZOgzZ+9rbaCaH/ZB TsvbdhEOQ7zxqaNaGj2YleH4n9Php2ciZIR5z6/a3gnGUBvg7Nd7jhJceKXMGL9Tu9 noeCzla1EaK8g== Received: from nicolas-tpx395.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 98DAA3782139; Mon, 22 Apr 2024 18:29:21 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2,4/5] media: mediatek: vcodec: add MT21 format definition From: Nicolas Dufresne To: Yunfei Dong , =?ISO-8859-1?Q?N=EDcolas?= "F . R . A . Prado" , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke Cc: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com In-Reply-To: <20240409064431.16909-5-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> <20240409064431.16909-5-yunfei.dong@mediatek.com> Autocrypt: addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual; keydata=mQGiBEUQN0MRBACQYceNSezSdMjx7sx6gwKkMghrrODgl3B0eXBTgNp6c431IfOOEsdvkoOh1kwoYcQgbg4MXw6beOltysX4e8fFWsiRkc2nvvRW9ir9kHDm49MkBLqaDjTqOkYKNMiurFW+gozpr/lUW15QqT6v68RYe0zRdtwGZqeLzX2LVuukGwCg4AISzswrrYHNV7vQLcbaUhPgIl0D+gILYT9TJgAEK4YHW+bFRcY+cgUFoLQqQayECMlctKoLOE69nIYOc/hDr9uih1wxrQ/yL0NJvQCohSPyoyLF9b2EuIGhQVp05XP7FzlTxhYvGO/DtO08ec85+bTfVBMV6eeY4MS3ZU+1z7ObD7Pf29YjyTehN2Dan6w1g2rBk5MoA/9nDocSlk4pbFpsYSFmVHsDiAOFje3+iY4ftVDKunKYWMhwRVBjAREOByBagmRau0cLEcElpf4hX5f978GoxSGIsiKoDAlXX+ICDOWC1/EXhEEmBR1gL0QJgiVviNyLfGJlZWnPjw6xhhmtHYWTDxBOP5peztyc2PqeKsLsLWzAr7RDTmljb2xhcyBEdWZyZXNuZSAoQi4gU2MuIEluZm9ybWF0aXF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PG5pY29sYXMuZHVmcmVzbmVAdXNoZXJicm9va2UuY2E+iGAEExECACAFAkUQN0MCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRBxUwItrAaoHPTnAJ0WGgJJVspoctAvEcI00mtp5WAFGgCgr+E7ItOqZEHAs+xabBgknYZIFPW5Ag0ERRA3UhAIAJ0rxl2HsVg/nSOAUt7U/T/W+RKzVAlD9orCB0pRVvyWNxSr8MHcHmWCxykLuB34ouM4GuDVRKfGnqLzJRBfjs7Ax9K2FI3Odund9xpviLCt1jFC0K XL04RebrFT7xjDfocDaSLFvgxMVs/Jr2/ckKPId1oKvgYgt/o+MzUabKyFB8wIvq4GMtj3LoBKLCie2nCaSt7uVUt6q2t5bNWrd3lO6/mWn7YMc5Hsn33H9pS0+9szw6m3dG08eMKNueDlt72QxiYl2rhjzkT4ltKEkFgYBdyrtIj1UO6eX+YXb4E1rCMJrdjBSgqDPK1sWHC7gliy+izr+XTHuFwlfy8gBpsAAwUIAJJNus64gri4HAL632eqVpza83EphX1IuHzLi1LlMnQ9Tm7XKag46NhmJbOByMG33LwBsBdLjjHQSVkYZFWUifq+NWSFC/kqlb72vW8rBAv64+i3QdfxK9FWbweiRsPpvuHjJQuecbPDJpubLaxKbu2aqLCN5LuHXvdQr6KiXwabT+OJ9AJAqHG7q4IEzg4RNUVn9AS6L8bxqMSocjqpWNBCY2efCVd/c6k4Acv6jXu+wDAZEbWXK+71uaUHExhigBYBpiHGrobe32YlTVE/XEIzKKywhm/Hkn5YKWzumLte6xiD9JhKabmD7uqIvLt2twUpz4BdPzj0dvGlSmvFcaaISQQYEQIACQUCRRA3UgIbDAAKCRBxUwItrAaoHJLyAKDeS3AFowM3f1Y3OFU6XRCTKK2ZhwCfT/7P9WDjkkmiq5AfeOiwVlpuHtM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 18 Apr 2024 16:24:48 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Le mardi 09 avril 2024 =C3=A0 14:44 +0800, Yunfei Dong a =C3=A9crit=C2=A0: > Adding the definition of MT21 format to calculate bytesperline MT21C in the subject and description. > and sizeimage of plane[0] and plane[1]. >=20 > Signed-off-by: Yunfei Dong > --- > drivers/media/v4l2-core/v4l2-common.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-c= ore/v4l2-common.c > index 0d5de132e07f..6dba989c2291 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 f= ormat) > .block_w =3D { 64, 64, 0, 0 }, .block_h =3D { 64, 64, 0, 0 }}, > { .format =3D V4L2_PIX_FMT_MM21, .pixel_enc =3D V4L2_PIXEL_ENC_YUV, .m= em_planes =3D 2, .comp_planes =3D 2, .bpp =3D { 1, 1, 0, 0 }, .bpp_div =3D = { 1, 1, 1, 1 }, .hdiv =3D 1, .vdiv =3D 2, > .block_w =3D { 64, 64, 0, 0 }, .block_h =3D { 64, 64, 0, 0 }}, > + { .format =3D V4L2_PIX_FMT_MT21C, .pixel_enc =3D V4L2_PIXEL_ENC_YUV, .= mem_planes =3D 2, .comp_planes =3D 2, .bpp =3D { 1, 1, 0, 0 }, .bpp_div =3D= { 1, 1, 1, 1 }, .hdiv =3D 1, .vdiv =3D 2, > + .block_w =3D { 64, 64, 0, 0 }, .block_h =3D { 64, 64, 0, 0 }}, As you may notice, we have no support for compressed formats yet in this he= lper. I believe for these formats we need some extra code to add the header size calculation. One way could be to add a ops in that table for when a header = is needed. That ops would implement the format specific extra space calculatio= n which would be added to sizeimage of each planes (in in one of the planes depending on the specifics of the format). > =20 > /* YUV planar formats */ > { .format =3D V4L2_PIX_FMT_NV12, .pixel_enc =3D V4L2_PIXEL_ENC_YUV,= .mem_planes =3D 1, .comp_planes =3D 2, .bpp =3D { 1, 2, 0, 0 }, .bpp_div = =3D { 1, 1, 1, 1 }, .hdiv =3D 2, .vdiv =3D 2 },