Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2467379lqt; Mon, 22 Apr 2024 11:29:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULhJ8Calz9DUqDX38H46bgtKkGVRDIIJUnzywAOT7uYoBnUxmYsEgLaa4oIMyLONxUkyD9MhveiX/oiPef784tibV64TseQv/Q3Lfdbw== X-Google-Smtp-Source: AGHT+IGO+q2HHJTFcYJxqz0v7sKimg487R1XjsCWJhhYASd3isJK6PHHEdWQ+DIB128qtM89gZJs X-Received: by 2002:a05:6402:28b0:b0:56e:a76:b79a with SMTP id eg48-20020a05640228b000b0056e0a76b79amr4639748edb.7.1713810571361; Mon, 22 Apr 2024 11:29:31 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g23-20020a056402321700b005721eca8c68si30378eda.93.2024.04.22.11.29.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 11:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153831-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@collabora.com header.s=mail header.b=lH7nP4+9; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-153831-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153831-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 am.mirrors.kernel.org (Postfix) with ESMTPS id E6AB01F21B3D for ; Mon, 22 Apr 2024 18:29:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B370154BEC; Mon, 22 Apr 2024 18:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="lH7nP4+9" 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 0D5D7153BFE; Mon, 22 Apr 2024 18:29:18 +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=1713810560; cv=none; b=kGERI3oU7geF5eHsBi9QQit+1iuOStGeDy8h9pkLj6dirIyePTho/20ZiP8DkSpsh9CNBq5AZXemA0IaCXAlATzrBEvoTS6YOPxr8OxzMeWHkKWJ5cHI3vNUQIOqlT9i2WyNM5ovaUU26UT6va2LmmVCzkQMfanBDzfxZOMW1Wk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713810560; c=relaxed/simple; bh=GOD4rINfoqg2gvTo5pEYQRO1/3RgnuMo9BxRSsHRKEg=; h=Message-ID:Subject:From:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=NfCmQLMBZAJfiVe700TLZqENqLbMUkCSYQX64Z9XU5dTuCSFPyt/QiGizLroaQyAzQyvSwwy+pWYaj60IkY1Hli0ZN7EgYwSikTEoGAs9E2+L48TfiJTPQXOvoCkZzK5V1PopV3Mrd+P5CI4hVWISIyVnc83lt/P3NHTxdiMy0U= 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=lH7nP4+9; 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=1713810557; bh=GOD4rINfoqg2gvTo5pEYQRO1/3RgnuMo9BxRSsHRKEg=; h=Subject:From:To:Cc:In-Reply-To:References:Date:From; b=lH7nP4+99jLiRTeQioXDtZyk2EW0RgKnC9T+pRjW5tJUnLbshwL9Ga3KW8XluNRxv 35a+WMQDNYbgVoF0yVr4rHQ6tjcUku9w3taJ6zHqIRGjIvsdgVHliDtjmE0uWAMCum x9Vu3w+Tsmu9v7mjza5fKUnQR2c3KZfUulYylA0DkSibfa3EzIE0zcqgd2WA+xi4/2 nu6kddFUw1w+PTx/C5hAOImzJx9kAsDMkVvTTzve75bLaPDitpIb/mfiNLEVCeMrqb Y91qRMosf7pufHEHRorQZXulxlc1HTNgVyi7gx5kyWg2OjztCw9X8U1NDKtqfb0+qP HQb/BSI6y0cUg== 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)) (No client certificate requested) (Authenticated sender: nicolas) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E9E373782134; Mon, 22 Apr 2024 18:29:14 +0000 (UTC) Message-ID: <99df0dfe28ae5a4d664abf21f9c023e3f49c5469.camel@collabora.com> Subject: Re: [PATCH v2,3/5] media: mediatek: vcodec: add MM21 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-4-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> <20240409064431.16909-4-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/EXhEEmBR1gL0QJgiVviNyLfGJlZWnPjw6xhhmtHYWTDxBOP5peztyc2PqeKsLsLWzAr7RDTmljb2xhcyBEdWZyZXNuZSAoQi4gU2MuIEluZm9ybWF0aXF1ZSkgPG5pY29sYXMuZHVmcmVzbmVAZ21haWwuY29tPohgBBMRAgAgBQJFlCyOAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQcVMCLawGqBwhLQCgzYlrLBj6KIAZ4gmsfjXD6ZtddT8AoIeGDicVq5WvMHNWign6ApQcZUihtElOaWNvbGFzIER1ZnJlc25lIChCLiBTYy4gSW5mb3JtY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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:20:44 -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 MM21 format to calculate bytesperline > 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 cef1492dba22..0d5de132e07f 100644 > --- a/drivers/media/v4l2-core/v4l2-common.c > +++ b/drivers/media/v4l2-core/v4l2-common.c > @@ -269,6 +269,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_MT2110R, .pixel_enc =3D V4L2_PIXEL_ENC_YUV,= .mem_planes =3D 2, .comp_planes =3D 2, .bpp =3D { 5, 5, 0, 0 }, .bpp_div = =3D { 4, 4, 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_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 }}, MM21 has the same subsampling as NV12M, so hdiv should be 2 for correctness= The 64x64 block is incorrect. The only difference between this and NV12M should= be with block. > =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 },