Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp294043imw; Mon, 4 Jul 2022 09:17:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unkUU8Lj9fYmq9cloPTyCuGn/ZqpVXDhC+pW7St2yuDVfvgEcBgw3ScjsneJ7ze2MiM3kO X-Received: by 2002:a17:902:f64c:b0:16b:d5d4:5ea3 with SMTP id m12-20020a170902f64c00b0016bd5d45ea3mr12468175plg.171.1656951451893; Mon, 04 Jul 2022 09:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656951451; cv=none; d=google.com; s=arc-20160816; b=g74hIWrdBNS8qPm6QJ5wdmE7Rg4VeauaLzvsLLdvRYIB26DcVQpkPSr4ffyJu6gVnu 7bD3+Xixea+Zh3en6B+7B/wvcaOPOI47eg+FpV6fkqqcYDU57tFS/0CTGKN4+jTAGQ4u XHW6/y97aZcoGXbkGJn+LCVXWQYi1h8ZSBmaLuxE20wny8ldwj9cgB39FHXxbhZmuaOT vwF0FrChXYsTiXWwDXX9fwd1LwRImBiLRS9xUZ8N4hjETALT59JPn2BkGrsTfj+ZAqrD HkStxUKKjo8QFNawll2MTPntPlJfE+gaz4RAM4EJMZk9IrfJ3aEffeWheJX0qRb4fr9d kohg== 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=Y3+fv516WzhuqoFG6GDZ1xo1aOHLxTLTnPALmxEsvUY=; b=uQ5h6U3x/u00k7vXzNdmnt0OVo8QgHHUv4t+87UoJeft5uh/vwWgyPk4QX0ri8nHbW wAaJbw8cbJNjX8ZT0gd0lB9b5nxBK1t8WmfrbX8fJe4ri28fjSMlAV0p01ItQvUVXSWM mPn9jm8YoXiW1/1znQmobTFIi6cCtuE0F2JQo8qUSuM3CNr5uIMeUPEDq/IZZGUneH6c bp9AAeBryi+/Zmw/ADjufYaLK0KuEZGXeTfSJKxasue2o84dlMAVrdM2YGRX0AMjEEji /G5rVbjSai+Ipo5gXOJhQ9MqUCMQO0fvIFFYp5xV32ZLm/N8efGau7pDWf/40mLwe/OK 9MtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=M8rctOWb; 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=NONE sp=NONE 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 t24-20020a632258000000b0040cfa279d11si45450806pgm.835.2022.07.04.09.17.19; Mon, 04 Jul 2022 09:17:31 -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=M8rctOWb; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233719AbiGDQJb (ORCPT + 99 others); Mon, 4 Jul 2022 12:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiGDQJ3 (ORCPT ); Mon, 4 Jul 2022 12:09:29 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AF975FE1; Mon, 4 Jul 2022 09:09:25 -0700 (PDT) Received: from nicolas-tpx395.localdomain (mtl.collabora.ca [66.171.169.34]) (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 137006601602; Mon, 4 Jul 2022 17:09:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656950963; bh=tsdjOo4Ixywnge9o2kF/3jfry9i+C/wJYR0HjZ1Mfww=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=M8rctOWbKFzPbUNOSN1sArW1yha7Sfb3DBNFrzbCHHmtj0LaBtyXsgh/wt8R1oQcV v5Vhuz84gwkeSGnWdpPYBLJ2PfP3LOJG4B+8ugpY3LB+qTWEv+PDOS6QAFXTVE9M1p Iq4Mp5u+bBbqKuvZ095NTX8K/17WD3A/PUIgDv1udar7R7HCK4nNHrnJMn4TdlPS0I kGbaMmXhvqYiFV82CRy9MFG6WFcfR9JsLze186b/Gt2mlY8F2+ZV6mxLnD2Je7WNr5 ForrWokOSp/TM/N451zYAV08s4xAQtxfYs+Hv2Fmkc63iUdLNgzYppTIMgDrEfxFeN VdVvwGYqukUuQ== Message-ID: <6bf11fc50bf43a25d02b4ca45c66099d14cdc0e5.camel@collabora.com> Subject: Re: [PATCH] hantro: Fix RK3399 H.264 format advertising From: Nicolas Dufresne To: Ezequiel Garcia , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel , Benjamin Gaignard Date: Mon, 04 Jul 2022 12:09:13 -0400 In-Reply-To: <29056fd2b8ca260ebf7d3babb6c8cf2bf68a112a.camel@collabora.com> References: <20220629195624.45745-1-ezequiel@vanguardiasur.com.ar> <29056fd2b8ca260ebf7d3babb6c8cf2bf68a112a.camel@collabora.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 mercredi 29 juin 2022 =C3=A0 16:07 -0400, Nicolas Dufresne a =C3=A9crit= =C2=A0: > Hi Ezequiel, >=20 > Le mercredi 29 juin 2022 =C3=A0 16:56 -0300, Ezequiel Garcia a =C3=A9crit= =C2=A0: > > Commit 1f82f2df523cb ("media: hantro: Enable H.264 on Rockchip VDPU2") > > enabled H.264 on some SoCs with VDPU2 cores. This had the side-effect > > of exposing H.264 coded format as supported on RK3399. > >=20 > > Fix this and clarify how the codec is explicitly disabled on RK399 on >=20 > RK399 -> RK3399 >=20 > > this driver. > >=20 > > Fixes: 1f82f2df523cb ("media: hantro: Enable H.264 on Rockchip VDPU2") > > Signed-off-by: Ezequiel Garcia >=20 > Thanks for fixing this. The bogus format (without associated controls) is= not Sorry: * is now > gone. With the right video node value: >=20 > v4l2-ctl -D -dN --list-formats-out >=20 > Tested-By: Nicolas Dufresne >=20 > > --- > > .../staging/media/hantro/rockchip_vpu_hw.c | 60 ++++++++++++++++--- > > 1 file changed, 53 insertions(+), 7 deletions(-) > >=20 > > diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/s= taging/media/hantro/rockchip_vpu_hw.c > > index 098486b9ec27..26e16b5a6a70 100644 > > --- a/drivers/staging/media/hantro/rockchip_vpu_hw.c > > +++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c > > @@ -182,7 +182,7 @@ static const struct hantro_fmt rk3288_vpu_dec_fmts[= ] =3D { > > }, > > }; > > =20 > > -static const struct hantro_fmt rk3399_vpu_dec_fmts[] =3D { > > +static const struct hantro_fmt rockchip_vdpu2_dec_fmts[] =3D { > > { > > .fourcc =3D V4L2_PIX_FMT_NV12, > > .codec_mode =3D HANTRO_MODE_NONE, > > @@ -236,6 +236,47 @@ static const struct hantro_fmt rk3399_vpu_dec_fmts= [] =3D { > > }, > > }; > > =20 > > +static const struct hantro_fmt rk3399_vpu_dec_fmts[] =3D { > > + { > > + .fourcc =3D V4L2_PIX_FMT_NV12, > > + .codec_mode =3D HANTRO_MODE_NONE, > > + .frmsize =3D { > > + .min_width =3D FMT_MIN_WIDTH, > > + .max_width =3D FMT_FHD_WIDTH, > > + .step_width =3D MB_DIM, > > + .min_height =3D FMT_MIN_HEIGHT, > > + .max_height =3D FMT_FHD_HEIGHT, > > + .step_height =3D MB_DIM, > > + }, > > + }, > > + { > > + .fourcc =3D V4L2_PIX_FMT_MPEG2_SLICE, > > + .codec_mode =3D HANTRO_MODE_MPEG2_DEC, > > + .max_depth =3D 2, > > + .frmsize =3D { > > + .min_width =3D FMT_MIN_WIDTH, > > + .max_width =3D FMT_FHD_WIDTH, > > + .step_width =3D MB_DIM, > > + .min_height =3D FMT_MIN_HEIGHT, > > + .max_height =3D FMT_FHD_HEIGHT, > > + .step_height =3D MB_DIM, > > + }, > > + }, > > + { > > + .fourcc =3D V4L2_PIX_FMT_VP8_FRAME, > > + .codec_mode =3D HANTRO_MODE_VP8_DEC, > > + .max_depth =3D 2, > > + .frmsize =3D { > > + .min_width =3D FMT_MIN_WIDTH, > > + .max_width =3D FMT_UHD_WIDTH, > > + .step_width =3D MB_DIM, > > + .min_height =3D FMT_MIN_HEIGHT, > > + .max_height =3D FMT_UHD_HEIGHT, > > + .step_height =3D MB_DIM, > > + }, > > + }, > > +}; > > + > > static irqreturn_t rockchip_vpu1_vepu_irq(int irq, void *dev_id) > > { > > struct hantro_dev *vpu =3D dev_id; > > @@ -548,8 +589,8 @@ const struct hantro_variant rk3288_vpu_variant =3D = { > > =20 > > const struct hantro_variant rk3328_vpu_variant =3D { > > .dec_offset =3D 0x400, > > - .dec_fmts =3D rk3399_vpu_dec_fmts, > > - .num_dec_fmts =3D ARRAY_SIZE(rk3399_vpu_dec_fmts), > > + .dec_fmts =3D rockchip_vdpu2_dec_fmts, > > + .num_dec_fmts =3D ARRAY_SIZE(rockchip_vdpu2_dec_fmts), > > .codec =3D HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER | > > HANTRO_H264_DECODER, > > .codec_ops =3D rk3399_vpu_codec_ops, > > @@ -560,6 +601,11 @@ const struct hantro_variant rk3328_vpu_variant =3D= { > > .num_clocks =3D ARRAY_SIZE(rockchip_vpu_clk_names), > > }; > > =20 > > +/* > > + * H.264 decoding explicitly disabled in RK3399. > > + * This ensures userspace applications use the Rockchip VDEC core, > > + * which has better performance. > > + */ > > const struct hantro_variant rk3399_vpu_variant =3D { > > .enc_offset =3D 0x0, > > .enc_fmts =3D rockchip_vpu_enc_fmts, > > @@ -579,8 +625,8 @@ const struct hantro_variant rk3399_vpu_variant =3D = { > > =20 > > const struct hantro_variant rk3568_vpu_variant =3D { > > .dec_offset =3D 0x400, > > - .dec_fmts =3D rk3399_vpu_dec_fmts, > > - .num_dec_fmts =3D ARRAY_SIZE(rk3399_vpu_dec_fmts), > > + .dec_fmts =3D rockchip_vdpu2_dec_fmts, > > + .num_dec_fmts =3D ARRAY_SIZE(rockchip_vdpu2_dec_fmts), > > .codec =3D HANTRO_MPEG2_DECODER | > > HANTRO_VP8_DECODER | HANTRO_H264_DECODER, > > .codec_ops =3D rk3399_vpu_codec_ops, > > @@ -596,8 +642,8 @@ const struct hantro_variant px30_vpu_variant =3D { > > .enc_fmts =3D rockchip_vpu_enc_fmts, > > .num_enc_fmts =3D ARRAY_SIZE(rockchip_vpu_enc_fmts), > > .dec_offset =3D 0x400, > > - .dec_fmts =3D rk3399_vpu_dec_fmts, > > - .num_dec_fmts =3D ARRAY_SIZE(rk3399_vpu_dec_fmts), > > + .dec_fmts =3D rockchip_vdpu2_dec_fmts, > > + .num_dec_fmts =3D ARRAY_SIZE(rockchip_vdpu2_dec_fmts), > > .codec =3D HANTRO_JPEG_ENCODER | HANTRO_MPEG2_DECODER | > > HANTRO_VP8_DECODER | HANTRO_H264_DECODER, > > .codec_ops =3D rk3399_vpu_codec_ops, >=20 > And code looks good (just found a small commit message typo). >=20 > Reviewed-by: Nicolas Dufresne >=20 > regards, > Nicolas >=20 >=20