Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37371614rwd; Tue, 11 Jul 2023 13:20:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlFVxk5JY6SEU+Hqz9DxUMRwfIgjHO5edD33wSylgPRxGUpiM9isYRBh6iRSWYMEUJm2yPBC X-Received: by 2002:a17:903:1246:b0:1b8:6cac:ffe8 with SMTP id u6-20020a170903124600b001b86cacffe8mr18114275plh.51.1689106842827; Tue, 11 Jul 2023 13:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689106842; cv=none; d=google.com; s=arc-20160816; b=QKKbd5h6QxT7MOMA5GG8Gb3AxzKJPHR+5yl3pb9iH2lTNlAyq8YDnbw+js2wZBNX2W +cJNA8TadoBZLKKocdkXC+12Hhq9VTCmPa3pu1Y+DDOsqD3NmdvDsFUzMoK0Zk89HFbN DQGWEix3x2ZzDSWM5JZ/7obflABLhLQGLH9O7O2zrDk8PNaExLcFMbBFcVpY1ZmOzSbA BvTYTkbIHavAj0chEnPAWcEKfz1JIO8jbJuZ7ooSbC8Z0dhsm/+Ax4Ot3WS9CR/cdHm2 qmfqaiP08jfPjXTL5N8Cvvxfq6Phq9lCDtTtPEqV5VTZrzoF42kiAAS11nvp4TKNAmeC /juA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=mtSZWdIroEeWQMuLbi0nZXlrlbYHjc6HArpuNwjw1wQ=; fh=QrUeYkdvzGUpqbyv3zwk1TUmWCEyTEn7JOdYkuPI+dY=; b=f5hLuFplNPOC2igMNP3LlAQ6DcnSO3gp8A67BxcNWBzY74jZHvYqmseccQCFrRgiU9 6hwobfzsZRy612WUTWSVSJ//AvgXF6bCjq5ZNg6y9CS1IM62nEyC3H7vaSk8Xmv0Ii75 qCKhMbmkE/t/KicR7TAOg2WfrhahB5wBx9eGuuda38IehsLxgnPrGjEFfv6MbdMSVQ1u ra1lAMYAkTkAmHsDs0I/KqY7ydPvjsN2xTk2w+616TaybqgOdmKv9wqzXLRPFJ7DwJRo MXF2S3HCvmQ6/G5o8J+0Y3rNG23QQoSUrHEoHEvLybjPfNd5RvKuxEl7/hm3+fn16CtH lWgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="P2wABV4/"; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a170903301400b001b886d36bf6si1903673pla.226.2023.07.11.13.20.29; Tue, 11 Jul 2023 13:20:42 -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=@collabora.com header.s=mail header.b="P2wABV4/"; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbjGKUQ0 (ORCPT + 99 others); Tue, 11 Jul 2023 16:16:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjGKUQY (ORCPT ); Tue, 11 Jul 2023 16:16:24 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9882412F; Tue, 11 Jul 2023 13:16:23 -0700 (PDT) Received: from nicolas-tpx395.localdomain (unknown [IPv6:2606:6d00:10:88d9::7a9]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id C19656606F62; Tue, 11 Jul 2023 21:16:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689106582; bh=ovmdJowpN42/SYoQ1qPuSx2Xrj+upHUIDUOy/UIexEo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=P2wABV4/5DuKFdpMw5cXOR4VE6I17sU/p7+weZxlH9MHNQYCDBdrEu9jyQpS7ssdH yPWRFWIBh/xC04Azx3hbDfsT6s12cDRwHZUSbU9r6a8XUBXF9aDhkGvTR7EvzUXhxt lKrer9ywLoE8tQAeSO15tdQcyTTYdRB1BE7FOhoBHPZk1E1YXMjFmf7wYKqFfPzQB2 rJ0cpVD/kMZW9AZ/zdmfQVyKD7gTiOwQRrgYEIZ43kAhHIdp593uEyftSzVYWZCx9f dkJUYSPdYipii3YJHBrP4nWagSe7jmQu19tjB74pOkp3kqAOCOBJ96ehnxeNXJQrkU BaHA6TBWTtwCg== Message-ID: Subject: Re: [PATCH 1/3] media: mediatek: vcodec: Add capture format to support 10bit tile mode 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 Cc: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Mingjia Zhang , 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 Date: Tue, 11 Jul 2023 16:16:11 -0400 In-Reply-To: <20230711125749.15555-2-yunfei.dong@mediatek.com> References: <20230711125749.15555-1-yunfei.dong@mediatek.com> <20230711125749.15555-2-yunfei.dong@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 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_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 Le mardi 11 juillet 2023 =C3=A0 20:57 +0800, Yunfei Dong a =C3=A9crit=C2=A0= : > From: Mingjia Zhang >=20 > Define one uncompressed capture format V4L2_PIX_FMT_MT2110T in order to > support 10bit for AV1/VP9/HEVC in mt8195. >=20 > Signed-off-by: Mingjia Zhang > Co-developed-by: Yunfei Dong > 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(+) >=20 > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/= Documentation/userspace-api/media/v4l/pixfmt-reserved.rst > index 58f6ae25b2e7..b16a7257580c 100644 > --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst > +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst > @@ -275,6 +275,14 @@ please make a proposal on the linux-media mailing li= st. > =20 > Decoder's implementation can be found here, > `aspeed_codec `= __ > + * .. _V4L2-PIX-FMT-MT2110T: > + > + - ``V4L2_PIX_FMT_MT2110T`` > + - 'MT2110T' > + - Two-planar 10-Bit tile mode YVU420 format used by Mediatek MT819= 5, MT8188 > + 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. Documenting uncompressed video formats as "opaque" is always last resort in V4L2. There is no justification here since this format is already implement= ed in software and pending in GStreamer (so its well understood format). I will t= ry and provide some better doc for you to include. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3444 > .. raw:: latex > =20 > \normalsize > diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-c= ore/v4l2-common.c > index bee1535b04d3..869fc09a210b 100644 > --- a/drivers/media/v4l2-core/v4l2-common.c > +++ b/drivers/media/v4l2-core/v4l2-common.c > @@ -262,6 +262,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 f= ormat) > { .format =3D V4L2_PIX_FMT_VYUY, .pixel_enc =3D V4L2_PIXEL_ENC_YUV,= .mem_planes =3D 1, .comp_planes =3D 1, .bpp =3D { 2, 0, 0, 0 }, .bpp_div = =3D { 1, 1, 1, 1 }, .hdiv =3D 2, .vdiv =3D 1 }, > { .format =3D V4L2_PIX_FMT_Y212, .pixel_enc =3D V4L2_PIXEL_ENC_YUV,= .mem_planes =3D 1, .comp_planes =3D 1, .bpp =3D { 4, 0, 0, 0 }, .bpp_div = =3D { 1, 1, 1, 1 }, .hdiv =3D 2, .vdiv =3D 1 }, > { .format =3D V4L2_PIX_FMT_YUV48_12, .pixel_enc =3D V4L2_PIXEL_ENC_YUV= , .mem_planes =3D 1, .comp_planes =3D 1, .bpp =3D { 6, 0, 0, 0 }, .bpp_div = =3D { 1, 1, 1, 1 }, .hdiv =3D 1, .vdiv =3D 1 }, > + { .format =3D V4L2_PIX_FMT_MT2110T, .pixel_enc =3D V4L2_PIXEL_ENC_YUV,= .mem_planes =3D 2, .comp_planes =3D 2, .bpp =3D { 5, 10, 0, 0 }, .bpp_div = =3D { 4, 4, 1, 1 }, .hdiv =3D 2, .vdiv =3D 2, > + .block_w =3D { 16, 8, 0, 0 }, .block_h =3D { 32, 16, 0, 0 }}, > =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 }, > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-co= re/v4l2-ioctl.c > index 01ba27f2ef87..f465c0e3d6e3 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -1508,6 +1508,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *f= mt) > case V4L2_PIX_FMT_QC10C: descr =3D "QCOM Compressed 10-bit Format"; br= eak; > case V4L2_PIX_FMT_AJPG: descr =3D "Aspeed JPEG"; break; > case V4L2_PIX_FMT_AV1_FRAME: descr =3D "AV1 Frame"; break; > + case V4L2_PIX_FMT_MT2110T: descr =3D "Mediatek 10bit Tile Mode"; break= ; > default: > if (fmt->description[0]) > return; > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev= 2.h > index 3af6a82d0cad..8c7d71afbdc7 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -796,6 +796,7 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth d= ata 16-bit */ > #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediate= k compressed block mode */ > #define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediate= k 8-bit block mode, two non-contiguous planes */ > +#define V4L2_PIX_FMT_MT2110T v4l2_fourcc('M', 'T', '2', 'T') /* Mediate= k 10-bit block tile mode */ > #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel P= lanar 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 */